SI 140. Probability and Statistics, Spring 2017 HW 3 Solution
SI 140. Probability and Statistics, Spring 2017 HW 3 Solution
Problem 1 Solution
Now the Shanghaitech would choose 4 students from 10 candidates to do volunteer work abroad.
Every student would be sent to one of four different places. Now, we know that, student Chang
do not want to go to North Korea, and student Chen do not want to go to Somalia. How many
kind of different arrangement can Miss Hu make?
8
1)If Chen and Chang both don’t attend, then there will be 4× 4! kind of arrangement
2)If Chen attend but Chang don’t, then Chen has 3 place to arrange and 83 ×3! for left 3 students.
Problem 2 Solution
There is a board like figure 1 and you should color the six areas of the board. You should color
one area with only one color, and the neighbor areas should have different colors. You have 4 kind
of color to use, and how many kind of different color scheme can you get?
So there will be 108 + 432 + 192 = 732 kind of different color scheme.
Problem 3 Solution
Assume that there is a square which is divided to n × n piece of small squares. Then how many
squares made of one or some small squares can you find, which have different side length or location?
2
The number of squares whose side length is k is (n − k + 1) . So there will be totally N =
Pn 2 1
k=1 (n − k + 1) = 6 n (n + 1) (2n + 1) different small squares.
1
Figure 1:
Problem 4 Solution
Now Mr. Geng and Mr. Wang want to have a basketball-shooting game. Assume that the hit
rate of Mr. Geng is 0.6, and Mr. Wang 0.7. They both shoot for 3 times.
(1) Calculate the probability that they got the same score.
(2) Calculate the probability that Mr. Geng got a higher point.
(1)
We use X to denote the score Mr. Geng got, and Y for Mr. Wang.
3
X 3
X
P {X = Y } = P {(X = i) ∩ (Y = i)} = P {X = i} P {Y = i}
i=0 i=0
3 33 2 3 2
= (1 − 0.6) (1 − 0.7) + 0.6 (1 − 0.6) 0.7 (1 − 0.7)
1 1 (1)
3 2 3
+ 0.6 (1 − 0.6) 0.72 (1 − 0.7) + 0.63 × 0.73
2 2
= 0.321
(2)
T S T S T
{X > Y } = {(X = 1) (Y = 0)} {(X = 2) (Y ≤ 1)} {(X = 3) (Y ≤ 2)}
2
Then we could get:
n \ o n \ o
P {X > Y } = P (X = 1) (Y = 0) + P (X = 2) (Y ≤ 1) +
n \ o
P (X = 3) (Y ≤ 2)
= P {X = 1} P {Y = 0} + P {X = 2} P {Y ≤ 1} + P {X = 3} P {Y ≤ 2}
= P {X = 1} P {Y = 0} + P {X = 2} [P {Y = 0} + P {Y = 1}]
+ P {X = 3} [1 − P {Y = 3}] (2)
3 2 3 3
= 0.6 (1 − 0.6) (1 − 0.7) + 0.62 (1 − 0.6)
1 2
3 3 2
0.7 (1 − 0.7) + 0.63 1 − 0.73
× (1 − 0.7) +
1
= 0.243
Problem 5 Solution
An urn contains n white and m black balls, where n and m are positive numbers.
(1)If two balls are randomly withdrawn, what is the possibility that they are the same colour?
(2)If a ball is randomly withdrawn and then replaced before the second one is drawn what is
the probability that the withdrawn balls are the same colour?
n m
2 2 n2 + m 2 − n − m
(1)p = n+m = .
2
(n + m)(n + m − 1)
2 2
n2 + m2
n m
(2) p = + = .
n+m n+m (n + m)2
Problem 6 Solution
How many number of distinct positive integer-valued vectors (x1 , x2 , ..., x5 ) satisfying the equa-
tion and inequalities:
x1 + x2 + ... + x5 = 40
y1 , y2 , ..., y5 > 0
The problem is equivalent to the following problem: How many ways are there to put 25
indistinguishable balls into 5 distinguishable boxes, and each box has at least one ball?
We can line up the 25 balls, between each adjacent two balls, there is a slot. Thus there are totally
24 slots.We put walls into these slots, so that the balls can be divided into 5 groups. Each group
corresponds to a 24 box. Thus, we should put 4 walls into 24 slots. There are 24
4 = 10626 ways
to put walls. Thus the number of distinct positive integer-valued vectors 10626.
3
Problem 7 Solution
Alvins database of friends contains n entries, but due to a software bug, the addresses correspond
to the names in a totally random fashion. Alvin writes a holiday card to each of his friends and
sends it to the (software-corrupted) address. What is the probability that exactly k(0 < k < n)
friends of him will get the correct card?
n
First, we pick k friends who will get the correct card from the n friends, there are k different
choices. Other n − k friends get wrong cards. We make some denotations first:
C = ”the k chosen friends all get the correct card from the n cards”
W = ”the other n − k unchosen friends all get the wrong card from the rest n − k cards”. Then
n n
pn = P (C, W ) = P (W |C)P (C)
k k
P (W |C) = 1 − P (W c |C)
= 1 − P (”at least one of the n − k unchosen f riends get the correct (3)
card f rom the rest n − k cards”|C)
Then:
n−k
[ X X
P (W c |C) = P ( Ai |C) = P (Ai )|C) − P (Ai ∩ Aj |C)
i=1 16i≤n−k 1≤i≤j≤n−k
X
+ P (Ai ∩ Aj ∩ Ap |C) − ... + (−1)n−k+1 P (A1 ∩ ... ∩ An−k |C)
16i≤j≤p≤n−k
(4)
n−k n−k
= (n − k)P (A1 |C) − P (A1 ∩ A2 |C) + P (A1 ∩ A2 ∩ A3 |C) − ...
2 3
n−k
\
+ (−1)n−k+1 P ( Ai |C)
i=1
since:
1
P (A1 |C) =
n−k
(n − k − 2)! 1
P (A1 ∩ A2 |C) = =
(n − k)! ((n − k)(n − k − 1)
(n − k − 3)! 1 (5)
P (A1 ∩ A2 ∩ A3 |C) = =
(n − k)! ((n − k)(n − k − 1)(n − k − 2)
...
1
P (∩n−k
i=1 Ai |C) =
(n − k)!
we get:
1 1 1
P (W c |C) = 1 − + − · · · + (−1)n−k+1
2! 3! (n − k)!
1 1 1
P (W |C) = − + · · · + (−1)n−k
2! 3! (n − k)!
Then, we compute P (C): Number the k chosen friends as 1, 2, ..., k. Denote Ci = ”friend i get the
4
correct card from the n cards”, then
1 1 1 1
pn = ( − + ... + (−1)n−k ) (7)
k! 2! 3! (n − k)!
Problem 8 Solution
At a movie theater, there is a line (queue) for buying the ticket. A manager announces that
she will give a free ticket to the first person in line whose birthday is the same as someone who
has already bought ticket. Now You are a VIP of this theater, and you are given the opportunity
to choose any position in line. Assuming that you do not know anyone elses birthday and all
birthdays are distributed randomly throughout the year (365 days in a year), which position in
line gives you the largest chance of getting the free ticket?
We first compute the probability of the event that the kth person in the line get the free ticket.
If the kth person in the line get the free ticket, the first k − 1 people in the line must have totally
different birthdays,and the kth person just has the same birthday with one of the first k − 1 people
in the line. We denote some notations:
Dk−1 = ”the first k − 1 people in the line have totally different birthdays”
Si = ”the kth person has the same birthday with the ith person in the line”, 1 ≤ i ≤ k − 1
k−1
X
pk = P (Si |Dk−1 )P (Dk−1 )
i=1
since
1
P (Si |Dk−1 ) = ∀1 ≤ i ≤ k − 1
365
365 · 364 . . . (365 − k + 2) 364 . . . (365 − k + 2)
P (Dk−1 ) = k−1
=
365 365k−2
we get
1 364 . . . (365 − k + 2) 364 . . . (365 − k + 2)
pk = (k − 1) · = (k − 1)
365 365k−2 365k−1
5
To find the maximal pk , we compute
pk+1 k(366 − k)
= > 1 ⇒ k < 19.6
pk 365(k − 1)
thus (
pk+1 > pk , k ≤ 19
pk+1 < pk , k ≥ 20
then we can conclude that p20 = max qk (k ≥ 1), that is, we should choose the 20th position of the
line.
Problem 9 Solution
Alice attends a small college in which each class meets only once a week. She is deciding be-
tween 30 non-overlapping classes. There are 6 classes to choose from for each day of the week,
Monday through Friday. Trusting in the benevolence of randomness, Alice decides to register for
7 randomly selected classes out of the 30, with all choices equally likely. What is the probability
that she will have classes every day, Monday through Friday?
There are two general ways that Alice can have class everyday: either she has 2 days with 2
classes and 3 days with 1 class, or she has 1 day with 3 classes, and has 1 class on each of the
2
other 4 days. The number of possibilities for the former is 52 62 63 (choose the 2 days when she
has 2 classes, and then select 2 classes on those days and 1 class for the other days). The number
of possibilities for the latter is 51 63 64 . So the probability is:
5
6 2 5
6
2 2 63 + 1 3 64 114
30
= ≈ 0.302
7
377
Problem 10 Solution
How many 6-word sentenses can be made using each of the 26 letters of the alphabet exactly
once? A word is defined as a nonempty(possibly jibberish) sequence of letters.
First we ignore spaces between words, then 26 letters can form 26! distinct sentences. Then
25
for each sentence without spaces, among 25 positions that 5 spaces may lie in, we have ways
5
25
to arrange. So the total number of demanding sentences are 26!.
5