Download HW4 Solution

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Probability wikipedia , lookup

Transcript
HW4, for MATH441, STAT461, STAT561, due September 28th
1. Consider rolling a 6-sided die and a 4-sided die. Let X be the value of the 6-sided die minus the value
of the 4-sided die.
(a) Determine the probability mass function for X.
Solutions. The possible outcomes are
S = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 1), (2, 2), (2, 3), (2, 4), (3, 1), (3, 2), (3, 3), (3, 4), (4, 1), (4, 2), (4, 3), (4, 4), (5, 1), (5, 2), (5, 3), (
Each outcome has probability (1/6)(1/4) = 1/24. The range for X is from −3 to 5. There is one way to get
−3, with outcome (1,4), and two ways to get -2, with outcomes (1,3) and (2,4), and so forth, so we get


1/24 i = −3





2/24
i = −2




3/24 i = −1





4/24 i = 0



4/24 i = 1, outcomes (2,1),(3,2),(4,3),(5,4)
P (X = i) =

4/24 i = 2, outcomes (3,1),(4,2),(5,3),(6,4)





3/24 i = 3, outcomes (4,1),(5,2),(6,3)




2/24 i = 4





1/24
i=5



0
otherwise
(b) Determine E[X].
2. Let X be the value of a single fair die with n sides. For (a) and (b), assume the sides are labeled
1, 2, . . . , n.
(a) Suppose n = 4. Find E[X] and V ar[X].
Solution. E[X] = 2.5
E[X 2 ] = (1/4)(12 + 22 + 32 + 42 ) = 30/4
V ar(X) = E[X 2 ] − [E(X)]2 = 30/4 − 25/4 = 5/4
Pn
Pn
. Find E[X] and V ar(X) for general n.
(b) Recall the formulas i=1 i = n+1
and i=1 i2 = n(n+1)(2n+1)
6
2
n
E[X] =
1X
n(n + 1)
n+1
i=
=
n i=1
2n
2
n
E[X 2 ] =
1X 2
n(n + 1)(2n + 1)
(n + 1)(2n + 1)
i =
=
n i=1
6n
6
(n + 1)(2n + 1) (n + 1)2
4(2n2 + 3n + 1) − 6(n2 + 2n + 1)
n2 − 1
−
=
=
6
4
24
12
(c) Suppose the sides of the die are labelled m, m + 1, m + 2, . . . , m + n − 1. Find E[X] and V ar(X). Hint:
recall the properties of expectation and variance that E[aX + b] = aE[X] + b and V ar(aX + b) = a2 V ar(X).
V ar(X) =
Let Y be labelled 1, . . . , n. The X = Y + m − 1. Thus,
n+1
2m + n − 1
+m−1=
E[X] =
2
2
n2 − 1
V ar(X) = V ar(Y + m − 1) = V ar(Y ) =
12
3. Consider a game in which the probability of winning is 0.45 (for example, if you are playing at a casino,
and the casino has probability 0.55 of winning). Suppose that to play the game you pay $2. If you lose, then
1
2
you lose the money. If you win, you get the money back and win an additional $2. In other words, each time
you play, you either lose $2 or win $2. Consider the following strategy for playing the game: You play the
game once, and if you win, then you quit. If you lose, then you play two more times regardless of the outcome
of the second game. Let X be your total winnings. Determine the probability mass function for X and E[X].
The possible sequences of the games are (W for win, L for lose): W, LW W, LW L, LLW, LLL. The
probabilities of the sequences.
P (W ) = .45
P (LW W ) = (.55)(.45)(.45) = 0.111375
P (LW L) = (.55)(.45)(.55) = 0.136125
P (LLW ) = 0.136125
P (LLL) = 0.166375
You win $2 under sequences W and LW W , you lose $2 under sequences LLW and LW L, and you loose $6
for sequence LLL. Therefore

0.166375 i = −6



0.27225
i = −2
P (X = i) =

0.561375 i = 2



0
otherwise
The expected winnings are
E[X] = (−6)(0.166375) − 2(0.27225) + 2(0.561375) = −0.42
So you expect to lose 42 cents, on average, when playing this game. The strategy does indeed make it more
likely that you will win money than that you will lose money, however, you still lose money in the long run.
If you win, you win a little, and if you lose, you might lose a lot, relatively speaking. The moral of the story
is that it is important to pay attention expected values and not just the most probable event.
4. Let
(
P (X = i) =
e−3 · 3i /i!
0
for i ∈ {0, 1, 2, . . . }
otherwise
(a) Find P (X ≤ 2)
P (X ≤ 2) = P (X = 0) + P (X = 1) + P (X = 2) = e−3 + e−3 · 3 + e−3 · 32 /2 = 0.4231901
P∞
(b) Show that i=0 P (X = i) = 1. Hint: Recall the infinite series for ex or look up and read about the
Poisson distribution either in one of the textbooks or online.
∞
X
P (X = i) =
i=0
∞
X
i=0
e−3 3i /i! = e−3
∞
X
3i /i! = e−3 · e3 = 1
i=0
(c) Find P (X is an odd number).
For part (c), write the probability as an infinite series, and see if you find what infinite series this corresponds to from Calc II or Wikipedia.
Solution.
P (X is an odd number) = e−λ
λ
λ1
λ3
e − e−λ
1 − e−2λ
+
+ · · · = e−λ sinh(λ) = e−λ
=
1!
3!
2
2
3
For λ = 3, this means
P (X is an odd number) =
1 − e−6
= 0.4987606
2
5. Let the cdf of a random variable X be given by
F (a) =


0



 a3

1
3


3


4


1
+
a−1
4
a<0
0≤a<1
1≤a<2
2≤a<3
a≥3
(a) What is P (X ≤ 2)?
P (X ≤ 2) = F (2) = 3/4.
(b) Find P (X = i), i = 0, 1, 2, 3
Solution.
P (X = 0) = 0/3 = 0.
P (X = 1) = 0
P (X = 2) = P (X ≤ 2) − P (X ≤ 1) = F (2) − F (1) = 3/4 − 1/3 = 5/12
P (X = 3) = 1 − 3/4 = 1/4
Note that the probabilities here don’t add to 1 because this is not the complete distribution. This
distribution has a mixture of continuous and discrete components, so the discrete probabilities sum to less
than 1. For this distribution, there is a probability of 5/12 + 1/4 = 2/3 that X is an integer, either 2 or 3,
and 1/3 probability that X is a real number between 0 and 2.
(c) Find P 31 ≤ X ≤ 34 . Note that generally for a < b, P (a < X ≤ b) = F (b) − F (a). Note that for
a discrete random variable, P (a ≤ X ≤ b) is usually not the same as P (a < X ≤ b). In other words, pay
attention to strict versus not strict inequalities.
P
1
3
≤X≤
3
4
=P
1
3
3/4 1/3
1 1
9−4
5
<X≤
+P (X = 1/3) = F (3/4)−F (1/3)+P (X = 1/3) =
−
+0 = − =
=
3
4
3
3
4 9
36
36
Note that in this case
(d) Plot F (a) from a = −1 to a = 4.
0.0
0.2
0.4
F(x)
0.6
0.8
1.0
4
−1
0
1
2
x
3
4