Prob PDF
Prob PDF
Prob PDF
http://www.spellscroll.com
Bibliography 15
4 CONTENTS
Disclaimer
All the questions (and solutions) presented in this document were originally
collected by the spellscroll.com team from various sources including books,
mailing-lists and online forums, etc. The spellscroll.com team spent signif-
icant amount of time in selecting, editing and formatting these questions
(and solutions), in the hope that our efforts will be of help to people who are
preparing technical interviews. Any comments, suggestions and corrections
are welcome. This document is free to be downloaded, copied and distributed
so long as this disclaimer is clearly reproduced at its beginning. However,
we are NOT responsible for the possible mistakes contained in this
document or any improper use of this document.
6 CONTENTS
Chapter 1
2. Two people take turns to flip a coin, Your opponent starts first, you
second. The game ends when there is a tail followed by a head. The
guy who has the head wins. What’s the probability that you win the
game.
3. Two gamblers, A and B, are playing a coin toss game. A tossed N+1
times, B tossed N times, what’s the probability that A gets more heads
than B?
4. Two people each tosses a fair coin N times. Find the probability that
they get the same number of heads.
5. A and B toss a fair coin, let X be the number of tosses when A get 2
consecutive heads, Y be the number of tosses when B get 3 consecutive
heads, find the probability that X is more than Y.
8. You toss a coin whose probability of heads is p. You stop tossing when
there are two consecutive heads. What is the probability of stopping
at Nth toss and what’s the expected number of total tosses.
9. You flip a fair coin until you get the same face twice in a row. What is
the probability that you stop on an even number of tosses?
11. Toss a coin until the nth Head turns up. Let Y=number of required
tosses, calculate P(Y is even), set p=P(H),q=P(T).
12. Two people toss a dice with n faces in an alternative manner, the game
is over when a face shows up with point lower than the previous toss
and that person loses the game. (a) What is the probability of the first
person losing the game. (b) What’s the expected number of tosses and
what’s the expected maximum point.
13. Toss a fair coin until we get a 5H in a row or 2T in a row. What’s the
probability of getting 5H in a row at the end of the game prior to 2T
in a row?
15. N coins on the floor, every time you randomly pick one, if it is head,
flip it to tail; if it is tail, toss it. after many many times, what is the
ratio btw head vs. tail coins on the floor? (Hint: Markov Chain. Ans:
1/3 vs 2/3)
16. Flip a coin until either HHT or HTT appears. Is one more likely to
appear first? If so, which one and with what probability?
17. The median of waiting time. Let r be a fixed positive integer, and let
W be the waiting time until the r-th head in a sequence of fair coin
tosses. Find a simple formula in terms of r for the median of W, that
is, the least integer w so that P (W > w) ≤ 1/2.
18. Two people flip coins independently. The probability of getting a head
is p. A flips first. What is the probability that A gets two consecutive
heads earlier than B?
http://www.spellscroll.com 9
2. 9 fair coins and 1 special with double head. First I draw a coin and
see the face is a head, what is the conditional probability that the next
one is the special one? (1/11)
4. You have .25 chance to forget an umbrella in a store. You found you
forgot an umbrella after visiting two stores. How much is the chance
you forgot it in the first. (4/7)
5. Three pieces of pizzas, 1 with both sides burned, 1 with 1 side burned,
1 with 0 side burned. Stack them together blindly, you see the top
surface is burned, what is the probability for the other side of the top
pizza being burned? (2/3)
6. You are playing Russian roulette with a six chamber revolver, you load 2
bullets into the revolver in adjacent chambers. You spin the barrel place
the gun to your head and pull the trigger, you don’t shoot yourself. You
now have the option of either spinning the barrel or pulling the trigger
again, which do you take? (1/4 vs 1/3)
1.3 Misc
1. [Order Statistics; Correlation] Let X and Y be two i.i.d uniform
random variables drawn from (0,1). Let A be min(X,Y) and B be
max(X,Y), what’s the correlation between A and B?
2. If X,Y, Z are 3 random variables such that X and Y are 90% correlated,
Y and Z are 80% correlated, what is the minimum correlation that X
and Z could have?
10 1.3. MISC
4. [Election Problem] Two candidates (R and L) are for the 2008 elec-
tion. In the election, voters are in a single line and are going to vote one
by one. After each voter makes the vote, the other voters immediately
knows who he/she voted for. Voters tend to stay with the “winner’s
side”, if at the moment the candidates have x and y votes respective-
ly, the voter will vote R with probability x/(x + y), and vote L with
probability y/(x + y).
Suppose R and L initially have x0 and y0 votes each (x0 and y0 are
far smaller than the total number of voters), and let P be the final
percentage of votes R receives. Question:
• what is E(P )?
• what is the distribution of random variable P ?
5. A man has n keys of which one will open his lock and the others will
not. If he tries the key randomly one at a time, what is the probability
that the lock will be opened on the rth try where 1 ≤ r ≤ n?
• Calculate E[Xi ].
• Calculate E[Xi Xj ], i 6= j.
• Calculate E[Sr ] and V ar[Sr ].
7. My telephone rings 12 times each week, the calls being randomly dis-
tributed among the 7 days. What is the probability that I get at least
one call each day?
11. Given two i.i.d uniform random points x and y on the interval [0,1] ,
what is the average size of the smallest of the three resulting intervals?
15. A bag contains a total of N balls with either blue or red color. If five
balls are randomly chosen from the bag, the probability is precisely 1/2
that all five balls are blue. What’s the smallest value of N for which
this is possible? (Hint: Use different number of blue/red balls to get
to the answer?)
16. There are two neighbors, one of them are having 2 boys and 1 girl
while the other is having 2 boys and 2 girls. Now we wish pick two
children of same gender, then which family should we pick to maximize
our chances ? (same)
18. An airplane has n seats, and all of them have been sold for a particular
flight, with no overbooking. When the last passenger arrives, he finds
that his seat is taken. When he shows his reservation to the passenger
at his seat, that passenger stands up, and goes to her own assigned
seat. If that seat is empty, she seats down, and the seating procedure
is over. If not, she shows her reservation to the person seating at that
seat. That person stands up, and goes to his assigned seat, and so on.
This procedure continues until someone finds his or her assigned seat
empty.
Tom was not the last passenger to board the plane. What is the prob-
ability that he has to move during this procedure.
12 1.3. MISC
19. There are 20 floors in a building. I step into the elevator with 5 other
people. What is the probability that I do not have to press my button?
(i.e. someone else chooses the same floor as me) (ans: (1 − (18/19)5 ))
20. There are 3 ants at 3 corners of a triangle, they randomly start moving
towards another corner. What is the probability that they don’t collide.
(1/4)
21. There are 4 ants on a square, one at each corner. At the same time,
they all set off for a different corner at random. What is the probability
that they don’t collide?
24. An urn contains five balls, one marked WIN and four marked LOSE.
You and another player take turns selecting a ball from the urn, one
at a time. The first person to select the WIN ball is the winner. If
you draw first, find the probability that you will win if the sampling is
done. (a) with replacement. (answer = 5/9); (b) without replacement.
(answer = 3/5)
27. There are 2 Random samples from [0, 1] uniform distribution. What
is the average distance between them.
28. A string, cut it into three parts, what is the probability you can make a
triangle out of the three pieces? If you instead make the second cut on
http://www.spellscroll.com 13
the longest piece, what is then the probability you can make a triangle
out of the pieces?
30. The Broken Bar A bar is broken at random in two places. Find the
average of the smallest,of the middle-sized, and of the largest pieces.
Generalize to n pieces.
32. Random Intervals What’s the probability that one of n¿=2 random
intervals in [0,1] meets every other interval?
33. Let d(A, B) denote the Euclidean distance between two points A and
B. In the Euclidean plane there are given a circle and a square that
are disjoint but have equal areas. Two points C1 and C2 are randomly
chosen in the circle, and two points S1 and S2 are randomly chosen in
the square. Find the probability that d(C1, C2) > d(S1, S2).
34. Suppose you are at a bus stop, waiting for either bus No. 1 or bus No.
2. In other words, either of the buses can take you to your destination.
Furthermore assume that bus No. 1 comes every 12 minutes, and bus
No. 2 comes every 30 minutes. If you come to the bus stop at random
time, what is your expected waiting time for either of the buses? (ans:
5.2m)
14 1.3. MISC
Bibliography