Skip to main content

Extra Practice: Class 3

Probability III

These extra practice problems for Class 3 come from exams and review exercises that I wrote for Econ 103, from the probability collections that I set for my Oxford students in previous years, and from past Oxford demonstration lectures. Econ 103 is the introductory statistics course that I taught at the University of Pennsylvania. They are grouped by topic. Within each topic they run from warm-up questions, through standard and harder problems, to challenge problems that go beyond what the lecture videos cover. Try each problem before clicking to reveal its solution.

Expected value

Problem 1 Warm-up

Let \(X\) be a discrete RV and \(a, b\) be constants. Prove that \(E[a + bX] = a + bE[X]\).

Let \(p(x)\) be the pmf of \(X\). Applying the formula for \(E[g(X)]\) with \(g(x) = a + bx\), \[E[a + bX] = \sum_{\text{all } x} (a + bx)\, p(x) = a \sum_{\text{all } x} p(x) + b \sum_{\text{all } x} x\, p(x) = a + bE[X],\] since a pmf sums to one over the support.

Problem 2 Warm-up

Let \(X\) be a Uniform\((a,b)\) RV. Calculate \(E[X]\)

The pdf of \(X\) is \(f(x) = 1/(b-a)\) for \(x \in [a,b]\), zero otherwise. Hence \[E[X] = \int_{-\infty}^{\infty} x f(x)\, dx = \frac{1}{b-a}\int_a^b x\, dx = \frac{1}{b-a} \left. \frac{x^2}{2}\right|_a^b = \frac{b^2 - a^2}{2(b-a)} = \frac{(b-a)(b+a)}{2(b-a)} = \frac{a+b}{2}.\]

Problem 3 Warm-up

Let \(X\) be a RV with support set \(\left\{ -1,1 \right\}\) and \(p(-1) = 1/2\).

  1. Calculate \(E[X]\).

    \(E[X] = -1 \times 1/2 + 1 \times 1/2 = 0\)

  2. Write out the CDF \(F(x_0)\) of \(X\).

    \[F(x_0) = \left\{ \begin{array}{rr} 0, & x_0 < -1 \\ 1/2, & -1 \leq x_0 < 1 \\ 1, & x_0 \geq 1 \end{array} \right.\]

  3. Calculate \(E[X^2]\).

    \(E[X^2] = (-1)^2 \times 1/2 + 1^2 \times 1/2= 1\).

  4. Calculate \(Var(X)\).

    By the shortcut formula, \(Var(X) = E[X^2] - E[X]^2 = 1 - 0^2 = 1\).

  5. Calculate \(\displaystyle E\left[ \frac{X}{X^2 + 1} \right]\)

    \[E\left[\frac{X}{X^2+1}\right] = \frac{-1}{(-1)^2 + 1} \times \frac{1}{2} + \frac{1}{1^2 + 1} \times \frac{1}{2}= -1/2 \times 1/2 + 1/2 \times 1/2 = 0.\]

Problem 4 Warm-up

Suppose that \(X \sim \text{Binomial}(9, 1/3)\) and \(Y \sim \text{Binomial}(4, 1/2)\). Calculate \(E[(Y - X) / 2]\).

A Binomial\((n,p)\) RV is the sum of \(n\) independent Bernoulli\((p)\) RVs, each with mean \(p\), so by the linearity of expectation its mean is \(np\). Hence \(E[X] = 9 \times 1/3 = 3\) and \(E[Y] = 4 \times 1/2 = 2\). By linearity again, \[E\left[\frac{Y - X}{2}\right] = \frac{E[Y] - E[X]}{2} = \frac{2 - 3}{2} = -\frac{1}{2}.\]

Problem 5 Standard

Suppose \(X \sim \text{Uniform}(0,1)\) and let \(A\) be the area of a circle with radius equal to \(X\). Recall that the area of a circle with radius \(r\) is \(\pi r^2\).

  1. Calculate \(E[X]\).

    \(E[X] = \int_{0}^{1} x \; dx = \left. (x^2/2) \right|_0^1 = 1/2\)

  2. Calculate \(E[A]\).

    \(E[A] = E[\pi X^2] = \pi E[X^2] = \pi\int_{0}^{1} x^2 \; dx = \pi/3\)

  3. Suppose I constructed a circle with radius equal to \(E[X]\). Would its area equal \(E[A]\)? Why or why not? Explain briefly.

    No: in general the expected value of a function is not equal to the function of the expected value. Here, \(E[\pi X^2]\neq \pi E[X]^2\) – the first of these equals \(\pi/3\) while the second equals \(\pi/4\).

  4. Calculate \(Var(A)\). You may leave your answer in terms of \(\pi\).

    \[\begin{aligned} Var(A) &= E[A^2] - E[A]^2 = E\left[ \pi^2 X^4 \right] - \left( \pi/3 \right)^2 \\ &= \pi^2 \int_0^1 x^4 \; dx - \pi^2/9 \\ &= \pi^2 \cdot \left. \frac{x^5}{5} \right|_0^1 - \pi^2/9 = \pi^2\left( 1/5 - 1/9 \right) = 4\pi^2/45 \end{aligned}\]

Problem 6 Standard

From my HT 2022 probability collection.

To answer this question you will need to refer to the following joint pmf:

\(Y = 1\) \(Y = 2\) \(Y = 3\)
\(X = 0\) 0 0.2 0.4
\(X = 1\) 0.1 0.3 0
  1. Are \(X\) and \(Y\) independent? Briefly explain why or why not.

    No: if \(Y=1\) then \(X\) must be 1.

  2. Write out the marginal pmf of \(Y\) and use it to calculate \(E[Y^3]\).

    The support set of \(Y\) is \(\left\{ 1,2,3 \right\}\) and its marginal pmf is \(p_Y(1) = 0.1, p_Y(2) = 0.5, p_Y(3) = 0.4\). We know that \(E[g(X)] = \sum_{\text{all } x} g(x) p(x)\). Hence, \[E[Y^3] = 1^3 \times 0.1 + 2^3 \times 0.5 + 3^3 \times 0.4 = 0.1 + 4 + 10.8 = 14.9\]

  3. Write out the marginal CDF of \(Y\).

    \[F_Y(y) = \left\{ \begin{array}{rr} 0 & y < 1 \\ 0.1 & 1\leq y < 2 \\ 0.6 & 2 \leq y < 3 \\ 1 & y \geq 3 \\ \end{array} \right.\]

  4. Derive the conditional pmf of \(X\) given \(Y=2\).

    \(p_{X|Y}(0|2) = 0.2/0.5 = 0.4\) and \(p_{X|Y}(1|2) = 0.3/0.5 = 0.6\)

  5. Calculate the expected value of the ratio of \(X\) and \(Y\), namely \(E\left[\displaystyle\frac{X}{Y}\right]\).

    We know that \(E[g(X,Y)] = \sum_{\text{all }x,y} g(x,y) p_{XY}(x,y)\), hence \[\begin{aligned} E[X/Y] = 0.1 \times (1/1) + 0.3 \times (1 / 2) = 0.25 \end{aligned}\]

Problem 7 Standard

Let \(X\) be a continuous RV with support set \([0, 1]\) and pdf \(f(x) = a + b x^2\) where \(a,b>0\).

  1. Calculate the CDF of \(X\), \(F(x_0)\), in terms of \(a\) and \(b\).

    \[F(x_0) = \int_{-\infty}^{x_0} f(x) \; dx = \int_0^{x_0} (a + bx^2) \; dx = \left.\left( ax + \frac{bx^3}{3} \right)\right|_0^{x_0} = ax_0 + \frac{b x_0^3}{3}\] for \(x_0 \in [0,1]\). For \(x_0 < 0\) we have \(F(x_0)=0\) and for \(x_0>1\) we have \(F(x_0) = 1\).

  2. Calculate \(E[X]\) in terms of \(a\) and \(b\).

    \[E[X] = \int_{-\infty}^{\infty} x f(x)\; dx = \int_{0}^{1} \left( ax + bx^3 \right)\; dx = \left. \left( \frac{ax^2}{2} + \frac{bx^4}{4}\right)\right|_{0}^{1} = \frac{a}{2} + \frac{b}{4}\]

  3. Since \(a\) and \(b\) are positive, \(f(x)\geq 0\). This is one of the two conditions required to ensure that \(f(x)\) is a valid pdf. What is the other condition? What restriction must we place on \(a\) and \(b\) to ensure that the condition is satisfied?

    To be a valid pdf \(f(x)\) must be non-negative and integrate to one over \((-\infty, +\infty)\). We already know that \(f(x)\geq 0\) so the condition we need is \(\displaystyle \int_{0}^{1} f(x)\; dx = F(1) = a + \frac{b}{3} = 1\) which holds so long as \(b = 3(1 - a)\).

  4. Suppose \(E[X] = 3/5\). Solve for \(a\) and \(b\).

    From part (b), \(a/2 + b/4 = 3/5\) and from part (c), \(b = 3(1 - a)\). These are two linear equations in two unknowns. Solving, \(a = 3/5\) and \(b = 6/5\).

Problem 8 Standard

This question concerns a game played by rolling a fair, six-sided die with sides numbered 1–6. To play the game you roll the die once. Let \(x\) denote the number on the side that shows face-up. If \(x\) is even you win \(x\) dollars but if \(x\) is odd you win \(2x\) dollars.

  1. Suppose you were to play this game an extremely large number of times. On average, how much would you win per play?

    The expected winnings in this game are \[\frac{1}{6}\left[ \left( 2 + 4 + 6 \right) + 2 \times \left( 1 + 3 + 5 \right) \right] = 30/6 = 5\] so you will win, on average, 5 dollars per play in a long sequence of plays.

  2. Your winnings in one play of this game can be viewed as the realization of a discrete random variable \(Z\). Calculate \(Var(Z)\).

    By the Shortcut Formula \(Var(Z) = E[Z^2] - E[Z]^2\). We have \[\begin{aligned} E[Z^2] &= \sum_{\text{all }z} z^2 p(z) = \frac{1}{6}\left[ (2^2 + 4^2 + 6^2) + (2 \times 1)^2 + (2 \times 3)^2 + (2 \times 5)^2 \right]\\ &= \frac{1}{6}\left[ \left( 4 + 16 + 36 \right) + \left( 2^2 + 6^2 + 10^2 \right) \right] = \frac{1}{6} \left[ 56 + \left( 4 + 36 + 100 \right) \right]\\ &= 196/6 \end{aligned}\] Therefore \(Var(Z) = 196/6 - 25 = 23/3 \approx 7.67\)

  3. For the rest of this question we change the rules of the game as follows: after rolling the die and observing \(x\) you are given the option to roll a second time. If you choose not to roll a second time, your winnings are calculated as before: \(x\) dollars if \(x\) is even and \(2x\) dollars if \(x\) is odd. If you do choose to roll again your winnings are calculated in the same way but based on whatever number comes up on your second roll. For example if your initial roll is 3 and you re-roll and get a 1 then you win 2 dollars. If you want to maximize your average winnings over a large number of plays of this modified game, then you should choose to roll a second time if and only if your first roll is a 1, 2, or 4. Briefly explain why.

    Using the same logic as in part (a) your expected payoff from the second roll is 5 dollars. Thus, you should re-roll if \(x\) is such that you would win less than 5 dollars by sticking with your first roll. Accordingly the strategy that maximizes your expected payoff is to stick with your first roll if it is a 3, 5, or 6 and to re-roll if it is a 1, 2, or 4.

Problem 9 Harder

The “Moment Generating Function” of a random variable \(X\) is defined as \(M_X(t) = E[e^{tX}]\) where \(t\) is a constant. Don’t let the constant \(t\) confuse you: this is simply the expected value of a function \(g\) of \(X\), namely \(g(x) = e^{tx}\).

  1. Suppose that \(X\) is a discrete RV. Use the general formula for \(E[g(X)]\) to express \(M_X(t)\) as a sum involving the pmf \(p(x)\) of \(X\).

    \(M_X(t) = \displaystyle \sum_{\text{all } x} e^{tx}p(x)\)

  2. Suppose that \(X\) is a continuous RV. Use the general formula for \(E[g(X)]\) to express \(M_X(t)\) as an integral involving the pdf \(f(x)\) of \(X\).

    \(M_X(t) = \displaystyle \int_{-\infty}^{\infty} e^{tx}f(x)\; dx\)

  3. Use your answer to part (a) to calculate the moment generating function of the Bernoulli\((p)\) random variable.

    \(M_X(t) = pe^{t\times1} + (1-p) e^{t\times 0} = 1 - p + pe^t\)

  4. Use your answer to part (b) to calculate the moment generating function of the Uniform\((0,1)\) random variable.

    \(M_X(t) = \displaystyle \int_0^1 e^{tx} \times 1 \; dx = \frac{1}{t}\left. e^{tx}\right|_0^1 = \frac{1}{t}(e^t - 1)\) for \(t \neq 0\), while \(M_X(0) = 1\)

Problem 10 Harder

You are about to bid on a poster autographed by the cast of The Jersey Shore. This is a one-of-a-kind item, not available in stores. The most you would be willing to pay is $500. In an ordinary auction, you could start with a low bid, say $10, and increase it only if someone outbid you. This auction, however, is a sealed bid auction. Each participant submits a single bid in a sealed envelope, so there is no way for you to know how much anyone else has bid. The highest bidder wins the auction and pays whatever bid she placed in her envelope; the losers pay nothing. Based on research you have carried out on other auctions of Jersey Shore memorabilia, you estimate that the probability \(p\) that you will win the auction as a function of your bid \(b\) is as follows: \[p(b) = \left\{ \begin{array}{ll} b/600 & b \leq 600\\ 1 & b > 600 \end{array}\right.\]

  1. Suppose you want to maximize your expected payoff. Losing the auction gives you a payoff of $0; winning gives you a payoff of $500 minus your bid, i.e. your consumer surplus. How much should you bid, and what is the probability that you will win the auction? Be sure to check the second order condition.

    If you win, your payoff is \(500 - b\). This occurs with probability \(p = b/600\). If you lose, you get zero. Hence, your expected payoff is \[(500 - b) \cdot p + 0 \cdot (1 - p) = (500 - b) \cdot \frac{b}{600} = \frac{5b}{6} - \frac{b^2}{600}\] We want to maximize this over \(b\). The first order condition is \[\begin{aligned} \frac{5}{6} - \frac{b}{300} &=0\\ b^* &= 250 \end{aligned}\] Since the second derivative is \(-1/300\), we know this is a maximum. With a bid of $250, the probability of winning the auction is \(250/600 \approx 0.42\).

  2. Using what you know about expected value, briefly explain why someone might rationally decide not to follow the bidding strategy you derived in part (a).

    If this is really a one-of-a-kind item, it may make sense to bid more than $250. For example, to maximize your chance of winning the auction, you should bid $500. The expected value bidding rule imagines a large number of identical repeat auctions and maximizes your average payoff over these auctions. If you were repeatedly bidding on a commodity (say used cars at a police auction), the expected value rule makes sense. In this case it might not.

Problem 11 Harder

An ancient artifact worth $100,000 fell out of Indiana Jones’s airplane and landed in the Florida Everglades. Unless he finds it within a day, it will sink to the bottom and be lost forever. Dr. Jones can hire one or more helicopters to search the Everglades. Each helicopter charges $1,000 per day and has a probability of 0.9 of finding the artifact, independently of the others. If Dr. Jones wants to maximize his expected value, how many helicopters should he hire?

Let \(p(n)\) be the probability of finding the artifact if Indiana Jones hires \(n\) helicopters. By the complement rule, \(p(n) = 1 - 1/10^n\) since the probability of not finding the artifact when \(n\) helicopters search for it is \((1 - 0.9)^n = 1/10^n\). Now let \(E(n)\) denote Indiana Jones’s expected value if he hires \(n\) helicopters. If he does not find the artifact, Jones loses \(n \times\)$1,000. If he does find the artifact, Jones gains $100,000\(- n\times\)$1,000. Therefore, \[\begin{aligned} E(n) &= \left[ 1 - p(n) \right] \times \left( -1000 \times n \right) + p(n) \times \left[ 100000 - 1000 \times n \right]\\ &= 100000 \times p(n) - 1000 \times n\\ &= 1000 \times \left[ 100 \times p(n) - n \right] \end{aligned}\] The question of whether Jones should hire an additional – i.e. marginal – helicopter comes down to whether the marginal expected benefit, \(100000 \times \left[p(n+1) - p(n)\right]\), exceeds the marginal expected cost, \(1000\). From the factorization above, we see that this will be the case whenever \(100 \times \left[p(n+1) - p(n)\right]\) is larger than one. Notice that, because you cannot hire a fraction of a helicopter, it may not be possible to exactly equate marginal expected cost and benefit as we would do in a continuous optimization problem. Instead we’ll make a table of values. It’s easy enough to do this by hand:

\(n\) \(p(n)\) \(E(n)\)
1 0.9 89000
2 0.99 97000
3 0.999 96900
4 0.9999 95990

From the table it appears that the optimal number of helicopters is \(2\). But how can we be sure when we have only examined four possible values for \(n\)? Notice that the marginal expected cost is a constant $1000 regardless of \(n\). In contrast, the marginal expected benefit is \[\begin{aligned} p(n+1) - p(n) &= \left( 1 - \frac{1}{10^{n+1}} \right) - \left( 1 - \frac{1}{10^{n}} \right) \\ &= \frac{1}{10^{n}} - \frac{1}{10^{n+1}}\\ &= \frac{1}{10^{n}}\left(1 - \frac{1}{10} \right) \\ &= \frac{1}{10^n} \times 0.9 \end{aligned}\] This is decreasing with \(n\), so we know that it is unnecessary to examine larger values of \(n\). An alternative way to solve this problem is to “pretend” that \(n\) is continuous, derive the first and second order conditions to characterize the unique global optimum, and then look at the whole number values of \(n\) on each side of the (infeasible) optimum from the continuous problem.

Problem 12 Challenge

I have an urn that contains two red balls and three blue balls. I offer you the chance to play the following game. You draw one ball at a time from the urn. Draws are made at random and without replacement. You win $1 for each red ball that you draw, but lose $1 for each blue ball that you draw. You are allowed to stop the game at any point. Find a strategy that ensures your expected value from playing this game is positive.

Write R for a red ball and B for a blue ball. There are \({5 \choose 2} = 10\) possible orderings of the two red and three blue balls, each of which has probability \(1/10\) of occurring. The following table enumerates all of them:

RBBBR BRBRB
RBBRB BBRRB
RBRBB BBBRR
RRBBB BBRBR
BRRBB BRBBR

I have found two strategies that yield a positive expected value. (There may be more.) The first is to keep playing if and only if your cumulative winnings are negative. For example, if your first draw is R, your cumulative winnings are \(+1\) so you should stop. On the other hand, if your first draw is B then your cumulative winnings are \(-1\) so you should keep playing. If your first draw is a B and your second draw is an R, then your cumulative winnings are zero, so you should stop playing. The following table uses parentheses to show how this rule applies to each possible sequence of draws. You should stop playing as soon as you hit the first parenthesis. The value to the right of the arrow denotes your winnings for a given sequence when following the strategy.

R(BBBR) \(\rightarrow +1\) BR(BRB) \(\rightarrow 0\)
R(BBRB) \(\rightarrow +1\) BBRR(B) \(\rightarrow 0\)
R(BRBB) \(\rightarrow +1\) BBBRR() \(\rightarrow -1\)
R(RBBB) \(\rightarrow +1\) BBRBR() \(\rightarrow -1\)
BR(RBB) \(\rightarrow 0\) BR(BBR) \(\rightarrow 0\)

The expected value of this strategy is \((1 + 1 + 1 + 1 - 1 - 1)/10 = 1/5\) since each sequence has a probability of \(1/10\).

A slightly different strategy that also gives a positive expected value is as follows:

If your first draw is R, stop; if your first draw is B, keep drawing until both red balls are removed.

Following the same notational convention as above, we can summarize the results of this strategy as follows:

R(BBBR) \(\rightarrow +1\) BRBR(B) \(\rightarrow 0\)
R(BBRB) \(\rightarrow +1\) BBRR(B) \(\rightarrow 0\)
R(BRBB) \(\rightarrow +1\) BBBRR() \(\rightarrow -1\)
R(RBBB) \(\rightarrow +1\) BBRBR() \(\rightarrow -1\)
BRR(BB) \(\rightarrow +1\) BRBBR() \(\rightarrow -1\)

so the expected value is \((1 + 1 + 1 + 1 + 1 - 1 - 1 - 1)/10 = 1/5\). Although these two strategies have the same expected value, they are different. Let \(p\) denote the pmf of your winnings under the first strategy and \(q\) denote the pmf of your winnings under the second. Then we see that: \[p(-1) = 2/10, \quad p(0) = 4/10, \quad p(1) = 4/10\] while \[q(-1) = 3/10, \quad q(0) = 2/10, \quad q(1) = 5/10\] Hence, you have a larger chance of winning a positive amount using the second strategy, but also a larger chance of losing a positive amount. A helpful review problem would be to calculate the variance of your winnings under each strategy.

Problem 13 Challenge

From my HT 2024 probability collection.

Sam and Caroline have $100 and need to make big returns fast. Elon offers them the chance to play the following game. First Sam and Caroline must choose the fraction \(\varphi\) of the $100 that they want to bet. This can be any real number between \(0\) and \(1\) inclusive, so they can bet nothing, everything, or anything in between. Then Elon makes a random draw \(X_1\) with probability density function \(f(x) = 2x\) for \(x \in [0,1]\), zero otherwise. If \(X_1 > 1/2\), Sam and Caroline win: they keep their initial $100 and Elon gives them an additional \(\varphi \times \$100\). If \(X_1 \leq 1/2\), Sam and Caroline lose: they have to pay \(\varphi\times \$100\) to Elon. The game then proceeds to round two: Elon makes a second random draw \(X_2\) that is independent of \(X_1\) but has the same pdf. The rules in round two are the same as before, except that Sam and Caroline now bet a fraction \(\varphi\) of however much money they have after round one. Depending on whether they win or lose in the first round, this could be more or less than $100. The game ends after round two. Note that the same value of \(\varphi\) is used in each round.

  1. Calculate \(p \equiv \mathbb{P}(X_1 > 1/2) = \mathbb{P}(X_2 > 1/2)\).

    \[p \equiv \mathbb{P}(X_1 > 1/2) = \int_{1/2}^{\infty} f(x)\, dx = \int_{1/2}^1 2x\, dx = \left. x^2 \right|_{1/2}^1 = 1 - (1/2)^2 = 3/4.\]

  2. Let \(R_1\) be a random variable that takes the value \(1\) if \(X_1 >1/2\) and \(0\) otherwise. Define \(R_2\) analogously for \(X_2\). Write down the probability mass function of the random variable \(S \equiv R_1 + R_2\).

    Since \(R_1\) and \(R_2\) are binary, the support set of their sum, \(S\), is \(\{0, 1, 2\}\). The only way for \(S\) to equal \(0\) is if \(R_1 = R_2 = 0\). This occurs with probability \((1 - p)^2 = 1/16\) by independence. Similarly, the only way for \(S\) to equal \(2\) is if \(R_1 = R_2 = 1\). This occurs with probability \(p^2 = 9/16\) by independence. The only other possible realization of \(S\) is \(1\). By the complement rule, this realization occurs with probability \(1 - 1/16 - 9/16 = 6/16\). Therefore: \[p_S(0) = 1/16, \quad p_S(1) = 3/8, \quad p_S(2) = 9/16.\]

  3. Sam wants to choose \(\varphi = 1\) and risk everything in both rounds of the game. In expectation, how much money will Sam and Caroline have at the end of the game if they follow this plan?

    We can use the probabilities from the previous part to calculate the expectation. When \(\varphi=1\), Sam and Caroline end up with $0 unless \(S = 2\), in which case they end up with $400. (If they win twice, they double their money twice.) Since \(p_S(2) = 9/16\), the expectation is \[\$0 \times 7/16 + \$400 \times 9/16 = \$225\]

  4. Caroline thinks Sam is crazy: setting \(\varphi = 1\) means there’s a good chance they’ll go bust, ending up with $0 at the end of the game. Caroline proposes setting \(\varphi = 1/2\) instead. If they follow Caroline’s strategy, how much money will they have in expectation at the end of the game? What is the chance of going bust under Caroline’s strategy?

    To keep things organized, it’s helpful to make a table showing how much money Sam and Caroline will have at the end of the game depending on the realizations of \(R_1\) and \(R_2\). We’ve already calculated two of the required probabilities above. The only ones we didn’t calculate are \(\mathbb{P}(R_1 = 0, R_2 = 1)\) and \(\mathbb{P}(R_1 = 1, R_2 = 0)\). Since \(R_1\) and \(R_2\) are iid, both of these are simply \(3/4 \times 1/4 = 3/16\).

    \(R_1\) \(R_2\) \(\mathbb{P}(\cdot)\) $ At End of Game
    0 0 1/16 \(1/2 \times 1/2 \times \$100 = \$25\)
    0 1 3/16 \(1/2 \times 3/2 \times \$100 =\$75\)
    1 0 3/16 \(3/2 \times 1/2 \times \$100 =\$75\)
    1 1 9/16 \(3/2 \times 3/2 \times \$100 = \$225\)

    Notice that we didn’t actually need the probabilities in the second and third row separately: each of them has the same payoff so we could just as well have written the table in terms of the values of \(S\) as follows:

    \(S\) \(\mathbb{P}(\cdot)\) $ At End of Game
    0 1/16 \(1/2 \times 1/2 \times \$100 = \$25\)
    1 6/16 \(1/2 \times 3/2 \times \$100 =\$75\)
    2 9/16 \(3/2 \times 3/2 \times \$100 = \$225\)

    Caroline’s strategy ensures that you will never go bust. If you follow it, in expectation you will end up with \[\$25 \times 1/16 + \$75 \times 6/16 + \$225 \times 9/16 = \$2500/16 = \$156.25.\]

  5. Let \(W(\varphi)\) be the amount of money that Sam and Caroline have at the end of the game as a function of the fraction \(\varphi\) that they choose to bet. It turns out that \(W(\varphi) = \$100 \times (1 + \varphi)^S (1 - \varphi)^{2 - S}\). Briefly explain why this is so, and then use this expression to show that \(\varphi = 1/2\) maximizes \(\mathbb{E}[\log W(\varphi)]\), where \(\log\) denotes the natural logarithm. You don’t have to check the second-order condition.

    The random variable \(S\) counts up how many times Sam and Caroline win while \(2 - S\) counts up how many times they lose. Each time they win, their initial $100 is multiplied by \((1 + \varphi)\); each time they lose it is multiplied by \((1 - \varphi)\). This is exactly what the formula does. Now we’ll solve the optimization problem. Taking logs, \[\begin{aligned} \mathbb{E}[\log W(\varphi)] &= \mathbb{E}\left[ \log \left\{ \$100 \times (1 + \varphi)^S (1 - \varphi)^{2-S} \right\} \right]\\ &= \mathbb{E}\left[ \log(\$100) + S \log(1 + \varphi) + (2-S) \log(1 - \varphi) \right]\\ &= \log(\$100) + \mathbb{E}[S] \log(1 + \varphi) + \mathbb{E}[2-S] \log(1 - \varphi) \end{aligned}\] by the linearity of expectation, since \(\varphi\), \(2\) and \(\$100\) are constants. Differentiating with respect to \(\varphi\) gives the following first order condition: \[\frac{\mathbb{E}[S]}{1 + \varphi} - \frac{\mathbb{E}[2-S]}{1 - \varphi} = 0\] Re-arranging, \[\mathbb{E}[S](1 -\varphi) = \mathbb{E}[2-S](1 + \varphi)\] Using the calculations from part (b), \[\mathbb{E}[S] = 0 \times 1/16 + 1 \times 6/16 + 2 \times 9/16 = 24/16 = 3/2.\] (Alternatively, \(S\) is a Binomial\((2,3/4)\) RV so its expectation is \(2 \times 3/4 = 3/2\).) Hence, by the linearity of expectation \(\mathbb{E}[2-S] = 1/2\). Substituting these values into the first order condition gives \(3/2 \times (1 - \varphi) = 1/2 \times (1 + \varphi)\). Re-arranging, we see that the optimal value of \(\varphi\) is indeed \(1/2\).

Variance

Problem 14 Warm-up

Prove the shortcut formula for variance: \(Var(X) = E[X^2] - \left( E[X] \right)^2\).

Write \(\mu = E[X]\), a constant. By the definition of variance and the linearity of expectation, \[Var(X) = E[(X - \mu)^2] = E[X^2 - 2\mu X + \mu^2] = E[X^2] - 2\mu E[X] + \mu^2 = E[X^2] - 2\mu^2 + \mu^2 = E[X^2] - \left( E[X] \right)^2.\]

Problem 15 Warm-up

Suppose that \(X\) is a continuous random variable with probability density function \[f(x) = \left\{ \begin{array}{ll} 3x^2 & \text{for } 0 \leq x \leq 1\\ 0 & \text{elsewhere} \end{array}\right.\]

  1. What is the support of \(X\)?

    The support is the interval from zero to one \([0,1]\) since the pdf is zero everywhere else.

  2. Given your answer to (a), why couldn’t the pdf be \(4x^2\) in this example?

    A pdf has to integrate to one. We have: \(\int_{-\infty}^\infty f(x)\; dx = \int_0^1 4x^2\; dx = \left. 4(x^3/3)\right|_0^1 = 4/3\) which is greater than one.

  3. Calculate the cumulative distribution function of \(X\).

    \(\int_{-\infty}^{x_0} f(x)\; dx = \int_0^{x_0} 3x^2\; dx = \left. x^3 \right|_{0}^{x_0} = x_0^3\). Hence, \[F(x_0) = \left\{ \begin{array}{ll} 0 & \text{for } x_0 < 0\\ x_0^3& \text{for } 0\leq x_0 \leq 1 \\ 1 & \text{for } x_0 > 1\end{array} \right.\]

  4. Calculate \(E[X]\).

    \[\begin{aligned} E[X]&= \int_{-\infty}^\infty xf(x)\; dx = \int_0^1 3x^3 \; dx = \left.\frac{3x^4}{4}\right|_0^1 =3/4 \end{aligned}\]

  5. Calculate \(E[X^2]\).

    \[\begin{aligned} E[X^2] &= \int_{-\infty}^\infty x^2f(x)\; dx = \int_0^1 3x^4 \; dx = \left.\frac{3x^5}{5}\right|_0^1 =3/5 \end{aligned}\]

  6. Calculate \(Var(X)\).

    \[Var(X) = E[X^2] - \left(E[X]\right)^2 = 3/5 - 9/16 = 3/80\]

Problem 16 Standard

Let \(X\) be a random variable that equals the total number of heads that you get over four tosses of a fair coin and define \(Y = 10X + 25\).

  1. Write out the support set and probability mass function of \(X\).

    The support set is \(\left\{ 0,1,2,3,4 \right\}\). For the pmf, a correct answer either gives \(p(x) = {4\choose x} (1/2)^x (1 - 1/2)^{4-x} = {4 \choose x}1/2^4\) or specifies the probabilities individually: \(p(0) = 1/16\), \(p(1) = 1/4\), \(p(2) = 3/8\), \(p(3) = 1/4\), \(p(4) = 1/16\).

  2. Write out the cumulative distribution function of \(X\).

    \[F(x_0) = \left\{ \begin{array}{ll} 0, & x_0 < 0 \\ 1/16, & 0 \leq x_0 < 1 \\ 5/16, & 1 \leq x_0 < 2 \\ 11/16, & 2 \leq x_0 < 3 \\ 15/16, & 3 \leq x_0 < 4 \\ 1, & x_0 \geq 4 \end{array} \right.\]

  3. Calculate \(E[X]\).

    \[\begin{aligned} E[X] &= 0 \times p(0) + 1 \times p(1) + 2 \times p(2) + 3 \times p(3) + 4 \times p(4) \\ &= 1/4 + 2 \times 3/8 + 3 \times 1/4 + 4 \times 1/16 = 2 \end{aligned}\]

  4. Calculate \(E[X^2]\).

    \[\begin{aligned} E[X^2] &= 0^2 \times p(0) + 1^2 \times p(1) + 2^2 \times p(2) + 3^2 \times p(3) + 4^2 \times p(4)\\ &= 1/4 + 4 \times 3/8 + 9 \times 1/4 + 16 \times 1/16 = 5 \end{aligned}\]

  5. Calculate \(Var(X)\).

    By the shortcut formula \(Var(X) = E[X^2] - E[X]^2 = 5 - 2^2 = 1\)

  6. Calculate \(E[Y]\).

    Since \(E[aX + b] = a E[X] + b\), \(E[Y] = 10 \times E[X] + 25 = 45\).

  7. Calculate \(Var(Y)\).

    Since \(Var(aX + b) = a^2 Var(X)\), \(Var(Y) = 100 \times Var(X) = 100\).

Problem 17 Standard

From my HT 2022 probability collection.

Let \(X\) be a variable with support \([-1,1]\) and PDF \(f(x) = \displaystyle\frac{3}{4}(1 - x^2)\).

  1. Show that \(E[X] = 0\).

    \[\begin{aligned} E[X] &= \int_{-\infty}^{\infty} x f(x) \, dx = \frac{3}{4}\int_{-1}^{1}(x - x^3)\, dx = \left. \frac{3}{4}\left( \frac{x^2}{2} - \frac{x^4}{4} \right)\right|_{-1}^1\\ &= \frac{3}{4}\left[ \left(\frac{1}{2} - \frac{1}{4} \right) - \left( \frac{1}{2} - \frac{1}{4} \right)\right] = 0 \end{aligned}\]

  2. Calculate \(\text{Var}(X)\).

    Since \(E[X]=0\), by the shortcut formula \(\text{Var}(X) = E[X^2]\): \[\begin{aligned} E[X^2] &= \int_{-\infty}^{\infty} x^2 f(x)\, dx = \frac{3}{4}\int_{-1}^{1} (x^2 - x^4)\, dx = \left. \frac{3}{4}\left( \frac{x^3}{3} - \frac{x^5}{5} \right)\right|_{-1}^{1}\\ &= \frac{3}{4}\left[ \left( \frac{1}{3} - \frac{1}{5} \right) - \left( -\frac{1}{3} + \frac{1}{5} \right) \right] = \frac{3}{4}\left[ \frac{2}{3} - \frac{2}{5} \right] = \frac{3}{4} \times \frac{4}{15} = 1/5 \end{aligned}\]

  3. Calculate the CDF of \(X\).

    \[\begin{aligned} F(x) &= \int_{-\infty}^{x} f(t)\, dt = \frac{3}{4}\int_{-1}^{x} (1 - t^2)\, dt = \left. \frac{3}{4}\left( t - \frac{t^3}{3} \right)\right|_{-1}^{x}\\ &= \frac{3}{4}\left[\left( x - \frac{x^3}{3} \right) - \left( -1 + \frac{1}{3} \right)\right] = \frac{3}{4}\left(\frac{2}{3} + x - \frac{x^3}{3}\right)\\ &= \frac{1}{4}(2 + 3x - x^3) \end{aligned}\] The preceding expression is valid for \(x \in [-1,1]\). For \(x > 1\), \(F(x) = 1\). For \(x <-1\), \(F(x) = 0\).

Problem 18 Standard

From my HT 2023 probability collection.

Let \(Y\) be a continuous random variable with support \([0,1]\) and pdf \(f(y) = C y^{3}(1-y)\).

  1. Calculate the value of the constant \(C\) in the pdf of \(Y\).

    Since pdfs must integrate to one over their support, \[\begin{aligned} 1 &= \int_{-\infty}^{\infty} f(y) \; dy = C \int_0^1 (y^3 - y^4)\; dy =C\left. \left(\frac{y^4}{4}-\frac{y^5}{5}\right) \right|_0^1 \\ &= C\left( \frac{1}{4}-\frac{1}{5}\right)=C \left(\frac{5 - 4}{20}\right) = \frac{C}{20} \end{aligned}\] Hence, \(C = 20\).

  2. Calculate the CDF of \(Y\).

    Using our calculations from the previous part, we need only change the upper limit of integration and substitute 20 for \(C\) to show that \[\begin{aligned} F(y_0) = \int_{-\infty}^{y_0} f(y)\; dy = 20 \left. \left(\frac{y^4}{4}-\frac{y^5}{5}\right) \right|_{0}^{y_0} = 5y_0^4-4y_0^5 \end{aligned}\] for \(y_0 \in \left[0,1\right]\). Thus, the full expression for the CDF of \(Y\) is \[F(y_0) = \left\{ \begin{array}{lr} 0, & y_0 < 0\\ 5y_0^4-4y_0^5, & 0\leq y_0 < 1\\ 1, & y_0 \geq 1 \end{array}\right.\]

  3. Calculate the expected value of \(Y\).

    \[\begin{aligned} E[Y] &= 20\int_0^1 y(y^3 - y^4)\;dy = 20\int_0^1 (y^4 - y^5)\;dy =20 \left. \left(\frac{y^5}{5}-\frac{y^6}{6} \right)\right|_0^1\\ &= 20 \left( \frac{1}{5}-\frac{1}{6}\right) = 20 \left( \frac{6-5}{30}\right) = \frac{2}{3} \end{aligned}\]

  4. Calculate the variance of \(Y\).

    By the shortcut formula, we only need to calculate \(E[Y^2]\) since we know \(E[Y]^2 = 4/9\) from the preceding part. We have, \[\begin{aligned} E[Y^2] &= 20\int_0^1 (y^5 - y^6)\; dy = 20 \left. \left(\frac{y^6}{6}-\frac{y^7}{7} \right)\right|_0^1 = 20 \left(\frac{1}{6}-\frac{1}{7} \right) = 10/21 \end{aligned}\] Hence \(Var(Y) = 10/21 - 4/9 = (30 - 28)/63 = 2/63\).

Problem 19 Standard

Let \(X, Y, Z\) be iid discrete RVs with support set \(\left\{-1,1 \right\}\) and probability mass function \(p(-1) = 1-p\), \(p(1) = p\). Define \(S = X + Y + Z\).

  1. Calculate \(E[X]\).

    \(E[X] = -1 \times (1 - p) + 1 \times p = 2p-1\)

  2. Calculate the variance of \(Z\). How does it compare to that of a Bernoulli\((p)\) RV?

    We have \(E[Z^2] = (-1)^2 \times (1 - p) + 1^2 \times p = 1\), and from the preceding part it follows that \(E[Z] = 2p-1\) since \(X\) and \(Z\) are identically distributed. Hence, by the shortcut rule for variance: \[Var(Z) = E[Z^2] - (E[Z])^2 = 1 - (2p - 1)^2 = 4p(1-p).\] We know that the variance of a Bernoulli\((p)\) RV is \(p(1-p)\). Hence, whenever \(0 < p < 1\), the variance of \(Z\) is larger than that of the corresponding Bernoulli.

  3. Calculate \(Var(S)\).

    Since \((X,Y,Z)\) are iid, \[Var(S) = Var(X) + Var(Y) + Var(Z) = 3 \times 4p(1 - p) = 12p(1-p)\]

  4. Calculate \(P(S = 1)\).

    This calculation is effectively identical to the reasoning we used to work out the pmf of a Binomial RV. The only way to obtain \(S=1\) is if exactly one of the RVs \((X,Y,Z)\) takes on the value \(-1\) while the rest take on the value \(1\). There are three mutually exclusive ways that this can occur:

    1. \(X=-1\), \(Y = Z = 1\)

    2. \(Y = -1\), \(X = Z = 1\)

    3. \(Z = -1\), \(X = Y = 1\)

    Since \((X,Y,Z)\) are independent, \(P(X =-1 \cap Y =1 \cap Z = 1) = (1-p)p^2\). But by the same reasoning, \(P(X =1 \cap Y =-1 \cap Z = 1) = (1-p)p^2\) and \(P(X =1 \cap Y =1 \cap Z = -1) = (1-p)p^2\). Hence, \(P(S=1) = 3(1-p)p^2\).

Problem 20 Standard

This question concerns the Beta\((a,b)\) random variable, a continuous random variable that the lectures do not cover. The Beta random variable has support \([0,1]\) and is defined by two parameters \(a\) and \(b\), both of which are greater than zero. Its pdf is given by the following expression: \[f(x) = \frac{x^{a-1} (1-x)^{b-1}}{B(a,b)}\] where \(B(a,b)\) is the so-called “Beta Function” evaluated at \((a,b)\).

  1. The Beta\((2,2)\) random variable has pdf \(f(x) = 6x(1-x)\). Calculate its variance using the shortcut rule.

    Using the shortcut rule: \[\begin{aligned} E[X] &= 6\int_0^1 (x^2 - x^3) \; dx = 6\left. \left(\frac{x^3}{3} - \frac{x^4}{4} \right)\right|_0^1 = 6(1/3 - 1/4) = 1/2\\ \\ E[X^2] &=6\int_0^1 (x^3 - x^4) \; dx = 6\left. \left(\frac{x^4}{4} - \frac{x^5}{5} \right)\right|_0^1 = 6(1/4 - 1/5) = 3/10\\ \\ Var(X) &= E[X^2] - (E[X])^2 = 3/10 - 1/4 = 1/20 \end{aligned}\]

  2. In order for \(f(x)\) to be a valid pdf, what must the formula for the Beta Function, \(B(a,b)\), be? You do not need to evaluate or simplify any integrals in your answer: simply give an expression for \(B(a,b)\).

    The integral of pdf must equal one over the support. Thus: \[\int_0^1 \frac{x^{a-1} (1-x)^{b-1}}{B(a,b)} \; dx =1\] Multiplying through by \(B(a,b)\), which does not involve \(x\), \[B(a,b) =\int_0^1 x^{a-1} (1-x)^{b-1}\;dx\]

  3. What is the pdf of the Beta\((1,1)\) random variable?

    Substituting \(a=b=1\), \[f(x) = \frac{x^0 (1-x)^0}{B(1,1)} = \frac{1}{B(1,1)}\] This expression is simply a constant: it does not depend on \(x\). Thus, the only way for it to integrate to one over \([0,1]\) is for \(B(1,1)\) to equal one. Alternatively, we could evaluate the integral from part (b): \[B(1,1) =\int_0^1 1 \;dx =1\] We see that the Beta\((1,1)\) random variable is the same thing as the Uniform\((0,1)\) random variable!

Problem 21 Harder

Let \(X\) be a continuous RV with support set \([0,1]\) and pdf \(f(x) = \alpha x^{\alpha-1}\) where \(\alpha > 0\).

  1. Calculate the CDF of \(X\).

    \[\begin{aligned} F(x_0) &= \int_{-\infty}^{x_0} f(x)\, dx = \alpha \int_{0}^{x_0} x^{\alpha-1}\, dx = \left. \frac{\alpha x^{\alpha}}{\alpha}\right|_{0}^{x_0} = x_0^\alpha \end{aligned}\] So the CDF is \(0\) for \(x_0 < 0\), \(x_0^\alpha\) for \(x_0\in [0,1]\) and \(1\) for \(x_0 > 1\).

  2. Calculate \(E[X]\).

    \[\begin{aligned} E[X] &= \int_{-\infty}^{\infty} x f(x)\, dx = \alpha\int_0^1 x^\alpha\, dx = \left.\displaystyle\frac{\alpha x^{\alpha+1}}{\alpha + 1} \right|_{0}^1 = \frac{\alpha}{\alpha + 1} \end{aligned}\]

  3. Calculate \(\text{Var}(X)\). You do not have to simplify your answer.

    \[\begin{aligned} E[X^2] &= \int_{-\infty}^{\infty} x^2 f(x)\, dx = \alpha\int_0^1 x^{\alpha+1}\, dx = \left. \frac{\alpha x^{\alpha + 2}}{\alpha + 2}\right|_0^1 = \frac{\alpha}{\alpha + 2} \end{aligned}\] and by the shortcut rule, \[\begin{aligned} \text{Var}(X) &= E[X^2] - \left(E[X]\right)^2 = \frac{\alpha}{\alpha + 2} - \left(\frac{\alpha}{\alpha + 1}\right)^2\\ &= \frac{\alpha(\alpha + 1)^2 - \alpha^2 (\alpha + 2)}{(\alpha + 2)(\alpha + 1)^2} = \frac{\alpha}{(\alpha + 2) (\alpha + 1)^2} \end{aligned}\]

Covariance, correlation, and independence

Problem 22 Warm-up

Mark each statement as True or False. If you mark a statement as False, provide a brief explanation. If you mark a statement as True, no explanation is needed.

  1. If \(Cov(X,Y) = 0\) then \(E[XY] = E[X]E[Y]\)

    TRUE

  2. If \(X\) and \(Y\) are uncorrelated then \(Var(X-Y) = Var(X) - Var(Y)\)

    FALSE: the variance of the difference equals \(Var(X) + Var(Y)\) since the minus one is squared when brought in front of the variance operator.

  3. The pdf \(f(x)\) of a continuous random variable \(X\) gives \(P(X=x)\).

    FALSE: the probability that a continuous random variable takes on any particular value is zero. Only regions with positive area have positive probability.

  4. For any random variable \(X\) and any function \(g\), \(E[g(X)]=g\left( E[X] \right)\).

    FALSE: this does not hold in general although it is true for linear functions.

Problem 23 Warm-up

Prove that \(Cov(X, Y + Z) = Cov(X,Y) + Cov(X,Z)\) where \(X, Y,\) and \(Z\) are three RVs.

By the linearity of expectation and the shortcut formula: \[\begin{aligned} Cov(X, Y + Z) &= E[X(Y + Z)] - E(X) E(Y + Z)\\ &= [E(XY) + E(XZ)] - [E(X)E(Y) + E(X)E(Z)]\\ &= [E(XY) - E(X)E(Y)] + [E(XZ) - E(X)E(Z)]\\ &= Cov(X,Y) + Cov(X,Z) \end{aligned}\]

Problem 24 Standard

Let \(X\) and \(Y\) be discrete random variables. Prove that if \(X\) and \(Y\) are independent, then \(Cov(X,Y) = 0\). Hint: write out the definition of covariance for two discrete RVs in terms of a double sum, and use independence to substitute \(p_{XY}(x,y) = p_X(x)p_Y(y)\).

\[\begin{aligned} Cov(X,Y) &= E[(X-\mu_X)(Y-\mu_Y)]\\ &= \sum_x \sum_y (x - \mu_X)(y- \mu_Y)p(x,y)\\ &=\sum_x \sum_y (x - \mu_X)(y- \mu_Y)p(x)p(y) \\ &= \sum_x (x - \mu_X)p(x)\left[ \sum_y (y- \mu_Y)p(y)\right] \\ &= E[Y- \mu_Y] \sum_x (x - \mu_X)p(x)\\ &= E[Y- \mu_Y]E[X- \mu_X] \\ &= 0 \end{aligned}\]

Problem 25 Standard

This question relies on the following joint pmf:

\(Y = -1\) \(Y = 0\) \(Y = 1\)
\(X = 0\) 1/9 1/9 0
\(X = 1\) 2/9 1/9 1/9
\(X = 2\) 0 1/9 2/9
  1. Calculate \(p_Y(0)\).

    \(p_Y(0) = p_{XY}(0,0) + p_{XY}(1,0) + p_{XY}(2,0) = 1/3\)

  2. Calculate \(p_{X|Y}(2|0)\).

    \(p_{X|Y}(2|0) = (1/9) / (1/9 + 1/9 + 1/9) = 1/3\)

  3. Calculate \(E[XY]\).

    \(E[XY] = (1 \times -1 \times 2/9) + (1 \times 1 \times 1/9) + (2 \times 1 \times 2/9) = (-2 + 1 + 4)/9 = 1/3\)

  4. Calculate \(Cov(X,Y)\)

    The marginal pmf of \(X\) is \(p_X(0) = 2/9\), \(p_X(1) = 4/9\), \(p_X(2) = 3/9\), so \(E[X] = 4/9 + 2 \times 3/9 = 10/9\). The marginal pmf of \(Y\) puts probability \(1/3\) on each of \(-1, 0, 1\), so \(E[Y] = 0\). By the shortcut formula and part (c), \(Cov(X,Y) = E[XY] - E[X]E[Y] = 1/3 - 10/9 \times 0 = 1/3\).

  5. Are \(X\) and \(Y\) independent? Why or why not?

    They are not independent: for example, if we know \(Y=-1\) then \(X\) cannot take on the value \(2\).

Problem 26 Harder

Let \(X\) and \(Y\) be two random variables with covariance \(\sigma_{XY}\) and variances \(\sigma_{X}^2\) and \(\sigma_{Y}^2\) where \(E[X]=E[Y]=0\). Define \(\beta = \sigma_{XY}/\sigma_{X}^2\) and \(Z = Y - \beta X\).

  1. Is \(\beta\) a random variable or a constant? Explain briefly.

    A constant: it’s a function of parameters, which are constants.

  2. Is \(Z\) a random variable or a constant? Explain briefly.

    A random variable: it’s a function of the RVs \(Y\) and \(X\).

  3. Calculate \(E[Z]\).

    \(E[Z] = E[Y - \beta X] = E[Y] - \beta E[X] = 0\)

  4. Calculate \(Cov(X,Z)\).

    Since both \(X\) and \(Z\) have zero mean, \[\begin{aligned} Cov(X,Z) &= E[XZ] = E\left[ X\left( Y - \beta X \right) \right]\\ &= E[XY] - \beta E[X^2] = Cov(X,Y) - \beta Var(X) \\ &= \sigma_{XY} - \frac{\sigma_{XY}}{\sigma_{X}^2} \cdot \sigma_X^2 = 0 \end{aligned}\] using the fact that \(E[X]=E[Y]=0\) and the definition of \(\beta\).

Problem 27 Challenge

Let \(Y\) and \(X\) be RVs. In this problem you will find the constants \(\beta_0\) and \(\beta_1\) that solve \[\min_{\beta_0, \beta_1} E[(Y - \beta_0 - \beta_1 X)^2].\] For the purposes of this question you may assume that expectation and differentiation can be interchanged, i.e. that \(\frac{∂}{∂ \theta} E[f(Z,\theta)] = E[\frac{∂}{∂ \theta} f(Z,\theta)]\). You do not have to check the second order condition.

  1. Show that \(\beta_0 = E[Y] - \beta_1 E[X]\).

    Differentiating with respect to \(\beta_0\) gives the first order condition \[-2 E[Y - \beta_0 - \beta_1 X] = 0\] Re-arranging using the linearity of expectation, \(\beta_0 = E[Y] - \beta_1 E[X]\)

  2. Using the preceding part, find \(\beta_1\).

    Substituting the expression for \(\beta_0\) back into the objective function, \[E[(Y - \mu_Y + \beta_1 \mu_X - \beta_1 X)^2] = E\left[ \left\{ (Y-\mu_Y) - \beta_1 (X - \mu_X)\right\}^2\right]\] using the shorthand \(E[Y] = \mu_Y\) and \(E[X] = \mu_X\). Now, differentiating with respect to \(\beta_1\) gives the first order condition \[-2 E\left[ \left\{(Y - \mu_Y) - \beta_1(X - \mu_X)\right\} (X - \mu_X)\right] = 0\] Finally, rearranging and solving for \(\beta_1\) using the linearity of expectation, \[\begin{aligned} E[(Y - \mu_Y)(X - \mu_X)] &= E[\beta_1(X - \mu_X)^2]\\ Cov(X,Y) &= \beta_1 Var(X)\\ \beta_1 &= \frac{Cov(X,Y)}{Var(X)} \end{aligned}\]

Linear combinations

Problem 28 Warm-up

Let \(X\) and \(Y\) be two RVs with \(Var(X) = \sigma_X^2\), \(Var(Y) = \sigma_Y^2\) and \(Corr(X,Y)=\rho\).

  1. Write down an expression for \(Var(X + Y)\) in terms of \(\sigma_X, \sigma_Y\) and \(\rho\).

    \(Var(X + Y) = Var(X) + Var(Y) + 2Cov(X,Y) = \sigma_X^2 + \sigma_Y^2 + 2\sigma_X \sigma_Y \rho\)

  2. Write down an expression for \(Var(X - Y)\) in terms of \(\sigma_X, \sigma_Y\) and \(\rho\).

    \(Var(X - Y) = Var(X) + Var(Y) - 2Cov(X,Y) = \sigma_X^2 + \sigma_Y^2 - 2\sigma_X \sigma_Y \rho\)

  3. Which is larger: \(Var(X + Y)\) or \(Var(X - Y)\)? Explain briefly.

    If \(\rho>0\) then \(2\sigma_X\sigma_Y\rho>0\), hence \(Var(X+Y)>Var(X-Y)\). If \(\rho <0\), then \(2\rho\sigma_X\sigma_Y<0\), hence \(Var(X + Y)<Var(X-Y)\). If \(\rho=0\) then \(2\rho\sigma_X\sigma_Y = 0\), hence \(Var(X+Y) = Var(X-Y)\).

Problem 29 Standard

Suppose that \(X \sim \text{Binomial}(n,p)\).

  1. Explain how \(X\) can be defined in terms of Bernoulli\((p)\) RVs.

    \(X = X_1 + X_2 + \dots + X_n\) where \(X_1, \dots, X_n\) are independent Bernoulli\((p)\) RVs: \(X\) counts the successes in \(n\) independent trials, each with probability \(p\) of success.

  2. Using the preceding part, derive \(E[X]\).

    Each \(X_i\) has \(E[X_i] = 0 \times (1-p) + 1 \times p = p\), so by the linearity of expectation \(E[X] = E[X_1] + \dots + E[X_n] = np\).

  3. Using the preceding part, derive \(Var(X)\).

    Each \(X_i\) has \(Var(X_i) = p(1-p)\). Because the \(X_i\) are independent, every covariance \(Cov(X_i, X_j)\) with \(i \neq j\) is zero, so the variance of the sum is the sum of the variances: \(Var(X) = Var(X_1) + \dots + Var(X_n) = np(1-p)\).

Problem 30 Standard

Students applying for a job at a consulting firm are required to take two tests. For a given applicant, scores on the two tests can be viewed as random variables: \(X\) and \(Y\). From information on past applicants, we know that both tests have means equal to 50, and standard deviations equal to 10. The correlation between scores on the two tests is 0.62. Let \(Z = X + Y\) denote an applicant’s combined score.

  1. Calculate \(E[Z]\)

    \(E[Z] = E[X + Y] = E[X] + E[Y] = 50 + 50 = 100\)

  2. Calculate \(Var(Z)\).

    \[\begin{aligned} \text{Var}(Z) &= Var(X + Y) = Var(X) + Var(Y) + 2 Cov(X,Y)\\ &= 10^2 + 10^2 + 2 \sigma_X \sigma_Y \rho_{XY}\\ &= 200 + 2 \times 10 \times 10 \times 0.62 = 324 \end{aligned}\]

  3. Only students whose combined score is at least 136 are hired. If \(Z\) is normally distributed, approximately what percentage of applicants will be hired?

    From the preceding parts \(\mu_Z = 100\) and \(\sigma_Z = \sqrt{324} = 18\). Hence, \[\begin{aligned} P(Z > 136) &= 1 - P(Z \leq 136) = 1 - P\left( \frac{Z - 100}{18} \leq \frac{136 - 100}{18} \right)\\ &= 1 - P\left( \frac{Z - 100}{18} \leq 2 \right) = 1 - \Phi(2) \approx 1 - 0.977 = 0.023 \end{aligned}\] where \(\Phi\) is the standard normal CDF. So about 2.3% of applicants will be hired. (The empirical rule gives the rougher figure of 2.5%.)

  4. Continuing under the assumption that \(Z\) is normally distributed, as in the preceding part, suppose the firm wanted to hire the top 16% of applicants. Approximately what cutoff should they use for each applicant’s combined score?

    We need to find \(c\) such that \(P(Z > c) = 0.16\). Using the same reasoning as in the preceding solution, \[P(Z > c) = 1 - P\left( \frac{Z - 100}{18} \leq \frac{c - 100}{18} \right) = 0.16\] and hence \[1 - \Phi\big( (c - 100)/18 \big) = 0.16.\] Rearranging, \[\Phi\big( (c - 100)/18 \big) = 0.84,\] so \((c - 100)/18\) needs to be the \(0.84\) quantile of the standard normal distribution. From the standard normal table (or the empirical rule) this quantile is approximately 1, so we have \[\begin{aligned} (c - 100) / 18 &\approx 1 \\ c - 100 &\approx 18\\ c &\approx 118 \end{aligned}\] So the firm should lower their cutoff from 136 to about 118 if they want to hire the top 16% of applicants.

Problem 31 Standard

Let \(Y_1, Y_2, Y_3 \sim \text{ iid } N(0, \sigma^2 = 36)\) and define: \(\displaystyle Z = Y_1 + \frac{Y_2}{2} + \frac{Y_3}{3}\).

  1. Calculate \(E[Z]\)

    By the linearity of expectation \[E[Z] = E[Y_1] + \frac{E[Y_2]}{2} + \frac{E[Y_3]}{3}=0\]

  2. Calculate \(\text{Var}(Z)\)

    Since \(Y_1, Y_2\), and \(Y_3\) are iid \[\text{Var}(Z) = \text{Var}(Y_1) + \frac{\text{Var}(Y_2)}{4} + \frac{\text{Var}(Y_3)}{9} = \frac{49}{36}\times 36= 49\]

  3. What kind of random variable is \(Z\)? Specify the values of any and all parameters.

    Linear combinations of independent normal random variables are normal, hence \(Z\sim N(0, 49)\).

  4. For what value of \(c\) is \(P(Z<c)\approx 0.975\)? Your answer should specify a numeric value.

    Since \(P(Z<c) = P(Z/7 < c/7)= \Phi(c/7)\), where \(\Phi\) is the standard normal CDF, we need to solve for \(c\) such that \(\Phi(c/7) \approx 0.975\). From the standard normal table, \(\Phi(1.96) \approx 0.975\), so \(c/7 \approx 1.96\) and \(c \approx 14\).

Problem 32 Standard

Let \(Y_1, \dots, Y_7 \sim \text{iid } N(\mu = -3, \sigma^2 = 9)\).

  1. Let \(X = 1 + Y_1/3\). What kind of random variable is \(X\)? You do not need to explain your answer, but be sure to specify any and all relevant parameters.

    \(N(0,1)\)

  2. Let \(W = (Y_2 + Y_3 + Y_4 + Y_5 + Y_6 + Y_7)/6\). What kind of random variable is \(W\)? You do not need to explain your answer, but be sure to specify any and all relevant parameters.

    \(N(\mu = -3, \sigma^2 = 3/2)\)

  3. What kind of random variable is \(X + W\)? You do not need to explain your answer, but be sure to specify any and all relevant parameters.

    \(N(\mu = -3, \sigma^2 = 5/2)\)

Problem 33 Standard

The random variables \(X_1\) and \(X_2\) correspond to the annual returns of Stock 1 and Stock 2. Suppose that \(E[X_1]=0.1\), \(E[X_2]=0.3\), \(Var(X_1) = Var(X_2) = 1\), and \(\rho=Corr(X_1, X_2)\). A portfolio \(\Pi(\omega)\) is defined by the proportion \(\omega\) of Stock # 1 that it contains. That is, \(\Pi(\omega) = \omega X_1 + (1-\omega) X_2\) where \(0\leq \omega \leq 1\).

  1. What value of \(\omega\) gives a portfolio with expected return \(0.15\)?

    \[\begin{aligned} E[\Pi(\omega)] = \omega E[X_1] + (1-\omega) E[X_2] &= 0.15\\ \omega/10 + 3(1-\omega)/10 &= 0.15\\ \omega + 3 - 3\omega &= 3/2\\ -4\omega + 6 &= 3\\ \omega &= 3/4 \end{aligned}\]

  2. Suppose that \(\omega = 1/4\). In terms of \(\rho\), what is the portfolio variance?

    First, we have \[Var\left[ \Pi(\omega) \right] = \omega^2 Var(X_1) + (1-\omega)^2 Var(X_2) + 2\omega (1-\omega) Cov(X_1,X_2)\] but since \(Var(X_1)=Var(X_2)=1\) and \(\rho = Corr(X_1, X_2)\), \[\begin{aligned} Var\left[ \Pi(\omega) \right] &= \omega^2 + (1-\omega)^2 + 2\omega (1-\omega) \rho \end{aligned}\] Substituting \(\omega = 1/4\), \[\begin{aligned} Var\left[ \Pi(1/4) \right] &= 1/16 + 9/16 + 2(1/4) (3/4) \rho\\ &= 10/16 + 6\rho/16\\ &= (3\rho + 5)/8 \end{aligned}\]

  3. Again, suppose that \(\omega = 1/4\). What are the maximum and minimum values of the portfolio variance? What are the corresponding values of \(\rho\)?

    From the previous part, \(Var[\Pi(\omega)]= (3\rho + 5)/8\). By inspection this variance takes on a maximum value of \(1\) when \(\rho=1\). It takes on a minimum value of \(0.25\) when \(\rho = -1\).

  4. If we assume that variance is a reasonable measure of risk, what does your answer to part (c) suggest about the benefits of constructing a portfolio rather than holding only one stock? Explain briefly.

    We see that the variance of this portfolio cannot exceed the variance of the individual assets that make it up. Unless \(\rho = 1\), the portfolio is less risky than either of the individual stocks.

Problem 34 Harder

Let \(X\) and \(Y\) be independent, normally distributed random variables representing the returns of two stocks such that \(\mu_x = \mu_y = 1\) and \(\sigma_x^2 = \sigma_y^2 = 2\). A portfolio \(\Pi(\omega)\) is a linear combination of the form \(\omega X + (1- \omega) Y\) where \(\omega \in [0,1]\) is the fraction of your total funds that are invested in \(X\).

  1. If you wish to construct the portfolio with the lowest possible variance, what value of \(\omega\) should you choose? Prove your answer.

    Since the asset returns are uncorrelated, the portfolio variance is simply \(\omega^2 \sigma^2_x + (1- \omega)^2 \sigma^2_y = 2\omega^2 + 2 (1- \omega)^2 = 4 \omega^2 - 4 \omega +2\). This is a globally convex function so it has a unique minimum. The first order condition is \(8 \omega - 4 = 0\) so the minimizer is \(\omega^* = 1/2\). The minimum variance portfolio is 50% asset \(X\) and 50% asset \(Y\).

  2. Calculate the expected value and the variance of the portfolio from the preceding part.

    The expected value is \(1/2 \times \mu_x + 1/2 \times \mu_y = 1\) and the variance is \((1/2)^2 \times \sigma^2_x + (1/2)^2 \sigma^2_y = 1\).

  3. Approximately what is the probability that the minimum variance portfolio will make a negative return?

    Since the individual assets are normally distributed and the portfolio is a linear combination of them, it too is normally distributed. We already worked out its mean and variance in the preceding part: both are one. The probability that a normal random variable takes on a value within one standard deviation of its mean is approximately 0.68. By symmetry, the probability that it takes on a value more than one standard deviation below its mean is approximately 0.16. Therefore, the minimum variance portfolio has approximately a 16% chance of earning a negative return.

Conditional expectation

Problem 35 Standard

Suppose that \(X\) is a random variable with support \(\{1,2\}\) and \(Y\) is a random variable with support \(\{0,1\}\) where \(X\) and \(Y\) have the following joint distribution: \[\begin{aligned} p_{XY}(1,0) &= 0.30\\ p_{XY}(1,1) &=0.25\\ p_{XY}(2,0) &=0.20\\ p_{XY}(2,1) &=0.25 \end{aligned}\]

  1. Express the joint probability mass function (pmf) in a \(2\times 2\) table.

    \(X = 1\) \(X = 2\)
    \(Y = 0\) 0.30 0.20
    \(Y = 1\) 0.25 0.25
  2. Using the table, calculate the marginal pmfs of \(X\) and \(Y\).

    \[\begin{aligned} p_X(1) &=p_{XY}(1,0) + p_{XY}(1,1)=0.30 + 0.25 = 0.55 \\ p_X(2) &=p_{XY}(2,0) + p_{XY}(2,1)= 0.20 + 0.25 = 0.45\\ p_Y(0) &=p_{XY}(1,0) + p_{XY}(2,0) = 0.30 + 0.20 = 0.50\\ p_Y(1) &= p_{XY}(1,1) + p_{XY}(2,1) = 0.25 + 0.25 = 0.50 \end{aligned}\]

  3. Calculate the conditional pmfs of \(Y|X=1\) and \(Y|X=2\).

    The distribution of \(Y|X = 1\) is \[\begin{aligned} P(Y = 0|X = 1) &=\frac{p_{XY}(1,0)}{p_X(1)} = \frac{0.30}{0.55}=\frac{6}{11}\\\\ P(Y = 1|X= 1) &=\frac{p_{XY}(1,1)}{p_X(1)} = \frac{0.25}{0.55}=\frac{5}{11} \end{aligned}\] while the distribution of \(Y|X = 2\) is \[\begin{aligned} P(Y = 0|X = 2) &=\frac{p_{XY}(2,0)}{p_X(2)} =\frac{0.20}{0.45}=\frac{4}{9} \\\\ P(Y = 1|X= 2) &=\frac{p_{XY}(2,1)}{p_X(2)} = \frac{0.25}{0.45}=\frac{5}{9} \end{aligned}\]

  4. Calculate \(E[Y|X=1]\) and \(E[Y|X=2]\).

    \[\begin{aligned} E[Y | X =1 ] &= 0 \cdot 6/11 + 1 \cdot 5/11 = 5/11 \\ E[Y | X =2 ] &= 0 \cdot 4/9 + 1 \cdot 5/9 = 5/9 \end{aligned}\]

  5. Calculate the covariance between \(X\) and \(Y\).

    First, from the marginal distributions, \(E[Y]=0.5\) and \(E[X] =1\cdot 0.55 + 2\cdot 0.45 =1.45\). Hence \(E[X]E[Y] = 0.725\). Second, \[\begin{aligned} E[XY] &= (0\cdot 1) \cdot 0.3 + (0\cdot 2)\cdot 0.2+ (1\cdot 1) \cdot 0.25 + (1\cdot 2) 0.25\\ &= 0.25 + 0.50 = 0.75 \end{aligned}\] Finally \(Cov(X,Y) = E[XY] - E[X]E[Y] = 0.750 - 0.725 = 0.025\)