Commit dfd9db9d by Maximilian Vitz

### Updated Lecture 2 and Lecture 3

parent 0473dcd0
 %% Cell type:markdown id:4e98befd-a710-4193-9393-d52d8a7fbcc3 tags: ## Poisson distribution \$\$ P(k; \lambda) = \frac{\lambda^k}{k!} \mbox{e}^{-\lambda}\$\$ %% Cell type:code id:9c2b256c-333a-4b6c-8241-523b8aeb919f tags: ``` python from scipy.stats import poisson, binom ``` %% Cell type:code id:ccf39158-28be-4ba4-a898-a5b14be924e1 tags: ``` python poisson.pmf(2,3.5) ``` %%%% Output: execute_result 0.18495897346170082 %% Cell type:code id:6643ab02-3c24-40b8-90e2-c0ffab308f16 tags: ``` python poisson.pmf(0,3.5)+poisson.pmf(1,3.5)+poisson.pmf(2,3.5) ``` %%%% Output: execute_result 0.3208471988621341 %% Cell type:code id:19fc9d45-64f9-4e0f-adab-b044c59a083e tags: ``` python poisson.cdf(2,3.5) ``` %%%% Output: execute_result 0.32084719886213414 %% Cell type:markdown id:9d2578c1-302c-4ea4-8308-8c80d5ab9288 tags: ## Binomial distribution \$\$ B(k;N,p) = \left( \begin{array}{c} N \\ k \\ \end{array} \right) p^k (1-p)^{N-k} \$\$ %% Cell type:code id:a9d78b0f-49ca-44c8-964b-ab1d593ce540 tags: ``` python binom.pmf(2,10,0.3) ``` %%%% Output: execute_result 0.2334744405 %% Cell type:code id:4c029640-fec5-4aeb-9644-7e965b0dcbee tags: ``` python binom.pmf(0,10,0.3)+binom.pmf(1,10,0.3)+binom.pmf(2,10,0.3) ``` %%%% Output: execute_result 0.3827827864000002 %% Cell type:code id:fa781bea-3265-4915-b299-0870a76b8053 tags: ``` python binom.cdf(2,10,0.3) ``` %%%% Output: execute_result 0.3827827864 %% Cell type:code id:a88c9312-41d1-44ba-b600-ca8fcbbb5c75 tags: ``` python ```