Winter 2012 UCLA Poli Scu 200B Answers and Tutorial Doron ZEILBERGER

Version of 10:00am, Dec. 6, 2015 MAIN SCENARIO (abbreviated): 3 Republicans, 7 Democrats. P (Retire) = 0.2

1. What is the probability that at least one Republican retires? Sol. to 1: The probability that any given representative does not retire is the complementary probability 1 − 0.2 = 0.8. By independence, the probability that all three do not retire is 0.8^{3}. So the probability that at least one retires is 1 − 0.8^{3} = 0.488 Ans. to 1: The probability is %48.8 . Do right now: 1’. What is the probability that at least one Democrat retires? 1’. What is the probability that at least two legislators, of either party, retire?

2. What is the probability that exactly 3 legislators (of either party) retires in the upcoming year? Sol. to 2: This is the binomial distribution with n = 10, k = 3 and p = 0.2, Since

P (X = k) = \binom{n}{k}p^{k}(1 − p)^{n−k} .

So

P (X = 3) = \binom{10}{3}(0.2)^{3}(1 − 0.2)^{10−3} = \binom{10}{3}(0.2)^{3}(0.8)^{7} = 0.2013265920 .

Ans. to 2: The probability that exactly 3 legislatators retire is 0.2013265920, or roughly %20.13266. Do right now: 2’. What is the probability that at exactly 4 Democrats retire? 2”. What is the probability that at either exactly 3 or exactly 5 Democrats retire?

3. What is the expected number of retirements in the upcoming election? What is the variance? Solution of 3: Recall that the expectation (alias mean), μ of the Binomial Distribution B(n, p) is given by

μ = np

So, in this case

μ = 10 · 0.2 = 2 .

Also recall that the variance of B(n, p) , denoted by σ^{2}, is given by the formula

σ^{2} = np(1 − p) .

So we have, for this problem σ^{2} = 10 · 0.2 · (1 − 0.2) = 10 · 0.2 · 0.8 = 1.6 .

Ans. to 3: The expected number of retirements is 2, and the variance is 1.6. Do Right now: 3’. What is the expected number of Republican retirements in the upcoming election? What is the variance? 3”. What is the expected number of Democratic retirements in the upcoming election? What is the variance? 3”’. If I toss a loaded die, whose probabilities of landing on faces 1 through 6 are 0.1, 0.2, 0.4, 0.1, 0.1, 0.1 respectively, and I win a dollar every time it lends on a face with 4 dots or more, and get nothing otherwise, 100 times. What is my expected win? What is the standard deviation?

4. What is the probability that exactly one Democrat and one Republican retire? Sol. to 4: These events are independent.

P (D = 1) = \binom{7}{1}(0.2)^{1}(0.8)^{6} = 0.3670016

P (R = 1) = \binom{3}{1}(0.2)^{1}(0.8)^{2} = 0.384

So

P (D = 1 AND R = 1) = 0.3670016 · 0.384 = 0.1409286144 .

Ans. to 4: The probability that exactly one Republican AND exactly one Democrat retire is 0.1409286144, roughly %14.093 . Do Right now: 4’. What is the probability that exactly two Democrats and three Republican retire? 4”. (trick question) What is the probability that exactly two Democrats and four Republican retire?

4”’ Today I toss a loaded coin with Probability of Heads being 0.6, ten times. Tomorrow I toss a loaded coin with Probability of Heads being 0.7, twenty times. What is the probability that today I will get exactly four Heads and tomorrow I will get exactly fifteen Heads? Scenario continued (abbreviated) If Scandal occurs, P (Retirement) is 0.75. P (Scandal) = 0.4 5. Let X be the number of Republican retirements in the next election. What is the PMF of X conditioned on the scandal? What is the unconditioned PMF? Sol. to FIRST part of 5: This is the Binomial Distribution, B(n, p) with n = 3 and p = 0.75. Recall that, for B(n, p):

P (X = k) = \binom{n}{k}p^{k}(1 − p)^{n−k} .

So

P (X = 0) = \binom{3}{0}0.75^{0}(0.25)^{3} = 0.0156250

P (X = 1) = \binom{3}{1}0.75^{1}(0.25)^{2} = 0.140625

P (X = 2) = \binom{3}{2}0.75^{2}(0.25)^{1} = 0.421875

