STAT 333 Assignment 1 SOLUTIONS
1.
Consider 10 independent coin flips having probability
p
of landing heads.
a.
Find the expected number of changeovers.
Let X
i
= 1 if there is a changeover between trial i and trial i+1, 0 otherwise, i = 1, 2, …, 9.
Then X, the number of changeovers is X
1
+ X
2
+ … + X
9
E[X
i
] = P(Changeover) = P(HT or TH) =
p
(1 –
p
) + (1 –
p
)
p =
2(
p
–
p
2
), i = 1, 2, …, 9.
So E[X] = E[X
1
+ X
2
+…+ X
9
] = E[X
1
] + E[X
2
] + … + E[X
9
] = 9[2(
p
–
p
2
)] = 18(
p
–
p
2
)
b.
Find the variance of the number of changeovers.
Var(X
i
) = P(Changeover)(1 – P(Changeover))
= 2(
p
–
p
2
) (1 – 2(
p
–
p
2
))
= 2(– 2
p
4
+ 4
p
3
– 3
p
2
+
p
), i = 1, 2, …, 9.
Cov(X
i
, X
j
) will be 0 unless i and j are adjacent. We want i < j so let j = i + 1.
E[X
i
X
i+1
] = P(2 changeovers) = P(HTH or THT) =
p
(1 –
p
)
p
+ (1 –
p
)
p
(1 –
p
) =
p
–
p
2
Cov(X
i
, X
i+1
) = E[X
i
X
i+1
] – E[X
i
]E[X
i+1
]
= (
p
–
p
2
) – (2(
p
–
p
2
))
2
= – 4
p
4
+ 8
p
3
– 5
p
2
+
p
, i = 1, 2, …, 8.
So Var(X) = ∑ Var(X
i
) + 2 ∑ Cov(X
i
, X
i+1
)
= 9[2(– 2
p
4
+ 4
p
3
– 3
p
2
+
p
)] + 2*8[– 4
p
4
+ 8
p
3
– 5
p
2
+
p
]
= – 100
p
4
+ 200
p
3
– 134
p
2
+ 34
p
c.
Describe how the mean and variance of the number of changeovers behave for
different values of
p
. Provide a brief logical explanation.
Using Excel to plot E[X] and Var(X) for different values of
p
yields the following result:
0
1
2
3
4
5
0.01
0.05
0.09
0.13
0.17
0.21
0.25
0.29
0.33
0.37
0.41
0.45
0.49
0.53
0.57
0.61
0.65
0.69
0.73
0.77
0.81
0.85
0.89
0.93
0.97
E[X]
Var(X)
Explanation: the expected value makes sense because with a higher likelihood of getting
either all T or all H, we expect fewer changeovers. For the variance, as
p
goes to 0 or 1,
the number of changeovers approaches 0 with certainty, and hence the variance
approaches 0 too. In the middle, things are a little weird: variance is highest when
p
is
around 0.78 and 0.22 and dips lower when
p
is closer to 0.5. It makes sense if you
remember that variance is the average squared distance from the mean. When
p
is close
to 0.5, the mean is 4.5, and the farthest away the actual number of changeovers could
possibly be is 0 or 9 (a distance of 4.5). When
p
is slightly higher or lower, the mean
drifts down, so the possibility of being really far away (e.g. 9 when the mean is 3, a
distance of 6) drags the variance up.