1. Probability and Statistics - 4
Problem Statement
- In each of 4 different competitions, Jin has a 60% chance of winning.
- Assuming that the competitions are independent of each other, what is the probability that; Jin will win at least 1 race. Use Binomial distribution
Note:
- Display the probability in decimal rounded off to 2 decimal places
- Hint: P(x>=1)=1-P(x=0)
- Use the binom.pmf() function of scipy.stats package.
Function Description
Function Name: binomial()
1. Output:
- ans: Float - Denotes the probability that jin will win at least 1 race
from scipy import stats
def binomial():
'''
output: ans : Float
'''
#Write your code here
n = 0
p = 4
k = 0.60
prob = stats.binom.pmf(n,p,k)
ans = round(1-prob,2)
#Assign the probability value to the variable ans
actuall = 1 - prob
#Round off to 2 decimal places
return ans
if __name__=='__main__':
print(binomial())
No comments:
Post a Comment
If you have any doubts, Please let us know.