P (X = 3) = \binom{3}{3}0.75^{3}(0.25)^{0} = 0.421875

Sol. to Second part of 5: We first must compute the new p.

P (Retire) = P (Scandal) · P (Retire|Scandal) + P (NoScandal) · P (Retire|NoScandal)
= 0.4 · 0.75 + (1 − 0.4) · 0.2 = 0.42 .

Now we repeat the above with the new p = 0.42. So

P (X = 0) = \binom{3}{0}0.42^{0}(0.58)^{3}

P (X = 1) = \binom{3}{1}0.42^{1}(0.58)^{2}

P (X = 2) = \binom{3}{2}0.42^{2}(0.58)^{1}

P (X = 3) = \binom{3}{3}0.42^{3}(0.58)^{0}

Do Right Now: 5’: What are the two PMFs for the Democrats? 5”: The probability of a Heads in a loaded coin is 0.7, and in a fair coin is 0.5. I know that the casino will let me use a loaded coin with probability 0.6. If I toss the coin four times, what is the PMF conditioned on the fact that the coin is loaded? What is the unconditional PMF?

6. What is the variance of the number of Republican retirements? What is the variance if the scandal was certain to develop? How would you interpret the difference between these two numbers? Sol. to 6: First Part This is B(n, p) with n = 3 and p = 0.42, so σ^{2} = np(1 − p) = 3 · 0.42 · 0.58 = 0.7308 Second Part This is B(n, p) with n = 3 and p = 0.75, so σ^{2} = np(1 − p) = 3 · 0.75 · 0.25 = 0.5625 Interpretation: The higher the probability p (past 0.5) the smaller the variance, in the extreme case of p = 1, the variance is 0. Do right now 6’. What is the variance of the number of Democratic retirements? What is the variance if the scandal was certain to develop? How would you interpret the difference between these two numbers? 6”: The probability of a Heads in a loaded coin is 0.7, and in a fair coin is 0.5. I know that the casino will let me use a loaded coin with probability 0.6. If I toss the coin 100 times, what is the variance if I know for sure that the coin is loaded? What if I don’t know?

7. Suppose that (for this question only) you are told that none of the three Republicans will retire. Does this information cause you to update your belief on the probability of a scandal? Explain! Sol. of 7:

P (NoOneRetires|Scandal) = (0.25)^{3} = 0.015625
P (NoOneRetires|NoScandal) = (0.8)^{3} = 0.512

So P (NoOneRetires) = P r(NoOneRetires|Scandal)·P (Scandal)+P r(NoOneRetires|NoScandal)·P (NoScandal)

= 0.015625 · 0.4 + 0.512 · 0.6 = 0.2563250

Using Bayes’s Law

P (Scandal|NoOneRetirs) =

\frac{P r(NoOneRetires|Scandal) · P (Scandal)}{P r(NoOneRetires|Scandal) · P (Scandal) + P r(NoOneRetires|NoScandal) · P (NoScandal)}

= \frac{0.015625 · 0.4}{0.2563250} = 0.01248415098 .

So we need to update our belief and the probability of the scandal happening is now, with this new information, much less, only about %1.25. Note: This makes sense, since the probability of none of the Republicans retiring in case of a scandal is much less than that probability with no scandal. So the fact that it turned out that the number of retirements was zero, indicates that there probably was no scandal. Comment: The above only apply to Bayesians. If you are a frequentist, you would refuse to answer this question, since you would claim that the question is NONSENSE.

Scenario (continued): State B has two Republicans.. If No Scandal : P (Retire) = 0.4 If YES Scandal : P (Retire) = 0.75 P (Scandal) = 0.4 Comment: The unconditional probability of retirement in State B is

(0.6) · (0.4) + (0.4) · 0.75 = 0.54

Hence E(Y) = 2 · 0.54 = 1.08. Recall from Problem 5 that the unconditional probability of retirement in State A was 0.42, and hence E(X) = 3 · 0.42 = 1.26

8. Let X be the number of Republican retirements in State A, and Y in State B. What is the joint PMF of X and Y? Explain! Sol. of 8: Terse Version This problem, done the long way is extremely long. One needs to first find the PMF for the No Scandal Scenario, ((3 + 1) · (2 + 1) = 12 calculations), then for the Scandal scneario (another 12 caclulations), and then use the abobe (0.6 times the former plus 0.4 times the later) for each of these, resulting in 12 more calculations (each of which involes two multiplications and one addition). This is stupid. So it is more efficient to derive a general formula for

