A fair six sided die can roll any number from 1 to 6 with equal likelihood.
On fair coin, consider heads to have value 2 and tails to have value 1.
Consider the two experiments:
Experiment A: First roll the die. The outcome tells you how many times to flip the coin. x=the total value of the coin tosses.
Experiment B: First flip the coin. The outcome tells you how many times to roll the die. y=the total value of the die rolls.
1. Prove that the probability distributions of x and y are not the same.
2. How do the means of x and y compare?
3. How do the standard deviations of x and y compare?
5 dim Prob(12)
10 for Die=1 to 6
20 PDie=1/6
30 for Tot=1 to 12
40 if Tot>=Die and Tot<=2*Die then
50 :PTot=PDie*combi(Die,Tot-Die)/2^Die
60 :Prob(Tot)=Prob(Tot)+PTot
70 next Tot
80 next Die
89 Sum=0
90 for I=1 to 12
100 print I,Prob(I);tab(22);Prob(I)/1;tab(45);:Cum=Cum+Prob(I)
101 for J=1 to int(150*Prob(I)):print "*";:next:print
102 Sum=Sum+I*Prob(I)
110 next
120 print Cum,Sum,Sum/1,
130 for I=1 to 12
140 Sumsq=(I-Sum)*(I-Sum)*Prob(I)
150 next I
160 Sd=sqrt(Sumsq)
170 print Sd
200 print
210 for I=1 to 12:Prob(I)=0:next I
310 for Coin=1 to 2
320 PCoin=1/2
330 for Die=1 to 6
335 if Coin=1 then
340 :Prob(Die)=Prob(Die)+PCoin/6
345 :else
350 :for Die2=1 to 6
355 :Prob(Die+Die2)=Prob(Die+Die2)+PCoin/36
360 :next Die2
365 :endif
370 next Die
380 next Coin
389 Sum=0:Cum=0:Sumsq=0
390 for I=1 to 12
400 print I,Prob(I);tab(22);Prob(I)/1;tab(45);:Cum=Cum+Prob(I)
401 for J=1 to int(150*Prob(I)):print "*";:next:print
402 Sum=Sum+I*Prob(I)
410 next
420 print Cum,Sum,Sum/1,
430 for I=1 to 12
440 Sumsq=(I-Sum)*(I-Sum)*Prob(I)
450 next I
460 Sd=sqrt(Sumsq)
470 print Sd
finds
Experiment A:
total probability text graph
1 1/12 0.0833333333333333333 ************
2 1/8 0.125 ******************
3 5/48 0.1041666666666666666 ***************
4 11/96 0.1145833333333333333 *****************
5 7/64 0.109375 ****************
6 43/384 0.1119791666666666666 ****************
7 7/64 0.109375 ****************
8 13/128 0.1015625 ***************
9 5/64 0.078125 ***********
10 17/384 0.0442708333333333333 ******
11 1/64 0.015625 **
12 1/384 0.0026041666666666666
mean s.d.
1 21/4 5.25 0.34445949507888442
Experiment B:
1 1/12 0.0833333333333333333 ************
2 7/72 0.0972222222222222221 **************
3 1/9 0.111111111111111111 ****************
4 1/8 0.125 ******************
5 5/36 0.1388888888888888888 ********************
6 11/72 0.1527777777777777777 **********************
7 1/12 0.0833333333333333333 ************
8 5/72 0.0694444444444444444 **********
9 1/18 0.0555555555555555555 ********
10 1/24 0.0416666666666666666 ******
11 1/36 0.0277777777777777777 ****
12 1/72 0.0138888888888888888 **
mean s.d.
1 21/4 5.25 0.7954951288348659649
The means agree with what would be expected, as 1.5 * 3.5, which is the expected value of the coin tosses times the expected value on the die.
However, the standard deviation seems larger in experiment B while the data would seem to indicate it should be the other way around.
The calculations are in the program shown above.
|
Posted by Charlie
on 2011-05-06 14:12:53 |