This commit is contained in:
Vhizux
2020-10-25 21:58:31 +01:00
parent e5efd5f92d
commit 36fbf84839

View File

@@ -29,11 +29,11 @@ def binomialDistFunc():
"batch of {1:} pistons will contain no more than {2:} " \ "batch of {1:} pistons will contain no more than {2:} " \
"rejected pistons?".format(rejected_fraction, batch, rejections) "rejected pistons?".format(rejected_fraction, batch, rejections)
for i in range(0, rejections+1): for i in range(0, rejections + 1):
answer += newton_symbol(float(batch), float(i))*((rejected_fraction/100.)**float(i)) * \ answer += newton_symbol(float(batch), float(i)) * ((rejected_fraction / 100.) ** float(i)) * \
((1 - (rejected_fraction/100.))**(float(batch)-float(i))) ((1 - (rejected_fraction/100.)) ** (float(batch)-float(i)))
answer = round(100*answer, 2) answer = round(100 * answer, 2)
return problem, answer return problem, answer