---
# System prepended metadata

title: Untitled

---

### Nomor 1
Show that the mean and variance of a Bernoulli random variable are $π$ and $π(1 − π)$ respectively. More generally show that the mean and variance of binomial random variable are $nπ$ and $nπ(1 − π)$, respectively.  
**JAWAB :**
Misalkan $X$ adalah peubah acak yang berdistribusi Bernoulli, $X$~ $Bernoulli(\pi)$
$$f_{X}(x) = \pi^x (1-\pi)^{1-x} ; \ \ x=0,1 $$
Nilai Ekspektasi untuk peubah acak $X$, yaitu:
$$E[X] = \sum_{x=0}^{1} X \cdot f(X=x) \\ = 0 + 1 \cdot \pi \cdot (1-\pi)^0 = \pi$$

Nilai Variansi untuk peubah acak $X$, yaitu:
$$Var[X] = E[X^2] - (E[X])^2 \\ = \left( \sum_{x=0}^{1} X^2 \cdot f(X=x) \right) - (\pi)^2 \\ = 0 + 1^2\cdot\pi\cdot(1-\pi)^0  - \pi^2 \\= \pi\cdot(1-\pi)$$

Untuk kasus yang lebih umum, misalkan $Y$ adalah peubah acak yang berdistribusi Binomial, $Y$~$Bin(n,\pi)$
$$ f_Y(y) = \begin{pmatrix} n \\ y \end{pmatrix} \pi^y(1-\pi)^{n-y} \ \ ; \ \ y = 0,1,2,...,n $$

Untuk memudahkan mencari Ekspektasi dan Variansi Distribusi Binomial, akan digunakan pendekatan fungsi pembangkit momen
\begin{align} 
M_Y(t)= E[e^{tY}] &= \sum_{y=0}^{n} e^{tY} \cdot f(Y=y)
\\&= \sum_{y=0}^{n} e^{ty} \cdot \begin{pmatrix} n \\ y \end{pmatrix} \pi^y(1-\pi)^{n-y}
\\&= \sum_{y=0}^{n}  \begin{pmatrix} n \\ y \end{pmatrix} (e^{t}\pi)^y(1-\pi)^{n-y}
\\&= (e^t\pi + (1-\pi))^n \ \ ; \ \ t\in \mathbb{R}
\end{align}

Ekspketasi untuk peubah acak Y adalah
$$E[Y]=M'_Y(0) = \left( n\pi e^t(e^t\pi + (1-\pi))^{n-1}\right)_{t=0} = n\pi $$

Variansi untuk peubah acak Y adalah
\begin{align}
E[Y]&=M''_Y(0) - (E[Y])^2 \\&= \pi n\left(\pi e^{2t}\left(n-1\right)\left(\pi e^t+1-\pi \right)^{n-2}+e^t\left(\pi e^t+1-\pi \right)^{n-1}\right)_{t=0} - (n\pi)^2
\\&= n\pi(n\pi-\pi+1) - n^2\pi^2
\\&= n\pi(1-\pi)
\end{align}

$\therefore$ Mean & Variansi distribusi bernoulli adalah $\pi$ dan $\pi(1-\pi)$ sedangkan Mean & Variansi distribusi binomial adalah $n\pi$ dan $n\pi(1-\pi)$




### Nomor 2
Show that the mean and variance of a $χ^2_{\nu}$ random variable are $ν$ and $2ν$ respectively.  
**JAWAB :**
Misalkan $Y$ adalah peubah acak yang berdistribusi chi-squared dengan derajat kebebasan $\nu$, $Y$ ~ $\chi^2_\nu$.
Fungsi kepadatan peluang $Y$, yaitu:
$$f_Y(y;\nu) = \frac{1}{2^{\nu/2}\Gamma(\nu/2)}y^{\nu/2-1}e^{-y/2} \ \ ; \ \ y \geq 0
$$

Ekspektasi dari peubah acak $Y$, yaitu:
\begin{align}
E[Y] &= \int_0^\infty Y \cdot f_Y(y) dy
\\&= \int_0^\infty y \cdot \frac{1}{2^{\nu/2}\Gamma(\nu/2)}y^{\nu/2-1}e^{-y/2} dy
\\&= \int_0^\infty \frac{1}{2^{\nu/2}\Gamma(\nu/2)}y^{\nu/2}e^{-y/2} dy
\\&= \frac{1}{2^{\nu/2}\Gamma(\nu/2)} \int_0^\infty y^{\nu/2}e^{-y/2} dy 
\\&\quad \text{misalkan} \ t = y/2 , \ dy = 2dt
\\&= \frac{1}{2^{\nu/2}\Gamma(\nu/2)} \int_0^\infty (2t)^{\nu/2}e^{-t} 2dt \\
\\&= \frac{2}{2^{\nu/2}\Gamma(\nu/2)} \int_0^\infty t^{\nu/2}2^{\nu/2}e^{-t}dt
\\&= \frac{2}{\Gamma(\nu/2)} \int_0^\infty t^{\nu/2}e^{-t}dt\\
&\text{karena} \ \int_0^\infty t^{\nu/2}e^{-t}dt = \Gamma(v/2 +1)
\\&= \frac{2}{\left(\frac{\nu}{2}-1\right)!}\left(\frac{\nu}{2}\right)!
\\&= 2\cdot \nu/2 = \nu \\
\therefore \ \ E[Y] = \nu
\end{align}

