Welcome to Westonci.ca, where you can find answers to all your questions from a community of experienced professionals. Get quick and reliable solutions to your questions from a community of seasoned experts on our user-friendly platform. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.
Sagot :
Answer:
from math import comb
n = 100
x = 20
p = 0.26
q = 0.76
print(comb(n, x)*(p**x)*(q**(n-x)))
Step-by-step explanation:
Given that :
Number of trials, n = 100
P(success), p = 26% = 0.26
P(success)' = 1 - p = 1 - 0.26 = 0.74
Chance that sample has 20 successes = x
This problem meets the condition for a binomial probability distribution :
p(x = 20)
Recall :
P(x = x) = nCx * p^x * q^(n-x)
Using python :
comb is an built in function which calculate the combination of two arguments it takes ; and returns the combination value.
** mean raised to the power and
* is used for multiplication
The Python code as per the given question is provided below.
Program explanation:
The number of trials,
- 100
Probability of success,
- 20% or 0.26
Size of array generated,
- 2000
The output that shows chances of 20 success,
- S
Program code:
import numpy as np
S=sum(np.random.binomial(100,0.26,2000)==20)/2000
S
Learn more about Python expression here:
https://brainly.com/question/21645017
We hope our answers were helpful. Return anytime for more information and answers to any other questions you may have. Thanks for using our service. We're always here to provide accurate and up-to-date answers to all your queries. Keep exploring Westonci.ca for more insightful answers to your questions. We're here to help.