feat: poisson distribution (py)
This commit is contained in:
parent
5b5aa44feb
commit
3a5b369593
1 changed files with 11 additions and 0 deletions
11
poisson/main.py
Normal file
11
poisson/main.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import math
|
||||||
|
|
||||||
|
a = list(map(float, input().split(' ')))
|
||||||
|
rate = a[0]
|
||||||
|
|
||||||
|
sums = 0
|
||||||
|
|
||||||
|
for i in range(1,len(a)):
|
||||||
|
sums += round(math.e**(-1*rate) * (rate**a[i]/math.factorial(int(a[i]))), 4)
|
||||||
|
|
||||||
|
print(sums)
|
Loading…
Reference in a new issue