Skip to content
Advertisement

Scipy – probability in binomial distribution

I’m trying to use scipy in order to calculate a probability, given a binomial distribution:

The probability: in an exam with 45 questions, each one with 5 items, what is the probability of randomly choose right (instead of wrong) more than half the exam, that is, 22.5?

I’ve tried:

JavaScript

How do I calculate this with scipy?

Advertisement

Answer

Assuming there’s exactly one correct choice for each question, the random variable X which counts the number of correctly answered questions by choosing randomly is indeed binomial distributed with parameters n=45 and p=0.2. Hence, you want to calculate P(X >= 23) = P(X = 23 ) + ... + P(X = 45 ) = 1 - P(X <= 22), so there are two ways to compute it:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement