Solved – Has this expectation been computed correctly

probabilityself-study

The question:
At a polling booth, ballots are cast by ten voters, of whom three are Republicans, two are
Democrats, and five are Independents. A local journalist interviews two of these voters, chosen randomly. Calculate the expectation of the absolute value of the difference between the number of Republicans interviewed and the number of Democrats interviewed.

The solution shows this:

Consider three cases, one for each result of the first interview.
Independent (prob 0.5): Expected absolute difference is (4/9)(0) +(5/9)(1) = 5/9
Republican (prob =0.3): Expected absolute difference is (2/9)(0) + (5/9)(1) + (2/9)(2) = 1
Democrat (prob = 0.2): Expected absolute difference is (3/9)(0) + (5/9)(1) + (1/9)(2) = 7/9.
The unconditional expectation is 0.5(5/9) + 0.3(1) + 0.2(7/9) = 6.6/9 = 11/15.
The above solution should be correct.

I don't understand how they got (4/9)(0) +(5/9)(1), can someone clarify how they got these values?

Best Answer

Sometimes it's clearest and simplest just to enumerate the (equiprobable) possibilities. After all, there are only $\binom{10}{2}=45$ subsets of two interviewees. I'll be thorough rather than efficient in order to illustrate some of the techniques and to serve as a check on the arithmetic.

  1. How can the difference be zero? When either both interviewees are Independents ($\binom{5}{2}$ possibilities) or one is Republican and the other Democrat ($3\times 2$ possibilities).

  2. How can the difference be one? One interviewee is Independent and the other is not: $5\times 5$ possibilities.

  3. How can the difference be two? Both interviewees must be in the same party ($\binom{3}{2} + \binom{2}{2}$ possibilities).

As a check, the total is

$$\left(\binom{5}{2} + 3\times 2\right) + 5\times 5 + \left(\binom{3}{2}+\binom{2}{2}\right) = (10+6)+25+(3+1)=45=\binom{10}{2}.$$

The expectation is the probability-weighted average. We needn't include the value of zero because it contributes nothing. That leaves

$$\frac{1}{\binom{10}{2}}\left((5\times 5) \times 1 + \left(\binom{3}{2}+\binom{2}{2}\right)\times 2\right) = \frac{33}{45} = \frac{11}{15}.$$


In retrospect, I suspect you might have shared only the beginning of a solution. The full solution might go like this:

  • There's a 1/2 chance the first interviewee is Independent. Conditional on that, there's a 4/9 chance one of the remaining nine voters is one of the remaining 4 Independents and a 5/9 chance they belong to a party. The conditional expectation of the absolute difference is $$(4/9)\times 0 + (5/9)\times 1 = 5/9.$$

  • There's a 3/10 chance the first interviewee is Republican. Conditional on that, there's a 5/9 chance the second is Independent (absolute difference is 1), a 2/9 chance they are Republican (absolute difference is 2), and a 2/9 chance they are Democrat (absolute difference is 0). The conditional expectation is $$(5/9) \times 1 + (2/9)\times 2 + (2/9)\times 0 = 1.$$

  • A comparable analysis of the last case, a 2/10 chance of a Democrat, gives a conditional expectation of $$(5/9)\times 1 + (3/9)\times 0 + (1/9)\times 2 = 7/9.$$

The expectation itself is weighted by the chances of each scenario, giving

$$(1/2) \times (5/9) + (3/10)\times (1) + (2/10) \times (7/9) = 11/15.$$


We can ask the computer to do the enumeration, too. Here's one way (in R). It is coded to be a little different than either of the previous solutions--otherwise it wouldn't be a very good check. I hope it's clear enough. Its output is

Expectation is 11 / 15

voters <- c(rep("Republican", 3), 
            rep("Democrat", 2), 
            rep("Independent", 5))          # The voters
polls <- combn(voters, 2)                   # All possible subsets of two voters
republicans <- colSums(polls=="Republican")
democrats <- colSums(polls=="Democrat")
X <- abs(republicans - democrats)
expectation <- mean(X)
cat("Expectation is", 15*expectation, "/ 15")
Related Question