Distribution of \(X\) | density function | \(\mathbb{E}[X]\) | \(\mathbb{V}[X]\) | parameter bounds | |
---|---|---|---|---|---|

Bernoulli\((p)\) | \(p^x(1-p)^{1-x}\) | \(p\) | \(p(1 - p)\) | \(0 \leq p \leq 1\) | |

Uniform \((a, b)\) | \(\frac{1}{b-a+1}\) | \(\frac{b + a}{2}\) | \(\frac{(b - a + 1)^2 - 1}{12}\) | \(a < b\) | |

Geometric\((p)\) | \((1-p)^{x - 1}p\) | \(\frac{1}{p}\) | \(\frac{1-p}{p^2}\) | \(0 < p < 1\) |

Generate random variables from the Bernoulli\((p)\) distribution with your choice of \(p\) and sample size \(N\).

Calculate the population variace and standard deviation using the formulas in the table.

Estimate the variance and standard deviation using your randomly sampled data and the functions

`var()`

and`std()`

.

Generate random variables from the Uniform\((a,b)\) distribution with your choice of \(a,b\) and sample size \(N\).

Calculate the population variace and standard deviation using the formulas in the table.

Estimate the variance and standard deviation using your randomly sampled data and the functions

`var()`

and`std()`

.

Think through and then explain why the following statements are true.

For \(X \sim \text{Bernoulli}(p_x)\) and \(Y \sim \text{Bernoulli}(p_y)\), \(\mathbb{V}[Y] < \mathbb{V}[X]\) whenever \(p_x = 0.5\) and \(p_y \ne 0.5\).

For \(X \sim \text{Uniform}(a_x, b_x)\) and \(Y \sim \text{Uniform}(a_y, b_y)\), \(\mathbb{V}[X] < \mathbb{V}[Y]\) whenever \(a_y < a_x\) and \(b_x < b_y\).

Let \(X_1, X_2, \ldots, X_N \sim_{iid} \text{Geometric}(p)\). Calculate the maximum likelihood estimator for \(p\), \(\hat{p}\).

Generate \(N\) random variables from the Geometric\((p)\) distribution with your choice of \(p\) using the function

`rgeom(N, p)`

.Estimate the population mean using the function

`mean()`

.Estimate \(p\) using your randomly generated data and your solution from above.

Using the formula for the expected value, transform your estimate of \(p\) into a best guess of the expected value.

Using the formula for the variance, transform your estimate of \(p\) into a best guess of the population variance.