* This calculates how many sigma needed from scipy.stats import norm # def findSigma(errval): # tar = (1.0 - errval/2.0) # return(norm.ppf(tar)) def findSigma(errval): tar = errval/2.0 return(-norm.ppf(tar)) for i in range(1, 16): gsiz = 10**i erra = 1/gsiz nsig = findSigma(erra) print("1e-%02d %0.4f" % (i, nsig)) greg@DBK8S5D3:~$ python3 junk.py 1e-01 1.6449 1e-02 2.5758 1e-03 3.2905 1e-04 3.8906 1e-05 4.4172 1e-06 4.8916 1e-07 5.3267 1e-08 5.7307 1e-09 6.1094 1e-10 6.4670 1e-11 6.8065 1e-12 7.1305 1e-13 7.4409 1e-14 7.7393 1e-15 8.0269 greg@DBK8S5D3:~$ * ********************************************************************************** Poisson Distribution * ********************************************************************************** In the World Cup, an average of 2.5 goals are scored each game. Modeling this situation with a Poisson distribution, what is the probability that kk goals are scored in a game? Conditions for Poisson Distribution: * An event can occur any number of times during a time period. * Events occur independently. In other words, if an event occurs, it does not affect the probability of another event occurring in the same time period. * The rate of occurrence is constant; that is, the rate does not change based on time. * The probability of an event occurring is proportional to the length of the time period. For example, it should be twice as likely for an event to occur in a 2 hour time period than it is for an event to occur in a 1 hour period. Let X be how many events happen of a fixed time interval. Let lamda be the average number of events that are known to happen over that interval. (X is an integer, lamda can be a real number) Example average number of interruptions per hour = 3.217 Then lamda = 3.217 X could be 0, 1, 2, 3, 4, 5, 6, 7, 8, ..... 20 X could be bigger than 20, but practically speaking it coundn't We thus must have P(X=0) + P(X=1) + ... + P(X=20) = 1.0 P(X=k) = lamda^k * exp(-lamda) / k! Example : In the World Cup, an average of 2.5 goals are scored each game. Modeling this situation with a Poisson distribution, what is the probability that k goals are scored in a game? P(X=0) = 2.5^0 * exp(-2.5) / 0! = 0.082 P(X-1) = 2.5^1 * exp(-2.5) / 1! = 0.205 P(X-1) = 2.5^2 * exp(-2.5) / 2! = 0.257 . . . * **********************************************************************************