The binomial distribution
The binomial distribution is important for discrete variables. There are a few conditions that need to be met before you can consider a random variable to binomially distributed:
- There is a phenomenon or trial with two possible outcomes and a constant probability of success - this is called a Bernoulli trial
- All trials are independent
Other ingredients that are essential to a binomial distribution is that we need to observe a certain number of trials, let's call this n, and we count the number of successes in which we are interested, let's call this x. Useful summary statistics for a binomial distribution are the same as for the normal distribution: the mean and the standard deviation.
The mean is calculated by multiplying the number of trials n by the probability of a success denoted by p. The standard deviation of a binomial distribution is calculated by the following formula: \(\sqrt{n * p * (1 - p)}\).
This exercise is part of the course
Basic Statistics
Exercise instructions
- Consider an example where we have made an exam consisting of 25 multiple choice questions. Each questions has 5 possible answers. This means that the probability of answering a question correctly by chance is 0.2. Calculate the mean of this distribution and store it in a variable called
mean_chance
- Calculate the standard deviation of this distribution and store it in the variable
std_chance
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# calculate the mean and store it in the variable mean_chance
# calculate the standard deviation and store it in the variable std_chance