Variansi dari peubah acak $Y$, yaitu:

\begin{align}
E[Y^2] &= \int_0^\infty Y^2 \cdot f_Y(y) dy
\\&= \int_0^\infty y^2 \cdot \frac{1}{2^{\nu/2}\Gamma(\nu/2)}y^{\nu/2-1}e^{-y/2} dy
\\&= \int_0^\infty \frac{1}{2^{\nu/2}\Gamma(\nu/2)}y^{(\nu/2+2)-1}e^{-y/2} dy
\\&= \frac{4 \ \Gamma(\nu/2 +2)}{\Gamma(\nu/2)} \int_0^\infty \frac{y^{(\nu/2+2)-1}e^{-y/2}}{2^2 2^{\nu/2}\Gamma(\nu/2 +2)} dy
\\&= \frac{4 \ \Gamma(\nu/2 +2)}{\Gamma(\nu/2)} \int_0^\infty \frac{y^{((\nu+4)/2)-1}e^{-y/2}}{2^{(\nu+4)/2}\Gamma((\nu+4)/2)} dy \\ 
& \quad \text{bentuk} \ \int_0^\infty \frac{y^{((\nu+4)/2)-1}e^{-y/2}}{2^{(\nu+4)/2}\Gamma((v+4)/2)} dy \quad adalah\\
&\quad \text{fungsi distribusi kumulatif dari} \ \ \chi^2_{\nu+4}
\\&= \frac{4 \ \Gamma(v/2 +2)}{\Gamma(\nu/2)} \cdot 1
\\&= 4 \frac{(\nu/2 +1)!}{(\nu/2 - 1)!}
\\&= 4\left(\frac{\nu}{2} +1\right) \left(\frac{\nu}{2} \right)
Var[Y]\\
&= E[Y^2] - (E[Y])^2 \\
&= \nu^2 +2\nu-\nu^2 = 2\nu \\
\therefore \ \ Var[Y] = 2\nu
\end{align}




### Nomor 3
The distribution of the number of failures *y* till the first success in independent Bernoulli trials, with probability of success $\pi$ at each trial, is the geometric :
$f(y)=(1-\pi)^y\pi\,\,\,\,\,\,\,\,\,\,\,\,\,\,y=0,1,....$
show that the mean and variance of the geometric distribution are $E(Y)=(1-\pi)/\pi$ and $Var(Y)=(1-\pi)/\pi^2$.  
**JAWAB :**
Akan ditentukan $E(Y)$,
\begin{align}
E(Y)&= \sum \limits_{semua\,y}y.f(y)\\
&=\sum \limits_{y=0}^{\infty}y(1-\pi)^y\pi\\&=\pi\sum \limits_{y=0}^{\infty}y(1-\pi)^y\\&=\pi(1-\pi)\sum \limits_{y=0}^{\infty}y(1-\pi)^{y-1}\\&=\pi(1-\pi)[\frac{d}{d\pi}(-\sum \limits_{y=0}^{\infty}(1-\pi)^{y})]\\&=\pi(1-\pi)\frac {d}{d\pi}(\frac {-1}{\pi})\\&=\pi(1-\pi)(\frac{1}{\pi^2})\\&=\frac {1-\pi}{\pi}
\end{align}
Terbukti bahwa $E(Y)=\dfrac {1-\pi}{\pi}$.
Kemudian akan ditentukan $E(Y^2)$ untuk menurunkan rumusan $Var(Y)$,
\begin{align}
E(Y^2)&= \sum\limits_{semua\,y}y^2.f(y)\\
&=\sum \limits_{y=0}^{\infty}y^2(1-\pi)^y\pi\\
&=\pi(1-\pi)\sum\limits_{y=0}^{\infty}y^2(1-\pi)^{y-1}\\
&=\pi(1-\pi)\sum\limits_{y=0}^{\infty}[y(y-1)+y](1-\pi)^{y-1}\\
&=\pi(1-\pi)[\sum\limits_{y=0}^{\infty}y(y-1)(1-\pi)^{y-1}+\sum\limits_{y=0}^{\infty}y(1-\pi)^{y-1}]\\
&=\pi(1-\pi)[\frac{d^2}{d\pi^2}(\sum\limits_{y=0}^{\infty}(1-\pi)^{y})+\frac{d}{d\pi}(-\sum \limits_{y=0}^{\infty}(1-\pi)^{y})]\\
&=\pi(1-\pi)[\frac{d^2}{d\pi^2}(\frac {1}{\pi})+\frac {d}{d\pi}(\dfrac {-1}{\pi})]\\
&=\pi(1-\pi)[\frac{2}{\pi^3}-\frac {1}{\pi^2}]\\
&=\frac{\pi^2-3\pi+2}{\pi^2}
\end{align}
Ingat bahwa $Var(Y)=E(Y^2)-E(Y)^2$, maka diperoleh $Var(Y)$ sebagai berikut,
\begin{align}
Var(Y)&=\frac{\pi^2-3\pi+2}{\pi^2}-(\dfrac {1-\pi}{\pi})^2\\
&=\frac{\pi^2-3\pi+2}{\pi^2}-(\dfrac {1-2\pi+\pi^2}{\pi^2})\\
&=\dfrac{1-\pi}{\pi^2}
\end{align}
Terbukti bahwa $Var(Y)=\dfrac{1-\pi}{\pi^2}$

