User Tools

Site Tools


b:head_first_statistics:poisson_distribution

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
b:head_first_statistics:poisson_distribution [2025/10/07 06:51] – [Two Poisson distribution cases] hkimscilb:head_first_statistics:poisson_distribution [2025/10/07 08:42] (current) – [Poisson Distribution] hkimscil
Line 46: Line 46:
 \end{eqnarray*} \end{eqnarray*}
  
 +<code>
 +> dpois(3, 2)
 +[1] 0.180447
 +>
 +
 +</code>
 ====== What does the Poisson distribution look like? ====== ====== What does the Poisson distribution look like? ======
  
Line 233: Line 239:
 \end{eqnarray*} \end{eqnarray*}
  
-===== Broken Cookies case =====+====== Broken Cookies case ======
 <WRAP box> <WRAP box>
 The Case of the Broken Cookies The Case of the Broken Cookies
Line 353: Line 359:
  
 </WRAP> </WRAP>
 +
 +====== Exercise ======
 +<WRAP box>
 +Here are some scenarios. Your job is to say which distribution each of them follows, say what the expectation and variance are, and find any required probabilities. 
 +
 +1. A man is bowling. The probability of him knocking all the pins over is 0.3. If he has 10 shots, what’s the probability he’ll knock all the pins over less than three times?
 +
 +Binomial distribution 을 이용한다면, 
 +\begin{eqnarray*}
 +X & \sim & B(n, p) \\
 +X & \sim & B(10, 0.3) 
 +\end{eqnarray*}
 +
 +\begin{eqnarray*}
 +E(X) & = & np \\
 +& = & 10 * 0.3 \\
 +& = & 3
 +\end{eqnarray*}
 +
 +\begin{eqnarray*}
 +Var(X) & = & npq \\
 +& = & 10 * 0.3 * 0.7 \\
 +& = & 2.1
 +\end{eqnarray*}
 +
 +r을 이용한다면 ''pbinom'' 혹은 ''dbinom'' 을 이용한다.
 +
 +<code>
 +> pbinom(q=2, 10, 0.3)
 +[1] 0.3827828
 +
 +> sum(dbinom(0:2, 10, 0.3))
 +[1] 0.3827828
 +
 +
 +</code>
 +
 +손으로 계산을 한다고 하면, 
 +$P(X=0), P(X=1), P(X=2)$를 구한 후 모두 더하여 P(X < 3)을 구한다. 
 +
 +\begin{eqnarray*}
 +P(X = 0) & = & {10 \choose 0} * 0.3^0 * 0.7^{10} \\
 +& = & 1 * 1 * 0.028 \\
 +& = & 0.028 
 +\end{eqnarray*}
 +
 +\begin{eqnarray*}
 +P(X = 1) & = & {10 \choose 1} *0.3^1 * 0.7^9 \\
 +& = & 10 * 0.3 * 0.04035 \\
 +& = & 0.121
 +\end{eqnarray*}
 +
 +\begin{eqnarray*}
 +P(X = 2) & = & {10 \choose 2} * 0.3^2 * 0.7^8 \\
 +& = & 45 * 0.09 * 0.0576 \\
 +& = & 0.233
 +\end{eqnarray*}
 +
 +\begin{eqnarray*}
 +P(X<3) & = & P(X=0) + P(X=1) + P(X=2) \\
 +& = & 0.028 + 0.121 + 0.233 \\
 +& = & 0.382
 +\end{eqnarray*}
 +</WRAP>
 +
 +<WRAP box>
 +2. On average, 1 bus stops at a certain point every 15 minutes. What’s the probability that __<fc #ff0000>no buses</fc>__ will turn up in a single 15 minute interval?
 +
 +위는 Poisson distribution 문제이므로 기대값과 분산값은 각각 lambda 값인 1 (15분마다 1대씩 버스가 온다고 한다)
 +
 +\begin{eqnarray*}
 +P(X=0) & = & \frac {e^{-1}{1^0}}{0!} \\
 +& = & \frac {e^{-1} * 1}{1} \\
 +& = & .368 
 +\end{eqnarray*}
 +</WRAP>
 +
 +<code>
 +> dpois(0, 1)
 +[1] 0.3678794
 +
 +> ppois(0, 1)
 +[1] 0.3678794
 +
 +</code>
 +
 +<WRAP box>
 +3. 20% of cereal packets contain a free toy. What’s the probability you’ll need to open fewer than 4 cereal packets before finding your first toy?
 +
 +이는 geometric distribution 문제이므로, 
 +
 +$$X \sim Geo(.2)$$
 +
 +$P(X \le 3)$ 을 구하는 문제이므로 
 +
 +\begin{eqnarray*}
 +P(X \le 3) & = & 1 - q^r \\
 +& = & 1 - 0.8^{3} \\
 +& = & 1 - 0.512 \\
 +& = & 0.488
 +\end{eqnarray*}
 +
 +<code>
 +> sum(dgeom(0:2,0.2))
 +[1] 0.488
 +>   
 +> pgeom(2, 0.2)
 +[1] 0.488
 +
 +
 +</code>
 +
 +
 +기대값과 분산은 각각 $1/p$, $q/p^2$ 이므로 $5$와 $20$.
 +</WRAP> 
  
b/head_first_statistics/poisson_distribution.1759787494.txt.gz · Last modified: by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki