Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this assignment you will learn about a type of conditional expectation. This

ID: 3067046 • Letter: I

Question

In this assignment you will learn about a type of conditional expectation. This is an expectation computed using conditional probability. Suppose that X is a discrete random variable (the continuous case will be addressed later in the course), and suppose that A is a related event. Define the conditional expectation of X given A by

E(X|A) = X x?Range(x) xP(X = x | A)

Notice that we have simply replaced P(X = x) from the usual expectation formula with the conditional probability P(X = x | A).

If A1, . . . , Ak are an exhaustive list of events, then we have the following version of the law of total probability (alternatives) for expectation:

E(X) = E(X | A1)P(A1) + E(X | A2)P(A2) + · · · + E(X | Ak)P(Ak)    (?)

Example: Two fair dice are tossed. Let X be the sum of the values that result. Let A be the event that X is an even number. Notice that

P(A) = P(2) + P(4) + P(6) + P(8) + P(10) + P(12) = (1 + 3 + 5 + 5 + 3 + 1) /36 = 1/2 .

Since the range of X is {2, . . . , 12}

E(X | A) = X 12 n=2 nP(X = n | A).

Note that P(X = n | A) = 0 if n is odd, since the event A makes odd outcomes impossible. Meanwhile,

P(X = 2 | A) = (P(X = 2 and x ? A)) / P(A) = P(X = 2) / P(A) = 1/36 / 1/2 = 2/36

and similarly for the other even outcomes, so that

E(X|A) = 2P(X = 2 | A) + 4P(X = 4 | A) + 6P(X = 6 | A) + 8P(X = 8 | A) + 10P(X = 10 | A) + 12P(X = 12 | A) = 2 · 2/36 + 4 · 6/36 + 6 · 10/36 + 8 · 10/36 + 10 · 6/36 + 12 · 2/36 = 252/36 = 7.

Example: A biased coin has probability p of returning heads. The coin is tossed until a head appears. Let W be the waiting time (number of tosses) for this first head to occur, and denote a = E(W). (We will compute the value of a later on.) Let H1 be the event that the first toss is heads, and let T1 be the event that the first toss is tails. What is the value of E(W|H1)? What is the value of E(W|T1)? In this case we just think concretely. If the first toss is heads, then the first head has arrived! So E(W|H1) = 1, because exactly one toss did the job. If the first toss is tails, then we have to start all over with our wait. So the wait time for the first head is the same as before, except that we already wasted first toss (a tail), so E(W|T1) = 1 + a, one more than we expected at the beginning.

You will elaborate on this example in the next exercise.

1. As in the previous example, a biased coin has probability p of returning heads. The coin is tossed until a head appears. Let W be the waiting time (number of tosses) for this first head, and denote a = E(W). In class we proved (laboriously) that a = 1/p , but let’s pretend we never knew that. Since the first toss must either be heads or tails, the law of total probability (see Equation (?) on the previous page) says that a = E(W) = E(W|H1)P(H1) + E(W|T1)P(T1).

Now use the results of example on the last page to fill in these values and derive a nice formula for a in terms of p. Hint: Plug the formulas from the previous example into Equation (?) and solve for a.

2. Now use the same sort of reasoning for a different related question. As before, a biased coin has probability p of returning heads. The coin is tossed until a pattern of two heads in immediate succession (HH) occurs. Let W be the waiting time (number of tosses needed) for this outcome (HH), and denote a = E(W). This time we will need to condition on three initial outcomes. Consider the what happens if the first toss is a T, or if the first two tosses are HT, or if the first two tosses are HH. Use the law of total probability (?) with these three conditions the way we did earlier to find a nice formula for a in terms of p. Show your work. (A formula without justification earns no credit.)

3. If p = 0.6 in Exercise 2 above, how many tosses would it take (on average) to get a pair HH of successive heads? What about a pair TT of successive tails?

Explanation / Answer

1. We have  a = E(W) = E(W|H1)P(H1) + E(W|T1)P(T1) = 1 x p + (1+a) x (1-p) = p +1 - p + a - pa

pa = 1

Hence a = 1/p

2. a = E(W) = E(W|T1)P(T1) + E(W|H1T2)P(H1T2) + E(W|H1H2)P(H1H2)

E(W|H1H2) = 1; P(H1H2) = p x p = p2  

E(W|T1) = 1 + a; P(T1) = 1-p

E(W|H1T2) = 2 + a; P(H1T2) = p x (1-p)

a = E(W|T1)P(T1) + E(W|H1T2)P(H1T2) + E(W|H1H2)P(H1H2) = (1+a) x (1-p) + (2+a) x p x (1-p) + p2

Solving, ap2 = p - p2 + 1

a = (p-p2 + 1) / p2

3. p = 0.6

a = (0.6-0.36+1) / 0.36 = 3.444