This commit is contained in:
Vhizux
2020-10-25 22:03:12 +01:00
parent 226f6bb36d
commit 6079b20c29
2 changed files with 9 additions and 4 deletions

5
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.enabled": true
}

View File

@@ -6,11 +6,11 @@ def factorial(n):
if n == 1 or n == 0:
return 1
else:
return n * factorial(n-1)
return n * factorial(n - 1)
def newton_symbol(n, k):
return factorial(n) / (factorial(k) * factorial(n-k))
return factorial(n) / (factorial(k) * factorial(n - k))
def binomialDistFunc():
@@ -31,7 +31,7 @@ def binomialDistFunc():
for i in range(0, rejections + 1):
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)