2023-10-23
Example 1
Let \(g\) be a function and let \(g(x) = ax+b\), for real-valued constants \(a\) and \(b\). What is \(\mathbb{E}[g(X)]\)?
Definition: Expected value of function of RV
For any function \(g\) and discrete r.v. \(X\), the expected value of \(g(X)\) is \[\mathbb{E}[g(X)] = \sum_{\{all\ x\}}\ g(x) p_X(x).\]
Example 2
Suppose you draw 2 cards from a standard deck of cards with replacement. Let \(X\) be the number of hearts you draw.
Recall Binomial RV with \(n=2\):
\[p_X(x) = {2 \choose x}p^x(1-p)^{2-x} \text{ for } x = 0, 1, 2\]
Example 2
Suppose you draw 2 cards from a standard deck of cards with replacement. Let \(X\) be the number of hearts you draw.
Recall Binomial RV with \(n=2\):
\[p_X(x) = {2 \choose x}p^x(1-p)^{2-x} \text{ for } x = 0, 1, 2\]
Definition: Variance of RV
The variance of a r.v. \(X\), with (finite) expected value \(\mu_X=\mathbb{E}[X]\) is \[\sigma_X^2=Var(X)=\mathbb{E}[(X-\mu_X)^2] = \mathbb{E}[(X-\mathbb{E}[X])^2].\]
Definition: Standard deviation of RV
The standard deviation of a r.v. \(X\) is \[\sigma_X = SD(X) = \sqrt{\sigma_X^2}=\sqrt{Var(X)}.\]
Lemma 6: “Computation formula” for Variance
The variance of a r.v. \(X\), can be computed as \[\begin{align} \sigma_X^2 & =Var(X) \\ & = \mathbb{E}[X^2]-\mu_X^2 \\ & = \mathbb{E}[X^2] - (\mathbb{E}[X])^2 \end{align}\]
Lemma 7
For a r.v. \(X\) and constants \(a\) and \(b\), \[Var(aX+b) = a^2Var(X).\]
Proof will be exercise in homework. It’s fun! In a mathy kinda way.
Theorem 8
For independent r.v.’s \(X\) and \(Y\), and functions \(g\) and \(h\), \[\mathbb{E}[g(X)h(Y)] = \mathbb{E}[g(X)]\mathbb{E}[h(Y)].\]
Corollary 1
For independent r.v.’s \(X\) and \(Y\), \[\mathbb{E}[XY] = \mathbb{E}[X]\mathbb{E}[Y].\]
Theorem 9: Variance of sum of independent discrete r.v.’s
For independent discrete r.v.’s \(X_i\) and constants \(a_i\), \(i=1,2,\dots, n\), \[Var\Bigg(\sum_{i=1}^n a_iX_i\Bigg) = \sum_{i=1}^n a_i^2Var(X_i).\]
Corollary 2
For independent discrete r.v.’s \(X_i\), \(i=1,2,\dots, n\), \[Var\Bigg(\sum_{i=1}^n X_i\Bigg) = \sum_{i=1}^n Var(X_i).\]
Corollary 3
For independent identically distributed (i.i.d.) discrete r.v.’s \(X_i\), \(i=1,2,\dots, n\), \[Var\Bigg(\sum_{i=1}^n X_i\Bigg) = n Var(X_1).\]
Example 3.1
The ghost is trick-or-treating at a different house now. In this case it is known that the bag of candy has 10 chocolates, 20 lollipops, and 30 laffy taffies. The ghost grabs a handful of five pieces of candy. What is the variance for the number of chocolates the ghost takes? Let’s solve this for the cases without replacement.
Recall probability without replacement:
\[p_X(x) = \dfrac{{K \choose x}{N-K \choose n-x}}{{N \choose n}} \]
Example 3.2
The ghost is trick-or-treating at a different house now. In this case it is known that the bag of candy has 10 chocolates, 20 lollipops, and 30 laffy taffies. The ghost grabs a handful of five pieces of candy. What is the variance for the number of chocolates the ghost takes? Let’s solve this for the cases with replacement.
Recall probability with replacement:
\[ p_X(x) = {n \choose k}p^k(1-p)^{n-k} \]
Example 4
A tour group is planning a visit to the city of Minneapolis and needs to book 30 hotel rooms. The average price of a room is $200 with standard deviation $10. In addition, there is a 10% tourism tax for each room. What is the standard deviation of the cost for the 30 hotel rooms?
Problem to do at home if we don’t have enough time.
Chapter 12 Slides