### Nomor 4
(a) Show that for the negative binomial $π = \frac{1}{1 + κμ}$ and hence show (2.5).
(b) Show that the mean and variance of the negative binomial are $μ$ and $μ(1 + κμ)$, respectively.  
**JAWAB :**
(a) dengan memanipulasi parameter $μ = \frac{r(1 − π)}{π}$ akan didapatkan persamaan $\pi = \frac{r}{μ + r}$, lalu substitusikan $κ = \frac{1}{π}$ akan didapatkan bahwa $\pi = \frac{1}{\frac{μ}{r}+1} =\frac{1}{1 + κμ}$ akhirnya $\pi$ tersebut dapat disubstitusikan kedalam FMP negatif binomial yang akan membuktikan 2.5.
\begin{align}
f(y) &=\frac{\Gamma(y+r)}{y ! \Gamma(r)} \pi^r(1-\pi)^y \\&=\frac{\Gamma\left(y+\frac{1}{\kappa}\right)}{y ! \Gamma\left(\frac{1}{\kappa}\right)}\left(\frac{1}{1+\kappa \mu}\right)^{\frac{1}{\kappa}}\left(\frac{\kappa \mu}{1+\kappa \mu}\right)^y, \quad y=0,1,2, \ldots
\end{align}

(b) untuk mencari rata-rata dan variansi, akan dicari MGF negatif binomial terlebih dahulu
$$
M_Y(t)= E[e^{tY}]=\sum_{y=0}^{\infty} e^{t y}\left(\begin{array}{c}
y+\frac{1}{κ}-1 \\
\frac{1}{κ}-1
\end{array}\right)\left( \frac{κμ}{1 + κμ}\right)^y \times \left( \frac{1}{1 + κμ}\right)^\frac{1}{κ}
$$
Dengan mengunakan identitas $\left(\begin{array}{c}
-r \\
y
\end{array}\right)=(-1)^y\left(\begin{array}{c}
y+r-1 \\
y
\end{array}\right)$ akan didapatkan.

\begin{align}
M(t) & =\left( \frac{1}{1 + κμ}\right)^\frac{1}{κ} \sum_{y=0}^{\infty}\left(\begin{array}{c}
y+\frac{1}{κ}-1 \\
\frac{1}{κ}-1
\end{array}\right)\left[e^t\left( \frac{κμ}{1 + κμ}\right)\right]^y \\
& =\left( \frac{1}{1 + κμ}\right)^\frac{1}{κ} \sum_{y=0}^{\infty}\left(\begin{array}{c}
-\frac{1}{κ} \\
y
\end{array}\right)(-1)^y\left[e^t\left( \frac{κμ}{1 + κμ}\right)\right]^y \\
& =\left( \frac{1}{1 + κμ}\right)^\frac{1}{κ} \sum_{y=0}^{\infty}\left(\begin{array}{c}
-\frac{1}{κ} \\
y
\end{array}\right)\left[-e^t\left( \frac{κμ}{1 + κμ}\right)\right]^y
\end{align}

Lalu mengunakan Teorema binomial: $(x+1)^r=\sum_{i=0}^{\infty}\left(\begin{array}{c}r \\ i\end{array}\right) x^i$ dengan syarat $|x|<1$, persamaan diatas menjadi
$$
M(t)=\frac{\left( \frac{1}{1 + κμ}\right)^\frac{1}{κ}}{\left[1-\left( \frac{κμ}{1 + κμ}\right) e^t\right]^\frac{1}{κ}}, \quad t<-ln\left( \frac{κμ}{1 + κμ}\right)
$$
lalu dengan menentukan 
$μ=E[X]=M′(0)$
$σ^2=E[X^2]−(E[X])^2=M′′(0)−[M′(0)]^2$
akan didapatkan bahwa
$E[X]= μ$ dan $Var[X] = σ^2 = \mu(\kappa\mu + \mu +1) - \mu^2 = \mu(1+\kappa\mu)$ 