P (X = i, Y = j) ,

in terms of i and j (0 ≤ i ≤ 3, 0 ≤ j ≤ 2)), once and for all.

Case 1: No Scandal By the Binomial distribution

P (X = i|NoScandal) = \binom{3}{i}(0.2)^{i}(0.8)^{3−i} , P (Y = j|NoScandal) = \binom{2}{j}(0.4)^{j}(0.6)^{2−j} ,

By independence

P (X = i, Y = j|NoScandal) = \binom{3}{i}(0.2)^{i}(0.8)^{3−i}\binom{2}{j}(0.4)^{j}(0.6)^{2−j} .

Similarly

P (X = i|Scandal) = \binom{3}{i}(0.75)^{i}(0.25)^{3−i} , P (Y = j|Scandal) = \binom{2}{j}(0.75)^{j}(0.75)^{2−j} ,

By independence

P (X = i, Y = j|Scandal) = \binom{3}{i}(0.75)^{i}(0.25)^{3−i}\binom{2}{j}(0.75)^{j}(0.25)^{2−j} .

Combining, we have, since P (X = i, Y = j) = P (X = i, Y = j|NoScandal)P (NoScandal)+P (X = i, Y = j|Scandal)P (Scandal) =

P (X = i, Y = j|NoScandal)0.6 + P (X = i, Y = j|Scandal)P (Scandal)0.4 ,

the general formula

P (X = i, Y = j) = (\binom{3}{i}(0.2)^{i}(0.8)^{3−i}\binom{2}{j}(0.4)^{j}(0.6)^{2−j})) · 0.6+

(\binom{3}{i}(0.75)^{i}(0.25)^{3−i}\binom{2}{j}(0.75)^{j}(0.25)^{2−j}) · 0.4 .

This can be programmed into Maple, in one line:

P:=proc(i,j):  0.6*binomial(3,i)*(0.2)**i*(0.8)**(3-i)*binomial(2,j)*0.4**j*0.6**(2-
j)+ 0.4*binomial(3,i)*(0.75)**i*(0.25)**(3-i)*binomial(2,j)*0.75**j*0.25**(2-j) :  end:

Now to find all the 12 values, all you have to do is

seq(seq(jointPMF[i,j]=P(i,j),j=0..2),i=0..3);

VERBOSE VERSION (by hand)

Multi-Step Problem! Case 1: No Scandal Regarding X alone

P (X = 0) = \binom{3}{0}(0.2)^{0}(0.8)^{3} = 0.512

P (X = 1) = \binom{3}{1}(0.2)^{1}(0.8)^{2} = 0.384

P (X = 2) = \binom{3}{2}(0.2)^{2}(0.8)^{1} = 0.096

P (X = 3) = \binom{3}{0}(0.2)^{3}(0.8)^{0} = 0.0080

Regarding Y alone

P (Y = 0) = \binom{2}{0}(0.4)^{0}(0.6)^{2} = 0.36

P (Y = 1) = \binom{2}{1}(0.4)^{1}(0.6)^{1} = 0.48

P (Y = 2) = \binom{2}{2}(0.4)^{2}(0.6)^{0} = 0.16

By Independence (if there is No Scandal)

P (X = 0, Y = 0) = P (X = 0)P (Y = 0) = 0.512 · 0.36 = 0.18432 P (X = 1, Y = 0) = P (X = 1)P (Y = 0) = 0.384 · 0.36 = 0.13824 P (X = 2, Y = 0) = P (X = 2)P (Y = 0) = 0.096 · 0.36 = 0.03456 P (X = 3, Y = 0) = P (X = 3)P (Y = 0) = 0.008 · 0.36 = 0.0028800

P (X = 0, Y = 1) = P (X = 0)P (Y = 1) = 0.512 · 0.48 = 0.245760 P (X = 1, Y = 1) = P (X = 1)P (Y = 1) = 0.384 · 0.48 = 0.18432 P (X = 2, Y = 1) = P (X = 2)P (Y = 1) = 0.096 · 0.48 = 0.04608 P (X = 3, Y = 1) = P (X = 3)P (Y = 1) = 0.008 · 0.48 = 0.003840

