mean_and_variance_of_binomial_distribution
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mean_and_variance_of_binomial_distribution [2024/10/09 10:16] – [For Mean] hkimscil | mean_and_variance_of_binomial_distribution [2024/10/14 17:06] (current) – [For variance] hkimscil | ||
---|---|---|---|
Line 31: | Line 31: | ||
====== For Mean ====== | ====== For Mean ====== | ||
- | \begin{eqnarray} | + | \begin{eqnarray*} |
- | E(X) & = & \sum_{x}x p(x) \nonumber | + | E(X) & = & \sum_{x}x p(x) \;\;\; \because \; p(x) = {{n}\choose{x}} p^x (1-p)^{n-x} |
- | & = & \sum_{x=0}^{n} x {{n}\choose {x}} p^x(1-p)^{n-x} | + | & = & \sum_{x=0}^{n} x {{n} \choose {x}} p^x(1-p)^{n-x} |
- | & = & \sum_{x=0}^{n} x \frac{n!}{x!(n-x)!} p^x(1-p)^{n-x} | + | & = & \sum_{x=0}^{n} x \frac{n!}{x!(n-x)!} p^x(1-p)^{n-x} |
- | \text{note that } x! = x(x-1)! | + | \text{note that } x! = x(x-1)! |
- | & = & \sum_{x=1}^{n} \frac{n!}{(x-1)!(n-x)!} p^x(1-p)^{n-x} | + | & = & \sum_{x=1}^{n} \frac{n!}{(x-1)!(n-x)!} p^x(1-p)^{n-x} |
- | \text{cause we know that E(x) = np,} \nonumber | + | \text{cause we know that E(x) = np,} \\ |
- | \text{we extract np outside from summation} | + | \text{we extract np outside from summation} \\ |
- | \text{note that } p^x = p * p^{x-1} | + | \text{note that } p^x = p * p^{x-1} \\ |
- | \text{and | + | \text{and |
- | & = & \sum_{x=1}^{n} \frac{\underline{n}*(n-1)!}{(x-1)!(n-x)!} (\underline{p}*p^{x-1})(1-p)^{n-x} | + | & = & \sum_{x=1}^{n} \frac{\underline{n}*(n-1)!}{(x-1)!(n-x)!} (\underline{p}*p^{x-1})(1-p)^{n-x} |
- | \text{we take out the underlined part} | + | \text{we take out the underlined part} \\ |
\text{(that is, np) out of the sigma part } \\ | \text{(that is, np) out of the sigma part } \\ | ||
- | & = & np \sum_{x=1}^{n} \frac{(n-1)!}{(x-1)!(n-x)!} p^{x-1}(1-p)^{n-x} | + | & = & np \sum_{x=1}^{n} \frac{(n-1)!}{(x-1)!(n-x)!} p^{x-1}(1-p)^{n-x} |
- | & = & np \underline{ \sum_{x=1}^{n} {\frac{(n-1)!}{(x-1)!(n-x)!} p^{x-1}(1-p)^{n-x}}} | + | & = & np \underline{ \sum_{x=1}^{n} {\frac{(n-1)!}{(x-1)!(n-x)!} p^{x-1}(1-p)^{n-x}}} |
- | \text{we want to check the underlined} | + | \text{we want to check the underlined} \\ |
- | \text{part is equal to one so that np is left out} \nonumber | + | \text{part is equal to one so that np is left out} \\ |
- | n-x = (n-1)-(x-1) | + | n-x = (n-1)-(x-1) \\ |
- | & = & np \sum_{x=1}^{n} \frac{(n-1)!}{(x-1)!((n-1)-(x-1))!} p^{x-1}(1-p)^{(n-1)-(x-1)} | + | & = & np \sum_{x=1}^{n} \frac{(n-1)!}{(x-1)!((n-1)-(x-1))!} p^{x-1}(1-p)^{(n-1)-(x-1)} |
- | m = n - 1 \nonumber | + | m = n - 1 \\ |
- | y = x - 1 \nonumber | + | y = x - 1 \\ |
- | & = & np \sum_{y=0}^{m} \frac{(m)!}{(y)!(m-y))!} p^{y}(1-p)^{(m-y)} | + | & = & np \sum_{y=0}^{m} \frac{(m)!}{(y)!(m-y))!} p^{y}(1-p)^{(m-y)} |
- | & = & np \sum_{y=0}^{m} \frac{(m)!}{(y)!(m-y))!} p^{y}(1-p)^{(m-y)} | + | & = & np \sum_{y=0}^{m} \frac{(m)!}{(y)!(m-y))!} p^{y}(1-p)^{(m-y)} |
- | & = & np \sum_{y=0}^{m} {{m}\choose {y}} p^{y}(1-p)^{(m-y)} | + | & = & np \sum_{y=0}^{m} {{m}\choose {y}} p^{y}(1-p)^{(m-y)} |
- | \text{Recall that} | + | \text{Recall that} \\ |
- | \sum^{m}_{y=0}{{m}\choose{y}} a^{y} b^{m-y} = (a + b)^{m} | + | \sum^{m}_{y=0}{{m}\choose{y}} a^{y} b^{m-y} = (a + b)^{m} \\ |
- | & = & np\;(p + (1-p))^m | + | & = & np\;(p + (1-p))^m |
- | & = & np\; | + | & = & np\; |
- | & = & np | + | & = & np \\ |
- | \end{eqnarray} | + | \end{eqnarray*} |
====== For variance ====== | ====== For variance ====== | ||
Line 71: | Line 71: | ||
\begin{align*} | \begin{align*} | ||
- | E(X^2) & = \sum_{x=0}^{n} x^2 {{n}\choose{x}} p^x (1-p)^{n-x} \\ | + | E(X^2) & = \sum_{x=0}^{n} x^2 p(x) \\ |
+ | & = \sum_{x=0}^{n} x^2 {{n}\choose{x}} p^x (1-p)^{n-x} \;\;\; \because \; p(x) = {{n}\choose{x}} p^x (1-p)^{n-x} \\ | ||
& = \sum_{x=0}^{n} x^2 \frac{n!}{x!(n-x)!} p^x (1-p)^{n-x} \\ | & = \sum_{x=0}^{n} x^2 \frac{n!}{x!(n-x)!} p^x (1-p)^{n-x} \\ | ||
\end{align*} | \end{align*} | ||
Line 79: | Line 80: | ||
\begin{align*} | \begin{align*} | ||
E[X(X-1)] & = \sum_{x=0}^{n} x(x-1) \frac{n!}{x!(n-x)!} p^x (1-p)^{n-x} \\ | E[X(X-1)] & = \sum_{x=0}^{n} x(x-1) \frac{n!}{x!(n-x)!} p^x (1-p)^{n-x} \\ | ||
- | & = \sum_{x=2}^{n} \frac{n!}{(x-2)!(n-x)!} p^x (1-p)^{n-x} \\ | + | & = \sum_{x=2}^{n} \frac{n!}{(x-2)!(n-x)!} p^x (1-p)^{n-x} |
& = n(n-1)p^2 \sum_{x=2}^{n} \frac{(n-2)!}{(x-2)!(n-x)!} p^{x-2} (1-p)^{n-x} \\ | & = n(n-1)p^2 \sum_{x=2}^{n} \frac{(n-2)!}{(x-2)!(n-x)!} p^{x-2} (1-p)^{n-x} \\ | ||
\text{cause} \\ | \text{cause} \\ | ||
Line 91: | Line 92: | ||
\text {we know that the underline part is} \\ | \text {we know that the underline part is} \\ | ||
+ | (p+(1-p))^m \\ | ||
+ | \text {and, we also know that it is 1} \\ | ||
(p+(1-p))^m = 1^m \\ | (p+(1-p))^m = 1^m \\ | ||
& = n(n-1)p^2 (p + (1-p))^m \\ | & = n(n-1)p^2 (p + (1-p))^m \\ | ||
Line 99: | Line 102: | ||
E[X(X - 1)] & = n(n-1)p^2 \\ | E[X(X - 1)] & = n(n-1)p^2 \\ | ||
E[X^2 - X] & = n(n-1)p^2 \\ | E[X^2 - X] & = n(n-1)p^2 \\ | ||
- | E[X^2]- E[X] & = n(n-1)p^2 \\ | + | E[X^2]- E[X] & = n(n-1)p^2 |
- | E[X^2]- np & = n(n-1)p^2 \\ | + | E[X^2]- np & = n(n-1)p^2 |
E[X^2]& = n(n-1)p^2 + np \\ | E[X^2]& = n(n-1)p^2 + np \\ | ||
\\ | \\ |
mean_and_variance_of_binomial_distribution.1728436602.txt.gz · Last modified: 2024/10/09 10:16 by hkimscil