Mit18 05 s22 Prac Exam01 All Sol
Mit18 05 s22 Prac Exam01 All Sol
Mit18 05 s22 Prac Exam01 All Sol
05, Spring
2022
This is a big list of practice problems for Exam 1. It includes all the problems
in other sets of practice problems and many more!
Problem 1. A full house in poker is a hand where three cards share one rank and two cards
share another rank. How many ways are there to get a full-house? What is the probability
of getting a full-house?
Solution: We build a full-house in stages and count the number of ways to make each
stage:
13
Stage 1. Choose the rank of the pair: ( ).
1
4
Stage 2. Choose the pair from that rank, i.e. pick 2 of 4 cards: ( ).
2
12
Stage 3. Choose the rank of the triple (from the remaining 12 ranks): ( ).
1
4
Stage 4. Choose the triple from that rank: ( ).
3
13 4 12 4
Number of ways to get a full-house: ( )( )( )( )
1 2 1 3
52
Number of ways to pick any 5 cards out of 52: ( )
5
13 4 12 4
( )( )( )( )
1 2 1 3
Probability of a full house: ≈ 0.00144
52
( )
5
Problem 2. There are 3 arrangements of the word DAD, namely DAD, ADD, and DDA.
How many arrangements are there of the word PROBABILITY?
Solution: Sort the letters: A BB II L O P R T Y. There are 11 letters in all. We build
arrangements by starting with 11 ‘slots’ and placing the letters in these slots, e.g
A B I B I L O P R T Y
Create an arrangement in stages and count the number of possibilities at each stage:
11
Stage 1: Choose one of the 11 slots to put the A: ( )
1
10
Stage 2: Choose two of the remaining 10 slots to put the B’s: ( )
2
8
Stage 3: Choose two of the remaining 8 slots to put the I’s: ( )
2
6
Stage 4: Choose one of the remaining 6 slots to put the L: ( )
1
1
Practice Exam 1: All Questions, Spring 2022 2
5
Stage 5: Choose one of the remaining 5 slots to put the O: ( )
1
4
Stage 6: Choose one of the remaining 4 slots to put the P: ( )
1
3
Stage 7: Choose one of the remaining 3 slots to put the R: ( )
1
2
Stage 8: Choose one of the remaining 2 slots to put the T: ( )
1
1
Stage 9: Use the last slot for the Y: ( )
1
Number of arrangements:
11 10 8 6 5 4 3 2 1 10 ⋅ 9 8 ⋅ 7
( )( )( )( )( )( )( )( )( ) = 11 ⋅ ⋅ ⋅ 6 ⋅ 5 ⋅ 4 ⋅ 3 ⋅ 2 ⋅ 1 = 9979200
1 2 2 1 1 1 1 1 1 2 2
Problem 3. (a) How many ways can you arrange the letters in the word STATISTICS?
(e.g. SSSTTTIIAC counts a one arrangement.)
(b) If all arrangements are equally likely, what is the probabilitiy the two ’i’s are next to
each other.
Solution: (a) Create an arrangement in stages and count the number of possibilities at
each stage:
10
Stage 1: Choose three of the 10 slots to put the S’s: ( )
3
7
Stage 2: Choose three of the remaining 7 slots to put the T’s: ( )
3
4
Stage 3: Choose two of the remaining 4 slots to put the I’s: ( )
2
2
Stage 4: Choose one of the remaining 2 slots to put the A: ( )
1
1
Stage 5: Use the last slot for the C: ( )
1
Number of arrangements:
10 7 4 2 1
( )( )( )( )( ) = 50400.
3 3 2 1 1
10
(b) The are ( ) = 45 equally likely ways to place the two I’s.
2
There are 9 ways to place them next to each other, i.e. in slots 1 and 2, slots 2 and 3, …,
slots 9 and 10.
So the probability the I’s are adjacent is 9/45 = 0.2.
Practice Exam 1: All Questions, Spring 2022 3
Problem 4. In a ballroom dancing class the students are divided into group 𝐴 and group
𝐵. There are six people in group 𝐴 and seven in group 𝐵. If four 𝐴s and four 𝐵s are
chosen and paired off, how many pairings are possible?
Solution: Build the pairings in stages and count the ways to build each stage:
6
Stage 1: Choose the 4 from group 𝐴: ( ).
4
7
Stage 2: Choose the 4 from group 𝐵: ( )
4
We need to be careful because we don’t want to build the same 4 couples in multiple ways.
Line up the 4 𝐴’s 𝐴1 , 𝐴2 , 𝐴3 , 𝐴4
Stage 3: Choose a partner from the 4 𝐵s for 𝐴1 : 4.
Stage 4: Choose a partner from the remaining 3 𝐵s for 𝐴2 : 3
Stage 5: Choose a partner from the remaining 2 𝐵s for 𝐴3 : 2
Stage 6: Pair the last 𝐵 with 𝐴4 : 1
6 7
Number of possible pairings: ( )( )4!.
4 4
Note: we could have done stages 3-6 in one go as: Stages 3-6: Arrange the 4 𝐵s opposite
the 4 𝐴s: 4! ways.
Problem 5. Suppose you pick two cards from a deck of 52 playing cards. What is the
probability that they are both queens?
Solution: Using choices (order doesn’t matter):
4 52
Number of ways to pick 2 queens: ( ). Number of ways to pick 2 cards: ( ).
2 2
4
( )
2
All choices of 2 cards are equally likely. So, probability of 2 queens =
52
( )
2
Using permutations (order matters):
Number of ways to pick the first queen: 4. No. of ways to pick the second queen: 3.
Number of ways to pick the first card: 52. No. of ways to pick the second card: 51.
4⋅3
All arrangements of 2 cards are equally likely. So, probability of 2 queens: 52⋅51 .
Problem 6. Suppose that there are ten students in a classroom. What is the probability
that no two of them have a birthday in the same month?
Solution: We assume each month is equally likely to be a student’s birthday month.
Number of ways ten students can have birthdays in 10 different months:
12!
12 ⋅ 11 ⋅ 10 … ⋅ 3 =
2!
Number of ways 10 students can have birthday months: 1210 .
12!
Probability no two share a birthday month: = 0.00387.
2! 1210
3 people to set the table, 2 people to boil the water, 6 people to make the scones.
Each person can only do 1 task. (Note that this doesn’t add up to 20. The rest of the people
don’t help.)
(a) In how many different ways can they choose which people perform these tasks?
(b) Suppose that the Democrats all hate tea. If they only give tea to 10 of the 20 people,
what is the probability that they only give tea to Republicans?
(c) If they only give tea to 10 of the 20 people, what is the probability that they give tea to
9 Republicans and 1 Democrat?
Solution: (a) There are (20 17
3 ) ways to choose the 3 people to set the table, then ( 2 ) ways
15
to choose the 2 people to boil water, and ( 6 ) ways to choose the people to make scones.
So the total number of ways to choose people for these tasks is
(b) The number of ways to choose 10 of the 20 people is (2010) The number of ways to choose
14
10 people from the 14 Republicans is (10). So the probability that you only choose 10
Republicans is
(14
10)
14!
10! 4!
= ≈ 0.00542
(20
10)
20!
10! 10!
Alternatively, you could choose the 10 people in sequence and say that there is a 14/20
probability that the first person is a Republican, then a 13/19 probability that the second
one is, a 12/18 probability that third one is, etc. This gives a probability of
14 13 12 11 10 9 8 7 6 5
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ .
20 19 18 17 16 15 14 13 12 11
(You can check that this is the same as the other answer given above.)
(c) You can choose 1 Democrat in (61) = 6 ways, and you can choose 9 Republicans in (14
9)
ways, so the probability equals
6 ⋅ (14
9) 6 ⋅ 9!14!5! 6 ⋅ 14! 10! 10!
20 = 20!
= .
(10) 10! 10!
9! 5! 20!
Problem 8. Let 𝐴 and 𝐵 be two events. Suppose the probability that neither 𝐴 or 𝐵 occurs
is 2/3. What is the probability that one or both occur?
Solution: We are given 𝑃 (𝐴𝑐 ∩ 𝐵𝑐 ) = 2/3 and asked to find 𝑃 (𝐴 ∪ 𝐵).
𝐴𝑐 ∩ 𝐵𝑐 = (𝐴 ∪ 𝐵)𝑐 ⇒ 𝑃 (𝐴 ∪ 𝐵) = 1 − 𝑃 (𝐴𝑐 ∩ 𝐵𝑐 ) = 1/3.
Problem 9. Let 𝐶 and 𝐷 be two events with 𝑃 (𝐶) = 0.25, 𝑃 (𝐷) = 0.45, and 𝑃 (𝐶 ∩ 𝐷) =
0.1. What is 𝑃 (𝐶 𝑐 ∩ 𝐷)?
Solution: 𝐷 is the disjoint union of 𝐷 ∩ 𝐶 and 𝐷 ∩ 𝐶 𝑐 .
Practice Exam 1: All Questions, Spring 2022 5
𝐶 𝐷
So, 𝑃 (𝐷 ∩ 𝐶) + 𝑃 (𝐷 ∩ 𝐶 𝑐 ) = 𝑃 (𝐷) 𝐷 ∩ 𝐶𝑐
⇒ 𝑃 (𝐷 ∩ 𝐶 𝑐 ) = 𝑃 (𝐷) − 𝑃 (𝐷 ∩ 𝐶) = 0.45 − 0.1 = 0.35. 0.1 0.45−0.1
(We never use 𝑃 (𝐶) = 0.25.)
Problem 10. You roll a four-sided die 3 times. For this problem we’ll use the sample
space with 64 equally likely outcomes.
(a) Write down this sample space in set notation.
(b) List all the outcomes in each of the following events.
(i) A = ‘Exactly 2 of the 3 rolls are fours’
(ii) B = ‘At least 2 of the 3 rolls are fours’
(iii) C = ’Exactly 1 of the second and third rolls is a 4’
(iv) 𝐴 ∩ 𝐶
Solution: (a) Writing all 64 possibilities is too tedius. Here’s a more compact representa-
tion
{(𝑖, 𝑗, 𝑘) | 𝑖, 𝑗, 𝑘 are integers from 1 to 4}
Problem 11. Suppose we have 8 teams labeled 𝑇1 , …, 𝑇8 . Suppose they are ordered by
placing their names in a hat and drawing the names out one at a time.
(a) How many ways can it happen that all the odd numbered teams are in the odd numbered
slots and all the even numbered teams are in the even numbered slots?
Solution: Slots 1, 3, 5, 7 are filled by 𝑇1 , 𝑇3 , 𝑇5 , 𝑇7 in any order: 4! ways.
Slots 2, 4, 6, 8 are filled by 𝑇2 , 𝑇4 , 𝑇6 , 𝑇8 in any order: 4! ways.
Solution: 4! ⋅ 4! = 576.
(b) What is the probability of this happening?
Solution: There are 8! ways to fill the 8 slots in any way.
Practice Exam 1: All Questions, Spring 2022 6
4! ⋅ 4! 576
Since each outcome is equally likely the probabilitiy is = = 0.143 = 1.43%.
8! 40320
Problem 12. More cards! Suppose you want to divide a 52 card deck into four hands with
13 cards each. What is the probability that each hand has a king?
Solution: Let 𝐻𝑖 be the event that the 𝑖𝑡ℎ hand has one king. We have the conditional
probabilities
4 48 3 36 2 24
( )( ) ( )( ) ( )( )
1 12 1 12 1 12
𝑃 (𝐻1 ) = ; 𝑃 (𝐻2 |𝐻1 ) = ; 𝑃 (𝐻3 |𝐻1 ∩ 𝐻2 ) =
52 39 26
( ) ( ) ( )
13 13 13
𝑃 (𝐻4 |𝐻1 ∩ 𝐻2 ∩ 𝐻3 ) = 1
𝑃 (𝐻1 ∩ 𝐻2 ∩ 𝐻3 ∩ 𝐻4 ) = 𝑃 (𝐻4 |𝐻1 ∩ 𝐻2 ∩ 𝐻3 ) 𝑃 (𝐻3 |𝐻1 ∩ 𝐻2 ) 𝑃 (𝐻2 |𝐻1 ) 𝑃 (𝐻1 )
2 24 3 36 4 48
( )( )( )( )( )( )
1 12 1 12 1 12
= .
26 39 52
( )( )( )
13 13 13
Problem 13. Suppose you are taking a multiple-choice test with 𝑐 choices for each question.
In answering a question on this test, the probability that you know the answer is 𝑝. If you
don’t know the answer, you choose one at random. What is the probability that you knew
the answer to a question, given that you answered it correctly?
Solution: The following tree shows the setting
𝑝 1−𝑝
Know Guess
1 0 1/𝑐 1 − 1/𝑐
Let 𝐶 be the event that you answer the question correctly. Let 𝐾 be the event that you
actually know the answer. The left circled node shows 𝑃 (𝐾 ∩ 𝐶) = 𝑝. Both circled nodes
together show 𝑃 (𝐶) = 𝑝 + (1 − 𝑝)/𝑐. So,
𝑃 (𝐾 ∩ 𝐶) 𝑝
𝑃 (𝐾|𝐶) = =
𝑃 (𝐶) 𝑝 + (1 − 𝑝)/𝑐
Or we could use the algebraic form of Bayes’ theorem and the law of total probability: Let
𝐺 stand for the event that you’re guessing. Then we have,
𝑃 (𝐶|𝐾) = 1, 𝑃 (𝐾) = 𝑝, 𝑃 (𝐶) = 𝑃 (𝐶|𝐾)𝑃 (𝐾) + 𝑃 (𝐶|𝐺)𝑃 (𝐺) = 𝑝 + (1 − 𝑝)/𝑐. So,
𝑃 (𝐶|𝐾)𝑃 (𝐾) 𝑝
𝑃 (𝐾|𝐶) = =
𝑃 (𝐶) 𝑝 + (1 − 𝑝)/𝑐
Practice Exam 1: All Questions, Spring 2022 7
Problem 14. Corrupted by their power, the judges running the popular game show Amer-
ica’s Next Top Mathematician have been taking bribes from many of the contestants. Each
episode, a given contestant is either allowed to stay on the show or is kicked off.
If the contestant has been bribing the judges they will be allowed to stay with probability 1.
If the contestant has not been bribing the judges, they will be allowed to stay with probability
1/3.
Suppose that 1/4 of the contestants have been bribing the judges. The same contestants
bribe the judges in both rounds, i.e., if a contestant bribes them in the first round, they bribe
them in the second round too (and vice versa).
(a) If you pick a random contestant who was allowed to stay during the first episode, what
is the probability that they were bribing the judges?
(b) If you pick a random contestant, what is the probability that they are allowed to stay
during both of the first two episodes?
(c) If you pick random contestant who was allowed to stay during the first episode, what is
the probability that they get kicked off during the second episode?
Solution: The following tree shows the setting. Stay1 means the contestant was allowed
to stay during the first episode and stay2 means the they were allowed to stay during the
second.
1/4 3/4
Bribe Honest
1 0 1/3 2/3
1 1 3 1
𝑃 (𝑆1 ) = 𝑃 (𝑆1 |𝐵)𝑃 (𝐵) + 𝑃 (𝑆1 |𝐻)𝑃 (𝐻) = 1 ⋅ + ⋅ = .
4 3 4 2
𝑃 (𝐵) 1/4 1
We therefore have (by Bayes’ rule) 𝑃 (𝐵|𝑆1 ) = 𝑃 (𝑆1 |𝐵) =1⋅ = .
𝑃 (𝑆1 ) 1/2 2
(b) Using the tree we have the total probability of 𝑆2 is
1 3 1 1 1
𝑃 (𝑆2 ) = + ⋅ ⋅ =
4 4 3 3 3
Practice Exam 1: All Questions, Spring 2022 8
𝑃 (𝐿2 ∩ 𝑆1 )
(c) We want to compute 𝑃 (𝐿2 |𝑆1 ) = .
𝑃 (𝑆1 )
From the calculation we did in part (a), 𝑃 (𝑆1 ) = 1/2. For the numerator, we have (see the
tree)
1 2 3 1
𝑃 (𝐿2 ∩ 𝑆1 ) = 𝑃 (𝐿2 ∩ 𝑆1 |𝐵)𝑃 (𝐵) + 𝑃 (𝐿2 ∩ 𝑆1 |𝐻)𝑃 (𝐻) = 0 ⋅ + ⋅ =
4 9 4 6
1/6 1
Therefore 𝑃 (𝐿2 |𝑆1 ) = = .
1/2 3
Problem 15. Consider the Monty Hall problem. Let’s label the door with the car behind
it 𝑎 and the other two doors 𝑏 and 𝑐. In the game the contestant chooses a door and then
Monty chooses a door, so we can label each outcome as ‘contestant followed by Monty’, e.g
𝑎𝑏 means the contestant chose 𝑎 and Monty chose 𝑏.
(a) Make a 3 × 3 probability table showing probabilities for all possible outcomes.
(b) Make a probability tree showing all possible outcomes.
(c) Suppose the contestant’s strategy is to switch. List all the outcomes in the event ‘the
contestant wins a car’. What is the probability the contestant wins?
(d) Redo part (c) with the strategy of not switching.
Solution: (a) and (b) In the tree the first row is the contestant’s choice and the second
row is the host’s (Monty’s) choice.
Viewed as a table Viewed as a tree
Contestant 1 1 1
a b c 3 3 3
a 0 0 0 a b c
1 1
Host b 1/6 0 1/3 0 2 2 0 0 1 0 1 0
c 1/6 1/3 0 a c a c a c
b b b
(b) With this strategy the contestant wins with {bc, cb}. The probability of winning is
𝑃 (𝑏𝑐) + 𝑃 (𝑐𝑏) = 2/3. (Both the tree and the table show this.)
(c) {𝑎𝑏, 𝑎𝑐}, probability = 1/3.
Problem 17. There is a screening test for prostate cancer that looks at the level of PSA
(prostate-specific antigen) in the blood. There are a number of reasons besides prostate
cancer that a man can have elevated PSA levels. In addition, many types of prostate cancer
develop so slowly that that they are never a problem. Unfortunately there is currently no
test to distinguish the different types and using the test is controversial because it is hard to
quantify the accuracy rates and the harm done by false positives.
For this problem we’ll call a positive test a true positive if it catches a dangerous type of
prostate cancer. We’ll assume the following numbers:
Rate of prostate cancer among men over 50 = 0.0005
True positive rate for the test = 0.9
False positive rate for the test = 0.01
Let 𝑇 be the event a man has a positive test and let 𝐷 be the event a man has a dangerous
type of the disease. Find 𝑃 (𝐷|𝑇 ) and 𝑃 (𝐷|𝑇 𝑐 ).
Solution: You should write this out in a tree! (For example, see the solution to the next
problem.)
We compute all the pieces needed to apply Bayes’ rule. We’re given
𝑃 (𝑇 |𝐷) = 0.9 ⇒ 𝑃 (𝑇 𝑐 |𝐷) = 0.1, 𝑃 (𝑇 |𝐷𝑐 ) = 0.01 ⇒ 𝑃 (𝑇 𝑐 |𝐷𝑐 ) = 0.99.
𝑃 (𝐷) = 0.0005 ⇒ 𝑃 (𝐷𝑐 ) = 1 − 𝑃 (𝐷) = 0.9995.
We use the law of total probability to compute 𝑃 (𝑇 ):
Problem 18. A multiple choice exam has 4 choices for each question. A student has
studied enough so that the probability they will know the answer to a question is 0.5, the
probability that they will be able to eliminate one choice is 0.25, otherwise all 4 choices seem
Practice Exam 1: All Questions, Spring 2022 10
equally plausible. If they know the answer they will get the question right. If not they have
to guess from the 3 or 4 choices.
As the teacher you want the test to measure what the student knows. If the student answers
a question correctly what’s the probability they knew the answer?
Solution: We show the probabilities in a tree:
For a given problem let 𝐶 be the event the student gets the problem correct and 𝐾 the
event the student knows the answer.
The question asks for 𝑃 (𝐾|𝐶).
We’ll compute this using Bayes’ rule:
Problem 19. Suppose you have an urn containing 7 red and 3 blue balls. You draw three
balls at random. On each draw, if the ball is red you set it aside and if the ball is blue you
put it back in the urn. What is the probability that the third draw is blue?
(If you get a blue ball it counts as a draw even though you put it back in the urn.)
Solution: Here is the game tree, 𝑅1 means red on the first draw etc.
7/10 3/10
𝑅1 𝐵1
6/9 3/9 7/10 3/10
𝑅2 𝐵2 𝑅2 𝐵2
5/8 3/8 6/9 3/9 6/9 3/9 7/10 3/10
𝑅3 𝐵3 𝑅3 𝐵3 𝑅3 𝐵3 𝑅3 𝐵3
Problem 20. Some games, like tennis or ping pong, reach a state called deuce. This means
that the score is tied and a player wins the game when they get two points ahead of the other
player. Suppose the probability that you win a point is 𝑝 and this is true independently for
all points. If the game is at deuce what is the probability you win the game?
This is a tricky problem, but amusing if you like puzzles.
Solution: Let 𝑊 be the event you win the game from deuce and 𝐿
Practice Exam 1: All Questions, Spring 2022 11deuce
p 1-p
+1 −1
the event you lose. For convenience, define 𝑤 = 𝑃 (𝑊 ).
p 1-p p 1-p
The figure shows the complete game tree through 2 points. In the
third level we just abreviate by indicating the probability of winning deuce deuce
𝑊 w w 𝐿
from deuce.
The nodes marked +1 and -1, indicate whether you won or lost the
first point. 𝑊 𝑊
Summing all the paths to 𝑊 we get
𝑝2
𝑤 = 𝑃 (𝑊 ) = 𝑝2 + 𝑝(1 − 𝑝)𝑤 + (1 − 𝑝)𝑝𝑤 = 𝑝2 + 2𝑝(1 − 𝑝)𝑤 ⇒ 𝑤 = .
1 − 2𝑝(1 − 𝑝)
0.6
Therefore 𝑃 (𝐾|𝐶) = = 0.857 = 85.7%.
0.7
3 Independence
Problem 22. Suppose that 𝑃 (𝐴) = 0.4, 𝑃 (𝐵) = 0.3 and 𝑃 ((𝐴 ∪ 𝐵)𝐶 ) = 0.42. Are 𝐴 and
𝐵 independent?
Solution: We have 𝑃 (𝐴 ∪ 𝐵) = 1 − 0.42 = 0.58 and we know because of the inclusion-
exclusion principle that
Thus,
Problem 23. Suppose now that events 𝐴, 𝐵 and 𝐶 are mutually independent with
𝐴 𝐵
0.06
0.09 0.14
0.21
Note that, for instance, 𝑃 (𝐴 ∩ 𝐵) is split into two pieces. One of the pieces is 𝑃 (𝐴 ∩ 𝐵 ∩ 𝐶)
which we know and the other we compute as 𝑃 (𝐴 ∩ 𝐵) − 𝑃 (𝐴 ∩ 𝐵 ∩ 𝐶) = 0.12 − 0.06 = 0.06.
The other intersections are similar.
We can read off the asked for probabilities from the diagram.
(i) 𝑃 (𝐴 ∩ 𝐵 ∩ 𝐶 𝑐 ) = 0.06
(ii) 𝑃 (𝐴 ∩ 𝐵𝑐 ∩ 𝐶) = 0.09
(iii) 𝑃 (𝐴𝑐 ∩ 𝐵 ∩ 𝐶) = 0.14.
Problem 24. You roll a twenty-sided die. Determine whether the following pairs of events
are independent.
(a) ‘You roll an even number’ and ‘You roll a number less than or equal to 10’.
(b) ‘You roll an even number’ and ‘You roll a prime number’.
Solution: 𝐸 = even numbered = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}.
𝐿 = roll ≤ 10 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
𝐵 = roll is prime = {2, 3, 5, 7, 11, 13, 17, 19} (We use 𝐵 because 𝑃 is not a good choice.)
(a) 𝑃 (𝐸) = 10/20, 𝑃 (𝐸|𝐿) = 5/10. These are the same, so the events are independent.
(b) 𝑃 (𝐸) = 10/20. 𝑃 (𝐸|𝐵) = 1/8. These are not the same so the events are not indepen-
dent.
Problem 25. Suppose 𝐴 and 𝐵 are events with 0 < 𝑃 (𝐴) < 1 and 0 < 𝑃 (𝐵) < 1.
Practice Exam 1: All Questions, Spring 2022 13
Problem 26. Directly from the definitions of expected value and variance, compute 𝐸[𝑋]
and Var(𝑋) when 𝑋 has probability mass function given by the following table:
X -2 -1 0 1 2
pmf 1/15 2/15 3/15 4/15 5/15
Solution: We compute
1 2 3 4 5 2
𝐸[𝑋] = −2 ⋅ + −1 ⋅ +0⋅ +1⋅ +2⋅ = .
15 15 15 15 15 3
Thus
2
Var(𝑋) = 𝐸[(𝑋 − )2 ]
3
2 2 1 2 2 2 2 2 3 2 2 4 2 2 5
= (−2 − ) ⋅ + (−1 − ) ⋅ + (0 − ) ⋅ + (1 − ) ⋅ + (2 − ) ⋅
3 15 3 15 3 15 3 15 3 15
14
= .
9
Problem 27. Suppose that 𝑋 takes values between 0 and 1 and has probability density
function 2𝑥. Compute Var(𝑋) and Var(𝑋 2 ).
Solution: We will make use of the formula Var(𝑌 ) = 𝐸[𝑌 2 ] − 𝐸[𝑌 ]2 . First we compute
1
2
𝐸[𝑋] = ∫ 𝑥 ⋅ 2𝑥𝑑𝑥 =
0 3
1
1
𝐸[𝑋 2 ] = ∫ 𝑥2 ⋅ 2𝑥𝑑𝑥 =
0 2
1
1
𝐸[𝑋 ] = ∫ 𝑥4 ⋅ 2𝑥𝑑𝑥 = .
4
0 3
Practice Exam 1: All Questions, Spring 2022 14
Thus,
2 1 4 1
Var(𝑋) = 𝐸[𝑋 2 ] − (𝐸[𝑋]) = − =
2 9 18
and
2 1 1 1
Var(𝑋 2 ) = 𝐸[𝑋 4 ] − (𝐸[𝑋 2 ]) = − = .
3 4 12
Problem 28. The random variable 𝑋 takes values -1, 0, 1 with probabilities 1/8, 2/8, 5/8
respectively.
(a) Compute 𝐸[𝑋].
(b) Give the pmf of 𝑌 = 𝑋 2 and use it to compute 𝐸[𝑌 ].
(c) Instead, compute 𝐸[𝑋 2 ] directly from an extended table.
(d) Compute Var(𝑋).
(a) Solution: We have
𝑋 values: -1 0 1
prob: 1/8 2/8 5/8
𝑋2 1 0 1
So, 𝐸[𝑋] = −1/8 + 5/8 = 1/2.
𝑌 values: 0 1
(b) Solution: ⇒ 𝐸[𝑌 ] = 6/8 = 3/4.
prob: 2/8 6/8
(c) Solution: The change of variables formula just says to use the bottom row of the table
in part (a): 𝐸[𝑋 2 ] = 1 ⋅ (1/8) + 0 ⋅ (2/8) + 1 ⋅ (5/8) = 3/4 (same as part (b)).
(d) Solution: Var(𝑋) = 𝐸[𝑋 2 ] − 𝐸[𝑋]2 = 3/4 − 1/4 = 1/2.
Problem 29. Suppose 𝑋 is a random variable with 𝐸[𝑋] = 5 and Var(𝑋) = 2. What is
𝐸[𝑋 2 ]?
Solution: Use Var(𝑋) = 𝐸[𝑋 2 ] − 𝐸[𝑋]2 ⇒ 2 = 𝐸[𝑋 2 ] − 25 ⇒ 𝐸[𝑋 2 ] = 27.
Problem 30. Compute the expectation and variance of a Bernoulli(𝑝) random variable.
Solution: Make a table:
𝑋: 0 1
prob: (1-p) p
𝑋2 0 1.
From the table, 𝐸[𝑋] = 0 ⋅ (1 − 𝑝) + 1 ⋅ 𝑝 = 𝑝.
Since 𝑋 and 𝑋 2 have the same table 𝐸[𝑋 2 ] = 𝐸[𝑋] = 𝑝.
Therefore, Var(𝑋) = 𝑝 − 𝑝2 = 𝑝(1 − 𝑝).
Problem 31. Suppose 100 people all toss a hat into a box and then proceed to randomly
pick out of a hat. What is the expected number of people to get their own hat back.
Practice Exam 1: All Questions, Spring 2022 15
Hint: express the number of people who get their own hat as a sum of random variables
whose expected value is easy to compute.
Solution: Let 𝑋 be the number of people who get their own hat.
Following the hint: let 𝑋𝑗 represent whether person 𝑗 gets their own hat. That is, 𝑋𝑗 = 1
if person 𝑗 gets their hat and 0 if not.
100 100
We have, 𝑋 = ∑ 𝑋𝑗 , so 𝐸[𝑋] = ∑ 𝐸[𝑋𝑗 ].
𝑗=1 𝑗=1
Since person 𝑗 is equally likely to get any hat, we have 𝑃 (𝑋𝑗 = 1) = 1/100. Thus, 𝑋𝑗 ∼
Bernoulli(1/100) ⇒ 𝐸[𝑋𝑗 ] = 1/100 ⇒ 𝐸[𝑋] = 1.
Problem 32. Suppose I play a gambling game with even odds. So, I can wager 𝑏 dollars
and I either win or lose 𝑏 dollars with probability 𝑝 = 0.5.
I employ the following strategy to try to guarantee that I win some money.
I bet $1; if I lose, I double my bet to $2, if I lose I double my bet again. I continue until
I win. Eventually I’m sure to win a bet and net $1 (run through the first few rounds and
you’ll see why this is the net).
If this really worked casinos would be out of business. Our goal in this problem is to
understand the flaw in the strategy.
(a) Let 𝑋 be the amount of money bet on the last game (the one I win). 𝑋 takes values 1,
2, 4, 8, …. Determine the probability mass function for 𝑋. That is, find 𝑝(2𝑘 ), where 𝑘 is
in {0, 1, 2, …}.
1
Solution: It is easy to see that (e.g. look at the probability tree) 𝑃 (2𝑘 ) = 𝑘+1 .
2
(b) Compute 𝐸[𝑋].
∞
1 1
Solution: 𝐸[𝑋] = ∑ 2𝑘 = ∑ = ∞. Technically, 𝐸[𝑋] is undefined in this case.
𝑘=0
2𝑘+1 2
(c) Use your answer in part (b) to explain why the stategy is a bad one.
Solution: Technically, 𝐸[𝑋] is undefined in this case. But the value of ∞ tells us what
is wrong with the scheme. Since the average last bet is infinite, I need to have an infinite
amount of money in reserve.
This problem and solution is often referred to as the St. Petersburg paradox
Problem 33. Suppose you roll a fair 6-sided die 100 times (independently), and you get
$3 every time you roll a 6.
Let 𝑋1 be the number of dollars you win on rolls 1 through 25.
Let 𝑋2 be the number of dollars you win on rolls 26 through 50.
Let 𝑋3 be the number of dollars you win on rolls 51 through 75.
Let 𝑋4 be the number of dollars you win on rolls 76 throught 100.
Let 𝑋 = 𝑋1 + 𝑋2 + 𝑋3 + 𝑋4 be the total number of dollars you win over all 100 rolls.
(a) What is the probability mass function of 𝑋?
Practice Exam 1: All Questions, Spring 2022 16
Problem 34. Suppose that 𝑋 ∼ Bin(𝑛, 0.5). Find the probability mass function of 𝑌 = 2𝑋.
Practice Exam 1: All Questions, Spring 2022 17
𝑦 𝑛 1 𝑛
𝑃 (𝑌 = 𝑦) = 𝑃 (𝑋 = )=( )( ) .
2 𝑦/2 2
Problem 35. (a) Suppose that 𝑋 is uniform on [0, 1]. Compute the pdf and cdf of 𝑋.
(b) If 𝑌 = 2𝑋 + 5, compute the pdf and cdf of 𝑌 .
(a) Solution: We have 𝑓𝑋 (𝑥) = 1 for 0 ≤ 𝑥 ≤ 1. The cdf of 𝑋 is
𝑥 𝑥
𝐹𝑋 (𝑥) = ∫ 𝑓𝑋 (𝑡)𝑑𝑡 = ∫ 1𝑑𝑡 = 𝑥.
0 0
(b) Solution: Since 𝑋 is between 0 and 1 we have 𝑌 is between 5 and 7. Now for 5 ≤ 𝑦 ≤ 7,
we have
𝑦−5 𝑦−5 𝑦−5
𝐹𝑌 (𝑦) = 𝑃 (𝑌 ≤ 𝑦) = 𝑃 (2𝑋 + 5 ≤ 𝑦) = 𝑃 (𝑋 ≤ ) = 𝐹𝑋 ( )= .
2 2 2
Differentiating 𝑃 (𝑌 ≤ 𝑦) with respect to 𝑦, we get the probability density function of 𝑌 ,
for 5 ≤ 𝑦 ≤ 7,
1
𝑓𝑌 (𝑦) = .
2
Problem 36. (a) Suppose that 𝑋 has probability density function 𝑓𝑋 (𝑥) = 𝜆e−𝜆𝑥 for
𝑥 ≥ 0. Compute the cdf, 𝐹𝑋 (𝑥).
(b) If 𝑌 = 𝑋 2 , compute the pdf and cdf of 𝑌 .
(a) Solution: We have cdf of 𝑋,
𝑥
𝐹𝑋 (𝑥) = ∫ 𝜆e−𝜆𝑥 𝑑𝑥 = 1 − e−𝜆𝑥 .
0
Problem 37. Suppose that 𝑋 is a random variable that takes on values 0, 2 and 3 with
probabilities 0.3, 0.1, 0.6 respectively. Let 𝑌 = 3(𝑋 − 1)2 .
(a) What is the expectation of 𝑋?
(b) What is the variance of 𝑋?
(c) What is the expection of 𝑌 ?
Practice Exam 1: All Questions, Spring 2022 18
Problem 38. Let 𝑇 be the waiting time for customers in a queue. Suppose that 𝑇 is
exponential with pdf 𝑓(𝑡) = 2e−2𝑡 on [0, ∞).
Find the pdf of the rate at which customers are served 𝑅 = 1/𝑇 .
Solution: The CDF for 𝑇 is
𝑡
𝑡
𝐹𝑇 (𝑡) = 𝑃 (𝑇 ≤ 𝑡) = ∫ 2e−2𝑢 𝑑𝑢 = −e−2𝑢 ∣0 = 1 − e−2𝑡 .
0
Problem 39. A continuous random variable 𝑋 has PDF 𝑓(𝑥) = 𝑥 + 𝑎𝑥2 on [0,1]
Find 𝑎, the CDF and 𝑃 (0.5 < 𝑋 < 1).
Solution: First we find the value of 𝑎:
1 1
1 𝑎
∫ 𝑓(𝑥) 𝑑𝑥 = 1 = ∫ 𝑥 + 𝑎𝑥2 𝑑𝑥 = + ⇒ 𝑎 = 3/2.
0 0 2 3
The CDF is 𝐹𝑋 (𝑥) = 𝑃 (𝑋 ≤ 𝑥). We break this into cases:
(i) 𝑏 < 0, so 𝐹𝑋 (𝑏) = 0.
𝑏 𝑏2 𝑏3
(ii) 0 ≤ 𝑏 ≤ 1, so 𝐹𝑋 (𝑏) = ∫0 𝑥 + 32 𝑥2 𝑑𝑥 = 2 + 2.
(iii) 1 < 𝑥, so 𝐹𝑋 (𝑏) = 1.
Using 𝐹𝑋 we get
0.52 + 0.53 13
𝑃 (0.5 < 𝑋 < 1) = 𝐹𝑋 (1) − 𝐹𝑋 (0.5) = 1 − ( )= .
2 16
Problem 41. Let 𝑋 be a discrete random variable with pmf 𝑝 given by:
𝑥 −2 −1 0 1 2
𝑝(𝑥) 1/15 2/15 3/15 4/15 5/15
𝑃 (𝑌 = 1) = 𝑃 (𝑋 = 1) + 𝑃 (𝑋 = −1).
Values 𝑦 of 𝑌 0 1 4
pmf 𝑝𝑌 (𝑦) 3/15 6/15 6/15
(b) and (c) To distinguish the distribution functions we’ll write 𝐹𝑋 and 𝐹𝑌 .
Using the tables in part (a) and the definition 𝐹𝑋 (𝑎) = 𝑃 (𝑋 ≤ 𝑎) etc. we get
𝑎 -3/2 3/4 7/8 1 1.5 5
𝐹𝑋 (𝑎) 1/15 6/15 6/15 10/15 10/15 1
𝐹𝑌 (𝑎) 0 3/15 3/15 9/15 9/15 1
⎧ 0 for 𝑎<0
{
{ 1 for 0≤𝑎<2
𝐹 (𝑎) = ⎨ 52
{ for 2≤𝑎<4
{ 15 for 𝑎 ≥ 4.
⎩
Determine the pmf of 𝑋.
Solution: The jumps in the distribution function are at 0, 2, 4. The value of 𝑝(𝑎) at a
jump is the height of the jump:
𝑎 0 2 4
𝑝(𝑎) 1/5 1/5 3/5
Problem 43. For each of the following say whether it can be the graph of a cdf. If it can
be, say whether the variable is discrete or continuous.
Practice Exam 1: All Questions, Spring 2022 20
(vii) (viii)
𝐹 (𝑥) 𝐹 (𝑥)
1 1
0.5 0.5
𝑥 𝑥
Solution: (i) yes, discrete, (ii) no, (iii) no, (iv) no, (v) yes, continuous
(vi) no (vii) yes, continuous, (viii) yes, continuous.
𝐹 (𝑥) = 𝑥2 for 0 ≤ 𝑥 ≤ 1.
Problem 45. Let 𝑋 be a random variable with range [0, 1] and cdf
(a) Compute 𝑃 ( 14 ≤ 𝑋 ≤ 34 ).
(b) What is the pdf of 𝑋?
Solution: (a) 𝑃 (1/4 ≤ 𝑋 ≤ 3/4) = 𝐹 (3/4) − 𝐹 (1/4) = 11/16 = 0.6875.
(b) 𝑓(𝑥) = 𝐹 ′ (𝑥) = 4𝑥 − 4𝑥3 in [0,1].
(a) Compute the probability that you have to wait for more than five minutes for the bus
to arrive.
Solution: We compute
5
𝑃 (𝑋 ≥ 5) = 1 − 𝑃 (𝑋 < 5) = 1 − ∫ 𝜆e−𝜆𝑥 𝑑𝑥 = 1 − (1 − e−5𝜆 ) = e−5𝜆 .
0
(b) Suppose that you have already waiting for 10 minutes. Compute the probability that you
have to wait an additional five minutes or more.
Solution: We want 𝑃 (𝑋 ≥ 15|𝑋 ≥ 10). First observe that 𝑃 (𝑋 ≥ 15, 𝑋 ≥ 10) = 𝑃 (𝑋 ≥
15). From similar computations in (a), we know
Problem 47. Normal Distribution: Throughout these problems, let 𝜙 and Φ be the pdf
and cdf, respectively, of the standard normal distribution Suppose 𝑍 is a standard normal
random variable and let 𝑋 = 3𝑍 + 1.
(a) Express 𝑃 (𝑋 ≤ 𝑥) in terms of Φ
Solution: We have
𝑥−1 𝑥−1
𝐹𝑋 (𝑥) = 𝑃 (𝑋 ≤ 𝑥) = 𝑃 (3𝑍 + 1 ≤ 𝑥) = 𝑃 (𝑍 ≤ ) = Φ( ).
3 3
(b) Differentiate the expression from (𝑎) with respect to 𝑥 to get the pdf of 𝑋, 𝑓(𝑥).
Remember that Φ′ (𝑧) = 𝜙(𝑧) and don’t forget the chain rule
Solution: Differentiating with respect to 𝑥, we have
d 1 𝑥−1
𝑓𝑋 (𝑥) = 𝐹𝑋 (𝑥) = 𝜙 ( ).
dx 3 3
1 𝑥2
Since 𝜙(𝑥) = (2𝜋)− 2 e− 2 , we conclude
1 (𝑥−1)2
𝑓𝑋 (𝑥) = √ e− 2⋅32 ,
3 2𝜋
which is the probability density function of the 𝑁 (1, 9) distribution. Note: The arguments
in (a) and (b) give a proof that 3𝑍 +1 is a normal random variable with mean 1 and variance
9. See Problem Set 3, Question 5.
(c) Find 𝑃 (−1 ≤ 𝑋 ≤ 1)
Practice Exam 1: All Questions, Spring 2022 22
Solution: We have
2 2
𝑃 (−1 ≤ 𝑋 ≤ 1) = 𝑃 (− ≤ 𝑍 ≤ 0) = Φ(0) − Φ (− ) ≈ 0.2475
3 3
(d) Recall that the probability that 𝑍 is within one standard deviation of its mean is approx-
imately 68%. What is the probability that 𝑋 is within one standard deviation of its mean?
𝑑 𝑑 1 1 2
𝑓𝑦 (𝑎) = 𝐹𝑌 (𝑎) = Φ(ln(𝑎)) = 𝜙(ln(𝑎)) = √ e−(ln(𝑎)) /2 .
𝑑𝑎 𝑑𝑎 𝑎 2𝜋 𝑎
(b) We don’t have a formula for Φ(𝑧) so we don’t have a formula for quantiles. So we have
to write quantiles in terms of Φ−1 .
(i) Write the 0.33 quantile of 𝑍 in terms of Φ−1
(ii) Write the 0.9 quantile of 𝑌 in terms of Φ−1 .
(iii) Find the median of 𝑌 .
Solution: (i) The 0.33 quantile for 𝑍 is the value 𝑞0.33 such that 𝑃 (𝑍 ≤ 𝑞0.33 ) = 0.33.
That is, we want
Φ(𝑞0.33 ) = 0.33 ⇔ 𝑞0.33 = Φ−1 (0.33) .
(ii) We want to find 𝑞0.9 where
−1
𝐹𝑌 (𝑞0.9 ) = 0.9 ⇔ Φ(ln(𝑞0.9 )) = 0.9 ⇔ 𝑞0.9 = eΦ (0.9)
.
−1
(iii) As in (ii) 𝑞0.5 = eΦ (0.5)
= e0 = 1 .
∞
1 2 ∞ 1 2
𝐸[𝑋𝑗4 ] = √ [ 𝑥3 e−𝑥 /2 ∣ + √ ∫ 3𝑥2 e−𝑥 /2 𝑑𝑥]
2𝜋 𝑖𝑛𝑓𝑡𝑦 2𝜋 −∞
The first term is 0 and the second term is the formula for 3𝐸[𝑋𝑗2 ] = 3 (by part (a)). Thus,
𝐸[𝑋𝑗4 ] = 3.
(c) Deduce from parts (a) and (b) that Var(𝑋𝑗2 ) = 2.
Solution: Var(𝑋𝑗2 ) = 𝐸[𝑋𝑗4 ] − 𝐸[𝑋𝑗2 ]2 = 3 − 1 = 2. QED
(d) Use the Central Limit Theorem to approximate 𝑃 (𝑌100 > 110).
Solution: 𝐸[𝑌100 ] = 𝐸[100𝑋𝑗2 ] = 100. Var(𝑌100 ) = 100Var(𝑋𝑗 ) = 200.
The CLT says 𝑌100 is approximately normal. Standardizing gives
𝑌 − 100 10 √
𝑃 (𝑌100 > 110) = 𝑃 ( 100
√ >√ ) ≈ 𝑃 (𝑍 > 1/ 2) = 0.24 .
200 200
This last value was computed using R: 1 - pnorm(1/sqrt(2),0,1).
𝑏 3 − 𝑎3 (𝑏 + 𝑎)2
Var(𝑋) = 𝐸[𝑋 2 ] − 𝐸[𝑋]2 = −
3(𝑏 − 𝑎) 4
4(𝑏3 − 𝑎3 ) − 3(𝑏 − 𝑎)(𝑏 + 𝑎)2 𝑏3 − 3𝑎𝑏2 + 3𝑎2 𝑏 − 𝑎3 (𝑏 − 𝑎)3 (𝑏 − 𝑎)2
= = = = .
12(𝑏 − 𝑎) 12(𝑏 − 𝑎) 12(𝑏 − 𝑎) 12
Method 2
There is an easier way to find 𝐸[𝑋] and Var(𝑋).
Let 𝑈 ∼ U(𝑎, 𝑏). Then the calculations above show 𝐸[𝑈 ] = 1/2 and (𝐸[𝑈 2 ] = 1/3 ⇒
Var(𝑈 ) = 1/3 − 1/4 = 1/12.
Now, we know 𝑋 = (𝑏 − 𝑎)𝑈 + 𝑎, so 𝐸[𝑋] = (𝑏 − 𝑎)𝐸[𝑈 ] + 𝑎 = (𝑏 − 𝑎)/2 + 𝑎 = (𝑏 + 𝑎)/2
and Var(𝑋) = (𝑏 − 𝑎)2 Var(𝑈 ) = (𝑏 − 𝑎)2 /12.
Problem 54. Compute the median for the exponential distribution with parameter 𝜆.
Solution: The density for this distribution is 𝑓(𝑥) = 𝜆 e−𝜆𝑥 . We know (or can compute)
that the distribution function is 𝐹 (𝑎) = 1 − e−𝜆𝑎 . The median is the value of 𝑎 such that
𝐹 (𝑎) = 0.5. Thus, 1 − e−𝜆𝑎 = 0.5 ⇒ 0.5 = e−𝜆𝑎 ⇒ log(0.5) = −𝜆𝑎 ⇒ 𝑎 = log(2)/𝜆.
𝑌 𝑌
𝑋\ 0 1 𝑋\ 0 1
0 1/4 1/4 0 0,0 1,-1
1 1/4 1/4 1 1,1 2,0
Joint probabilities of 𝑋 and 𝑌 Values of (𝑆, 𝑇 ) corresponding to 𝑋 and 𝑌
We can use the two tables above to write the joint probability table for 𝑆 and 𝑇 . The
marginal probabilities are given in the table.
𝑇
𝑆\ -1 0 1
0 0 1/4 0 1/4
1 1/4 0 1/4 1/2
2 0 1/4 0 1/4
1/4 1/2 1/4 1
Joint and marginal probabilities of 𝑆 and 𝑇
(b) No probabilities in the table are the product of the corresponding marginal probabilities.
(This is easiest to see for the 0 entries.) So, 𝑆 and 𝑇 are not independent
Problem 57. Data is taken on the height and shoe size of a sample of MIT students.
Height is coded by 3 values: 1 (short), 2 (average), 3 (tall) and shoe size is coded by 3
values 1 (small), 2 (average), 3 (large). The joint counts are given in the following table.
Shoe \ Height 1 2 3
1 234 225 84
2 180 453 161
3 39 192 157
Let 𝑋 be the coded shoe size and 𝑌 the height of a random person in the sample.
(a) Find the joint and marginal pmf of 𝑋 and 𝑌 .
(b) Are 𝑋 and 𝑌 independent?
Solution: (a) The joint distribution is found by dividing each entry in the data table by
the total number of people in the sample. Adding up all the entries we get 1725. So the
joint probability table with marginals is
𝑌 \𝑋 1 2 3
234 225 84 543
1 1725 1725 1725 1725
180 453 161 794
2 1725 1725 1725 1725
39 192 157 388
3 1725 1725 1725 1725
Problem 58. Let 𝑋 and 𝑌 be two continuous random variables with joint pdf
2
(Here we skipped showing the arithmetic of the integration) Therefore, 𝑐 = .
243
(b)
2 1
𝑃 (1 ≤ 𝑋 ≤ 2, 0 ≤ 𝑌 ≤ 1) = ∫ ∫ 𝑓(𝑥, 𝑦) 𝑑𝑦 𝑑𝑥
1 0
2 1
= ∫ ∫ 𝑐(𝑥2 𝑦 + 𝑥2 𝑦2 ) 𝑑𝑦 𝑑𝑥
1 0
35
=𝑐⋅
18
70
= ≈ 0.016
4374
9𝑎3 9 𝑎3
𝐹𝑋 (𝑎) = 𝐹 (𝑎, 3) = 𝑐 ( + 3𝑎3 ) = 𝑐 𝑎3 =
6 2 27
(f) Since 𝑓(𝑥, 𝑦) separates into a product as a function of 𝑥 times a function of 𝑦 we know
𝑋 and 𝑌 are independent.
Problem 59. Let 𝑋 and 𝑌 be two random variables and let 𝑟, 𝑠, 𝑡, and 𝑢 be real numbers.
(a) Show that Cov(𝑋 + 𝑠, 𝑌 + 𝑢) = Cov(𝑋, 𝑌 ).
(b) Show that Cov(𝑟𝑋, 𝑡𝑌 ) = 𝑟𝑡Cov(𝑋, 𝑌 ).
(c) Show that Cov(𝑟𝑋 + 𝑠, 𝑡𝑌 + 𝑢) = 𝑟𝑡Cov(𝑋, 𝑌 ).
Solution: (a) First note by linearity of expectation we have 𝐸[𝑋 + 𝑠] = 𝐸[𝑋] + 𝑠, thus
𝑋 + 𝑠 − 𝐸[𝑋 + 𝑠] = 𝑋 − 𝐸[𝑋].
Likewise 𝑌 + 𝑢 − 𝐸[𝑌 + 𝑢] = 𝑌 − 𝐸[𝑌 ].
Now using the definition of covariance we get
(c) This is more of the same. We give the argument with far fewer algebraic details
Problem 60. Derive the formula for the covariance: Cov(𝑋, 𝑌 ) = 𝐸[𝑋𝑌 ] − 𝐸[𝑋]𝐸[𝑌 ].
Solution: Using linearity of expectation, we have
The joint and marginal pmf’s of 𝑋 and 𝑌 are partly given in the following table.
𝑌
𝑋\ 1 2 3
1 1/6 0 … 1/3
2 … 1/4 … 1/3
3 … … 1/4 …
1/6 1/3 … 1
𝑖+𝑗
𝑃 (𝑋 = 𝑖, 𝑌 = 𝑗) =
80
Compute each of the following:
(a) 𝑃 (𝑋 = 𝑌 ).
(b) 𝑃 (𝑋𝑌 = 6).
(c) 𝑃 (1 ≤ 𝑋 ≤ 2, 2 < 𝑌 ≤ 4).
Solution: First we’ll make the table for the joint pmf. Then we’ll be able to answer the
questions by summing up entries in the table.
𝑌
𝑋\ 1 2 3 4
1 2/80 3/80 4/80 5/80
2 3/80 4/80 5/80 6/80
3 4/80 5/80 6/80 7/80
4 5/80 6/80 7/80 8/80
Problem 63. Toss a fair coin 3 times. Let 𝑋 = the number of heads on the first toss, 𝑌
the total number of heads on the last two tosses, and 𝐹 the number of heads on the first two
tosses.
(a) Give the joint probability table for 𝑋 and 𝑌 . Compute Cov(𝑋, 𝑌 ).
Solution: (a) 𝑋 and 𝑌 are independent, so the table is computed from the product of the
known marginal probabilities. Since they are independent, Cov(𝑋, 𝑌 ) = 0.
𝑋
𝑌\ 0 1 𝑃𝑌
0 1/8 1/8 1/4
1 1/4 1/4 1/2
2 1/8 1/8 1/4
𝑃𝑋 1/2 1/2 1
(b) Give the joint probability table for 𝑋 and 𝐹 . Compute Cov(𝑋, 𝐹 ).
Solution: (b) The sample space is Ω = {HHH, HHT, HTH, HTT, THH, THT, TTH,
TTT}.
𝑃 (𝑋 = 0, 𝐹 = 0) = 𝑃 ({𝑇 𝑇 𝐻, 𝑇 𝑇 𝑇 }) = 1/4.
𝑃 (𝑋 = 0, 𝐹 = 1) = 𝑃 ({𝑇 𝐻𝐻, 𝑇 𝐻𝑇 }) = 1/4. 𝑋
𝐹\ 0 1 𝑃𝐹
𝑃 (𝑋 = 0, 𝐹 = 2) = 0. 0 1/4 0 1/4
𝑃 (𝑋 = 1, 𝐹 = 0) = 0. 1 1/4 1/4 1/2
𝑃 (𝑋 = 1, 𝐹 = 1) = 𝑃 ({𝐻𝑇 𝐻, 𝐻𝑇 𝑇 }) = 1/4. 2 0 1/4 1/4
𝑃𝑋 1/2 1/2 1
𝑃 (𝑋 = 1, 𝐹 = 2) = 𝑃 ({𝐻𝐻𝐻, 𝐻𝐻𝑇 }) = 1/4.
𝑋 -2 -1 0 1 2
𝑌
0 0 0 1/5 0 0 1/5
1 0 1/5 0 1/5 0 2/5
4 1/5 0 0 0 1/5 2/5
1/5 1/5 1/5 1/5 1/5 1
Each column has only one nonzero value. For example, when 𝑋 = −2 then 𝑌 = 4, so in
the 𝑋 = −2 column, only 𝑃 (𝑋 = −2, 𝑌 = 4) is not 0.
(b) Find 𝐸[𝑋] and 𝐸[𝑌 ].
Solution: Using the marginal distributions: 𝐸[𝑋] = 15 (−2 − 1 + 0 + 1 + 2) = 0.
1 2 2
𝐸[𝑌 ] = 0 ⋅ + 1 ⋅ + 4 ⋅ = 2.
5 5 5
(c) Show 𝑋 and 𝑌 are not independent.
Solution: We show the probabilities don’t multiply:
𝑃 (𝑋 = −2, 𝑌 = 0) = 0 ≠ 𝑃 (𝑋 = −2) ⋅ 𝑃 (𝑌 = 0) = 1/25.
Since these are not equal 𝑋 and 𝑌 are not independent. (It is obvious that 𝑋 2 is not
independent of 𝑋.)
(d) Show Cov(𝑋, 𝑌 ) = 0.
This is an example of uncorrelated but non-independent random variables. The reason this
can happen is that correlation only measures the linear dependence between the two variables.
In this case, 𝑋 and 𝑌 are not at all linearly related.
Solution: Using the table from part (a) and the means computed in part (d) we get:
𝑥2 𝑦 + 𝑥𝑦2
So 𝐹 (𝑥, 𝑦) = and 𝐹 (1, 1) = 1.
2
Practice Exam 1: All Questions, Spring 2022 32
1
Because the 𝑋𝑖 are independent the only non-zero term in the above sum is Cov(𝑋3 𝑋3 ) = Var(𝑋3 ) =
4
Therefore, Cov(𝑋, 𝑌 ) = 14 .
We get the correlation by dividing by the standard deviations. Since 𝑋 is the sum of 3
independent Bernoulli(0.5) we have 𝜎𝑋 = √3/4
Cov(𝑋, 𝑌 ) 1/4 1
Cor(𝑋, 𝑌 ) = = = .
𝜎𝑋 𝜎𝑌 (3)/4 3
Problem 69. Suppose 𝑋1 , … , 𝑋100 are i.i.d. with mean 1/5 and variance 1/9. Use the
central limit theorem to estimate 𝑃 (∑ 𝑋𝑖 < 30).
Practice Exam 1: All Questions, Spring 2022 34
Solution: Standardize:
∑ 𝑋𝑖 − 𝜇 30 − 𝑛𝜇
𝑃 (∑ 𝑋𝑖 < 30) = 𝑃 ( √ < √ )
𝑖
𝑛𝜎 𝑛𝜎
30 − 20
≈ 𝑃 (𝑍 < ) (by the central limit theorem)
10/3
= 𝑃 (𝑍 < 3)
= 0.9987 (from the table of normal probabilities)
Standardizing we have
𝑇 − 405 369 − 405
𝑃 (𝑇 > 369) = 𝑃 ( > )
18 18
≈ 𝑃 (𝑍 > −2)
≈ 0.975
The value of 0.975 comes from the rule-of-thumb that 𝑃 (|𝑍| < 2) ≈ 0.95. A more exact
value (using R) is 𝑃 (𝑍 > −2) ≈ 0.9772.
Solution: 𝑋 ∼ binomial(100, 1/3) means 𝑋 is the sum of 100 i.i.d. Bernoulli(1/3) random
variables 𝑋𝑖 .
We know 𝐸[𝑋𝑖 ] = 1/3 and Var(𝑋𝑖 ) = (1/3)(2/3) = 2/9. Therefore the central limit theorem
says
𝑋 ≈ N(100/3, 200/9)
Standardization then gives
𝑋 − 100/3 30 − 100/3
𝑃 (𝑋 ≤ 30) = 𝑃 ( ≤ ) ≈ 𝑃 (𝑍 ≤ −0.7071068) ≈ 0.239751
√200/9 √200/9
We used R to do these calculations The approximation agrees with the ‘exact’ number to 2
decimal places.
The problem asks for 𝑃 (𝑋 > 115). Standardizing we get 𝑃 (𝑋 > 115) ≈ 𝑃 (𝑍 > 10).
This is effectively 0.
• For a period of 1 year, each hospital recorded the days on which more than 60% of the
babies born were boys.
(c) Let 𝐿 (resp., 𝑆) be the number of days on which more than 60% of the babies born in
the larger (resp., smaller) hospital were boys. What type of distribution do 𝐿 and 𝑆 have?
Compute the expected value and variance in each case.
(d) Via the CLT, approximate the 0.84 quantile of 𝐿 (resp., 𝑆). Would you like to revise
your answer to part (a)?
(e) What is the correlation of 𝐿 and 𝑆? What is the joint pmf of 𝐿 and 𝑆? Visualize the
region corresponding to the event 𝐿 > 𝑆. Express 𝑃 (𝐿 > 𝑆) as a double sum.
(a) Solution: When this question was asked in a study, the number of undergraduates
who chose each option was 21, 21, and 55, respectively. This shows a lack of intuition for
the relevance of sample size on deviation from the true mean (i.e., variance).
(b) Solution: The random variable 𝑋𝐿 , giving the number of boys born in the larger
hospital on day 𝑖, is governed by a Bin(45, 0.5) distribution. So 𝐿𝑖 has a Ber(𝑝𝐿 ) distribution
with
45
45
𝑝𝐿 = 𝑃 (𝑋 > 27) = ∑ ( ) 0.545 ≈ 0.068
𝑘=28
𝑘
Similarly, the random variable 𝑋𝑆 , giving the number of boys born in the smaller hospital
on day 𝑖, is governed by a Bin(15, 0.5) distribution. So 𝑆𝑖 has a Ber(𝑝𝑆 ) distribution with
15
15
𝑝𝑆 = 𝑃 (𝑋𝑆 > 9) = ∑ ( ) 0.515 ≈ 0.151
𝑘=10
𝑘
365 365
(c) Solution: Note that 𝐿 = ∑𝑖=1 𝐿𝑖 and 𝑆 = ∑𝑖=1 𝑆𝑖 . So 𝐿 has a Bin(365, 𝑝𝐿 ) distribu-
tion and 𝑆 has a Bin(365, 𝑝𝑆 ) distribution. Thus
𝐸[𝐿] = 365𝑝𝐿 ≈ 25
𝐸[𝑆] = 365𝑝𝑆 ≈ 55
Var(𝐿) = 365𝑝𝐿 (1 − 𝑝𝐿 ) ≈ 23
Var(𝑆) = 365𝑝𝑆 (1 − 𝑝𝑆 ) ≈ 47
9 R Problems
R will not be on the exam. However, these problems will help you understand the concepts
we’ve been studying.
Problem 75. R simulation
Consider 𝑋1 , 𝑋2 , …all independent and with distribution N(0, 1). Let 𝑋 𝑚 be the average of
𝑋1 , …𝑋𝑛 .
(a) Give 𝐸[𝑋 𝑛 ] and 𝜎𝑋𝑛 exactly.
Solution: 𝐸[𝑋𝑗 ] = 0 ⇒ 𝐸[𝑋 𝑛 ] = 0.
𝑋1 + … + 𝑋𝑛 1 1
Var(𝑋𝑗 ) = 1 ⇒ Var ( )= ⇒ 𝜎𝑋 𝑛 = √ .
𝑛 𝑛 𝑛
(b) Use a R simulation to estimate 𝐸[𝑋 𝑛 ] and Var(𝑋 𝑛 ) for 𝑛 = 1, 9, 100. (You should use
the rnorm function to simulate 1000 samples of each 𝑋𝑗 .)
Solution: Here’s my R code:
x = rnorm(100*1000,0,1)
data = matrix(x, nrow=100, ncol=1000)
data1 = data[1,]
m1 = mean(data1)
v1 = var(data1)
data9 = colMeans(data[1:9,])
m9 = mean(data9)
v9 = var(data9)
data100 = colMeans(data)
m100 = mean(data100)
v100 = var(data100)
#display the results
print(m1)
print(v1)
print(m9)
print(v9)
print(m100)
print(v100)
∑ 𝑥𝑘 ∑ 𝑥𝑘
Note if 𝑥 = [𝑥1 , 𝑥2 , … , 𝑥𝑛 ] then var(x) actually computes instead of . There is
𝑛−1 𝑛
a good reason for this which we will learn in the statistics part of the class. For now, it’s
enough to note that if 𝑛 = 1000 the using 𝑛 or 𝑛 − 1 won’t make much difference.
data = matrix(a,5,1000)
x = colSums(data[1:3,])
y = colSums(data[3:5,])
print(cov(x,y))
Extra Credit
Compute this covariance exactly.
Solution: Method 1 (Algebra)
First, if 𝑖 ≠ 𝑗 we know 𝑋𝑖 and 𝑋𝑗 are independent, so Cov(𝑋𝑖 , 𝑋𝑗 ) = 0.
Cov(𝑋, 𝑌 ) = Cov(𝑋1 + 𝑋2 + 𝑋3 , 𝑋3 + 𝑋4 + 𝑋5 )
= Cov(𝑋1 , 𝑋3 ) + Cov(𝑋1 , 𝑋4 ) + Cov(𝑋1 , 𝑋5 )
+ Cov(𝑋2 , 𝑋3 ) + Cov(𝑋2 , 𝑋4 ) + Cov(𝑋2 , 𝑋5 )
+ Cov(𝑋3 , 𝑋3 ) + Cov(𝑋3 , 𝑋4 ) + Cov(𝑋3 , 𝑋5 )
(most of these terms are 0)
= Cov(𝑋3 , 𝑋3 )
= Var(𝑋3 )
1
= (known variance of a uniform(0,1) distribution)
12
𝑓(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 , 𝑥5 ) = 1.
Computing directly
1 1 1 1 1
𝐸[𝑋] = 𝐸[𝑋1 + 𝑋2 + 𝑋3 ] = ∫ ∫ ∫ ∫ ∫ (𝑥1 + 𝑥2 + 𝑥3 ) 𝑑𝑥1 𝑑𝑥2 𝑑𝑥3 , 𝑑𝑥4 𝑑𝑥5
0 0 0 0 0
1
first integral = + 𝑥2 + 𝑥 3
2
1 1
second integral = + + 𝑥3 = 1 + 𝑥3
2 2
3
third integral =
2
3
fourth integral =
2
3
fifth integral =
2
So, 𝐸[𝑋] = 3/2, likewise 𝐸[𝑌 ] = 3/2.
1 1 1 1 1
𝐸[𝑋𝑌 ] = ∫ ∫ ∫ ∫ ∫ (𝑥1 + 𝑥2 + 𝑥3 )(𝑥3 + 𝑥4 + 𝑥5 ) 𝑑𝑥1 𝑑𝑥2 𝑑𝑥3 𝑑𝑥4 𝑑𝑥5
0 0 0 0 0
= 7/3.
1
Cov(𝑋, 𝑌 ) = 𝐸[𝑋𝑌 ] − 𝐸[𝑋]𝐸[𝑌 ] = 12 = 0.08333.
MIT OpenCourseWare
https://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.