P (X = 0, Y = 2) = P (X = 0)P (Y = 1) = 0.512 · 0.16 = 0.0819200 P (X = 1, Y = 2) = P (X = 1)P (Y = 1) = 0.384 · 0.16 = 0.061440 P (X = 2, Y = 2) = P (X = 2)P (Y = 1) = 0.096 · 0.16 = 0.015360 P (X = 3, Y = 2) = P (X = 3)P (Y = 1) = 0.008 · 0.16 = 0.0012800

Case 2: Yes Scandal Regarding X alone

P (X = 0) = \binom{3}{0}(0.75)^{0}(0.25)^{3} = 0.0156250

P (X = 1) = \binom{3}{1}(0.75)^{1}(0.25)^{2} = 0.140625

P (X = 2) = \binom{3}{2}(0.75)^{2}(0.25)^{1} = 0.421875

P (X = 3) = \binom{3}{0}(0.75)^{3}(0.25)^{0} = 0.4218750

Regarding Y alone

P (Y = 0) = \binom{2}{0}(0.75)^{0}(0.25)^{2} = 0.06250

P (Y = 1) = \binom{2}{1}(0.75)^{1}(0.25)^{1} = 0.375

P (Y = 2) = \binom{2}{2}(0.75)^{2}(0.25)^{0} = 0.56250

By Independence (if there is YES Scandal)

P (X = 0, Y = 0) = P (X = 0)P (Y = 0) = 0.0156250 · 0.06250 = 0.000976562500 P (X = 1, Y = 0) = P (X = 1)P (Y = 0) = 0.140625 · 0.06250 = 0.00878906250 P (X = 2, Y = 0) = P (X = 2)P (Y = 0) = 0.421875 · 0.06250 = 0.02636718750, P (X = 3, Y = 0) = P (X = 3)P (Y = 0) = 0.4218750 · 0.06250 = 0.02636718750 P (X = 0, Y = 1) = P (X = 0)P (Y = 1) = 0.0156250 · 0.375 = 0.00585937500, P (X = 1, Y = 1) = P (X = 1)P (Y = 1) = 0.140625 · 0.375 = 0.0527343750 P (X = 2, Y = 1) = P (X = 2)P (Y = 1) = 0.421875 · 0.375 = 0.1582031250 P (X = 3, Y = 1) = P (X = 3)P (Y = 1) = 0.4218750 · 0.375 = 0.1582031250, P (X = 0, Y = 2) = P (X = 0)P (Y = 2) = 0.0156250 · 0.56250 = 0.008789062500 P (X = 1, Y = 2) = P (X = 1)P (Y = 2) = 0.140625 · 0.56250 = 0.07910156250 P (X = 2, Y = 2) = P (X = 2)P (Y = 2) = 0.421875 · 0.56250 = 0.237304687

P (X = 3, Y = 2) = P (X = 3)P (Y = 2) = 0.4218750 · 0.56250 = 0.2373046875

Finally using P (X = i, Y = j) = P (X = i, Y = j|NoScandal)·P (NoScandal)+P (X = i, Y = j|Y esScandal)·P (Y esScandal) =

P (X = i, Y = j|NoScandal) · 0.6 + P (X = i, Y = j|Y esScandal)0.4

We have

P (X = 0, Y = 0) = 0.1109826250
P (X = 1, Y = 0) = 0.08645962500
P (X = 2, Y = 0) = 0.03128287500
P (X = 3, Y = 0) = 0.01227487500
P (X = 0, Y = 1) = 0.1497997500
P (X = 1, Y = 1) = 0.1316857500
P (X = 2, Y = 1) = 0.09092925000
P (X = 3, Y = 1) = 0.06558525000
P (X = 0, Y = 2) = 0.05266762500
P (X = 1, Y = 2) = 0.06850462500
P (X = 2, Y = 2) = 0.1041378750
P (X = 3, Y = 2) = 0.09568987500

9: The covariance of X and Y is

COV (X, Y) = E(XY) − E(X)E(Y)

Now (via a computer)

E(XY) = ∑_{i=0}^{3} ∑_{j=0}^{2} ijP r(X = i, Y = j) = 1.638000000

Using Maple, the above procedure p(i,j) above, we do add(add(i*j*p(i,j),j=0..2),i=0..3)
;

We computed above above that E(X) = 1.26 and E(Y) = 1.08, hence COV (X, Y) = E(XY) − E(X)E(Y) = 1.638000000 − 1.26 · 1.08 = 0.2772 .

Another way:

COV (XY) = ∑_{i=0}^{3} ∑_{j=0}^{2}(i−E(X))(j−E(Y))P r(X = i, Y = j) = ∑_{i=0}^{3} ∑_{j=0}^{2}(i−1.26)(j−1.08))P r(X = i, Y = j) = 0.2772 .

Using Maple, the above procedure p(i,j) above, we do

add(add((i-1.26)*(j-1.08)*P(i,j),j=0..2),i=0..3) ;

Answer to 9: The covariance is X and Y is 0.2772. 10: Let Z be the total number of retirements. What is the expected value of Z. Sol. of 10: By the Linearity of Expectation

E(Z) = E(X + Y) = E(X) + E(Y) = 1.26 + 1.08 = 2.34 .

Ans. to 10: The expected value of Z is 2.34. Remark: A much longer way would be to do

∑_{i=0}^{3} ∑_{j=0}^{2}(i + j)P r(X = i, Y = j)

Surprise!, the computer got the same thing!

11. What is the expected value of Z if we know there was a scandal. Sol. of 11:

E(X) = 3 · 0.75 = 2.25 , E(Y) = 2 · 0.75 = 1.50

So

E(Z) = E(X) + E(Y) = 2.25 + 1.50 = 3.75 .

Ans. to 11: The expcetex value of retirements, if we know there was a scandal is 3.75. Do Right Now: 11’: I throw a pair of dice, 10 times. The probabilities of the first die lending on 1, 2, 3, 4, 5, 6 are all \frac{1}{6} (in other words, it is a fair die). The probabilities of the second die lending on 1, 2, 3, 4, 5, 6 are 0.4, 0.1, 0.1, 0.1, 0.1, 0.2 respectively. What is the expectation of the random variable : “total number of dots” altogether? Note that the smallest X can be is 20, and the largest is 120.

Scenario (abbreviated): The average number of endorsements is 5 12: What it the probability that a viable candidate will get fewer than 3 endorsements? Solution to 12: This is the Poisson distribution, since the probability that any specific organization will give an endorsement is very small, but there are many of them and the expected number is small (5 in this case). Recall that for P oisson(μ), the PMF is

P (X = k) = e^{−μ} \frac{μ^{k}}{k!} .

So

P (X < 3) = P (X ≤ 2) = P (X = 0) + P (X = 1) + P (X = 2) = e^{−5} · \frac{5^{0}}{0!} + e^{−5} · \frac{5^{1}}{1!} + e^{−5} · \frac{5^{2}}{2!}

= e^{−5}(1 + 5 + 25/2) = 0.1246520195

Ans. to 12: The probability is 0.1246520195 . Do Right Now: 12’. The average number of email messages that I get in the period between 9:00am and 12:00 Noon very day is 3.4. What are the probabilities that in that period, tomorrow

(a) I will get at most 2 emails?

(b) I will get at least 4 emails?

Scenario (abbreviated): The mean is 25% and the standard deviation is 20%.

13. What is the probability that the realized turn out (a) exceeds 30%? (b) is less that 15%? Sol. to 13: The standardized version is Z = \frac{X−μ}{σ}. Here μ = 25, σ = 20. a

P (X > 30) = P (\frac{X − 25}{20} > \frac{30 − 25}{20}) = P (Z > \frac{1}{4}) = 1−P (Z < 0.25) = 1−Φ(0.25) = 0.4012936743

Ans. to 13(a):0.4012936743. b

P (X < 15) = P (\frac{15 − 25}{20} < \frac{15 − 25}{20}) = P (Z < −\frac{1}{2}) = Φ(−0.5) = 0.3085375387

Ans. to 13(b): 0.3085375387 Do Right Now: 13’: The average IQ in my class is 120 and the standard deviation is 20. If I pick a random student, what is the probability that

(a) His IQ is less than 115?

b) Her IQ is more than 140? Final Advise: The test is reasonable except 8 and 9. Leave them to the end!

Doron Zeilberger, Department of Mathematics, Rutgers University (New Brunswick), Hill Center-Busch Campus, 110 Frelinghuysen Rd., Piscataway, NJ 08854-8019, USA.

Email: zeilberg at math dot rutgers dot edu .