0% found this document useful (0 votes)
220 views17 pages

First 10 Questions - Probability Stochastic Calc IQs

The document contains 5 probability questions. Question 3 asks for the probability that the sum of the absolute differences between randomly arranged numbers around a circle is minimized. The answer notes that this occurs when the numbers are arranged consecutively with no gaps, which has a probability of 1/9!.

Uploaded by

shubham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
220 views17 pages

First 10 Questions - Probability Stochastic Calc IQs

The document contains 5 probability questions. Question 3 asks for the probability that the sum of the absolute differences between randomly arranged numbers around a circle is minimized. The answer notes that this occurs when the numbers are arranged consecutively with no gaps, which has a probability of 1/9!.

Uploaded by

shubham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

2 CHAPTER 1.

QUESTIONS

1.1 Discrete Probability


1. There are M green apples and N red apples in a
basket. We take apples out randomly one by one
until all the apples left in the basket are red. What
is the probability that at the moment we stop the
basket is empty?

2. A fair coin is tossed n times. What is the expected


product of the number of heads and the number of
tails?

3. If x1 , x2 , . . . , x9 is a random arrangement of numbers


1, 2, P . . ., 9 around a circle, what is the probability
9
that i=1 |xi+1 − xi | is minimized? (Here, x10 =
x1 .)

4. There are 1000 green balls and 3000 red balls in


container A, and 3000 green balls and 1000 red balls
in container B. You take half of the balls from A
at random and transfer them to B. Then you take
one ball from B at random. What is the probability
that this ball is green?

5. A robot performs coin tossing. It is poorly designed,


it produces a lot of sounds, lights, and vapors, and
it takes one hour to toss a coin. Yet in the end,
when the coin finally lands, it somehow has equal
probability of showing heads and tails.
Two scientists, A and B, enjoy observing this robot
and, by analyzing its unusual and faulty behavior,
they became fairly decent at guessing whether the
coin will land heads or tails half an hour before the
coin is released from the robot’s hand. The scien-
tist A has 80% chance of successfully predicting the
outcome, while the scientist B is successful 60% of
the time.
1.1. DISCRETE PROBABILITY 3

The robot started its routine, and the scientist A


predicts the coin will land tails. The scientist B
predicts the coin will land heads. Can you calculate
the probability that the coin will land heads?

6. A player chooses a number k ≤ 52 and the top k


cards are drawn one by one from a properly shuffled
standard deck of 52 cards. The player wins if the
last drawn card is an Ace and if there is exactly one
more Ace among the cards drawn. Which k should
the player choose to maximize the chance of winning
in this game?

7. Let N be a random variable whose values are posi-


tive integers. Prove that

X

E [N ] = P (N > i) .
i=0

8. Each box of cereal contains a coupon. If there are p


kinds of coupons, how many boxes of cereal have to
be bought on average to obtain at least one coupon
of each kind?

9. You roll a fair n-sided die repeatedly and sum the


outcomes. What is the expected number of rolls
until the sum is a multiple of n for the first time?

10. Is it possible to have two non-fair 6-sided dice, with


sides numbered 1 through 6, with a uniform sum
probability?

11. Consider 2n players of equal skill1 playing a game


where the players are paired off against each other
at random. The 2n−1 winners are again paired off
randomly, and so on until a single winner remains.
1
The probability of winning a game between any two players is
1
2 for each player.
Chapter 2

Solutions
2.1 Discrete Probability

Question 1. There are M green apples and N red apples


in a basket. We take apples out randomly one by one
until all the apples left in the basket are red. What is
the probability that at the moment we stop the basket is
empty?

Answer: Let A be the event that at the moment we stop


the basket is empty. Since we must take apples out until
all the green apples are out, the only way we would have
to empty the entire basket in order to take all the green
apples out is if the last apple in the basket is green.
Hence, we can now modify our random experiment in
the following way: Denote the green apples by g1 , g2 ,
. . . , gM and the red apples by r1 , r2 , . . . , rN . Instead of
taking the apples out of the basket randomly one by one
until all the apples left in the basket are red, we will take
the apples out until no apple is left in the basket. The
sample space Ω for our experiment now becomes the set
of all the permutations of the set

S = {g1 , g2 , . . . , gM , r1 , r2 , . . . , rN } .

29
30 CHAPTER 2. SOLUTIONS

The size of Ω is (M + N )!. The probability function P


1
assigns the value (M +N )!
to each of the outcomes.
Note that A is the set of all permutations from Ω whose
last entry is from G = {g1 , g2 , . . . , gM }. The number of
permutations whose last entry is from G is M · (M + N −
1)!, since there are M ways to choose the last entry and
(M + N − 1)! ways to permute the remaining entries.
We conclude that the probability of the event A is

(M + N − 1)! · M M
P (A) = = . (2.1)
(M + N )! M +N

In retrospect, it would have been easier to derive (2.1)


by noticing that, in the modified random experiment, the
last ball in the basket is equally likely to be any of the
balls in S, hence, it is green with probability MM
+N . 

Question 2. A fair coin is tossed n times. What is the


expected product of the number of heads and the number
of tails?

Answer: Let X1 , X2 , . . . , Xn be random variables that


correspond to the individual coin tosses in the following
way: the value of Xi is 1, if the i-th toss is head, and
zero otherwise. Then, the number of heads, Hn , and the
number of tails, Tn , are random variables that can be
expressed in terms of X1 , . . . , Xn as

Hn = X1 + X2 + · · · + Xn , and
Tn = n − (X1 + X2 + · · · + Xn ) .

Using linearity, the expectation of the product Hn Tn of


the number of heads and the number of tails is given by

E [Hn Tn ] = n E [X1 + · · · + Xn ]
ˆ ˜
− E (X1 + · · · + Xn )2 . (2.2)
2.1. DISCRETE PROBABILITY 31

ˆ ˜
Since the coin is fair, E [Xi] = 12 and E Xi2 = 12 for all
i = 1 : n, and, since Xj and Xk are independent for j = k,
1
E [Xj Xk ] = E [Xj ] E [Xk ] = , ∀ 1 ≤ j = k ≤ n.
4
Then,
X
n
n
E [X1 + · · · + Xn ] = E [Xi ] = ; (2.3)
i=1
2

ˆ ˜
E (X1 + · · · + Xn )2
Xn
ˆ ˜ X
= E Xi2 + E [Xj Xk ]
i=1 1≤j=k≤n

1 1
= n· + (n2 − n) ·
2 4
n2 + n
= . (2.4)
4
From (2.2–2.4), we conclude that
n2 n2 + n n2 − n
E [Hn Tn ] = − = . 
2 4 4
Remark. The argument above is very similar to the deriva-
tion of formulas for the expected value and variance of
binomial random variables. If we use these formulas (in-
stead of deriving them), then the solution can be made
a bit shorter. We first need to observe that Hn has a
binomial distribution with parameters n and p = 21 . Its
expected value and variance satisfy the equations E [Hn ] =
np and var(Hn ) = np(1 − p). Therefore
ˆ ˜
E [Hn Tn ] = E [Hn (n − Hn ] = nE [Hn ] − E Hn2
= n2 p − np(1 − p) − n2 p2
` 2 ´
= n − n p(1 − p).
32 CHAPTER 2. SOLUTIONS

Question 3. If x1 , x2 , . . . , x9 is a random arrangement of


P 1, 2, . . ., 9 around a circle, what is the probability
numbers
that 9i=1 |xi+1 − xi | is minimized? (Here, x10 = x1 .)
Answer: We will use the following notations:


x = (x1 , . . . , x9 ) ;
X
9
S (→

x) = |xi+1 − xi| .
i=1

Since the given sum does not change if the numbers are
rotated around the circle, we can assume without any loss
of generality that x1 = 1. Let 1 < k ≤ 9 such that xk = 9.
Using the triangle inequality,1 we obtain that
X
k−1 X
9
S (→

x) = |xi+1 − xi | + |xi+1 − xi |
i=1 i=k
˛ ˛ ˛ ˛
˛k−1 ˛ ˛X ˛
˛X
9
˛ ˛ ˛
≥ ˛ (xi+1 − xi )˛ + ˛ (xi+1 − xi )˛
˛ ˛ ˛ ˛
i=1 i=k
= |xk − x1 | + |x10 − xk |
= |9 − 1| + |1 − 9|
= 18.
P9
The minimal value of S (→ −x) = i=1 |xi+1 − xi | is 18,
which is achieved if and only if
˛k−1 ˛
k−1
X ˛X ˛
˛ ˛
|xi+1 − xi | = ˛ (xi+1 − xi )˛ ;
˛ ˛
i=1 i=1
˛ ˛
X 9 ˛X 9 ˛
˛ ˛
|xi+1 − xi | = ˛ (xi+1 − xi )˛ ,
˛ ˛
i=k i=k

which in turn happens if and only if the sequence (x1 = 1 ,


x2 , . . . , xk = 9) is increasing and the sequence (xk = 9 ,
xk+1 , . . . , x10 = 1) is decreasing.
1
The triangle inequality states that |a| + |b| ≥ |a + b| for any
(real or complex) numbers a and b.
2.1. DISCRETE PROBABILITY 33

Since x1 = 1, there is a total of 8! arrangements of


the numbers 2, 3, . . . , 9 around the circle, all of them
being equally likely. Let G be the set of all arrange-
ments of x1 = 1, x2 , . . . , x9 around the circle that min-
imize
P9 the described sum. The probability |G| that the sum
i=1 |x i+1 − x i | is minimized is equal to 8!
. For each
k ∈ {2, 3, . . . , 9}, let Gk ⊆ G be the set of such arrange-
ments with xk = 9. Once the set of numbers S2,k−1 =
{x2 , . . . , xk−1 } is fixed, the set Sk+1,9 = {xk+1 , . . . ,
x9 } is also fixed. Moreover, the numbers x2 , . . . , xk−1
must form the unique permutation of S2,k−1 in which the
numbers are in increasing order. Similarly, the numbers
xk+1 , . . . , x9 must form the unique permutation of Sk+1,9
in which the numbers are in decreasing order. Therefore,
an arrangement in Gk is uniquely determined by the set
S2,k−1 .
We conclude that |Gk | is equal to the number of ways in
which the elements` of
7
´S2,k−1 can be chosen. The number
of such choices is k−2 . Therefore,
!
X
9 X
9
7
|G| = |Gk | =
k−2
k=2 k=2
! ! !
7 7 7
= + + ··· + = 27 .
0 1 7
P9
Thus, the probability that the sum i=1 |xi+1 − xi | is
minimized is equal to

|G| 27
= . 
8! 8!

Question 4. There are 1000 green balls and 3000 red


balls in container A, and 3000 green balls and 1000 red
balls in container B. You take half of the balls from A at
34 CHAPTER 2. SOLUTIONS

random and transfer them to B. Then you take one ball


from B at random. What is the probability that this ball
is green?

Answer: We need to calculate the probability of the event


G that the selected ball is green. Denote by A the event
that the selected ball was originally from container A and
by AC the event that the selected ball was` originally
´ from
container B. Note that P (A) = 13 and P AC = 23 , since
2000 balls were added from container A to the 4000 balls
in container B.
Conditioned on the event that the selected ball is from
A, the probability of the ball being green is 14 , that is,
P (G|A) = 14 . Conditioned on the event that the selected
C
ball is from A` , the´ probability of the ball being green is
3 C
4 , that is, P G|A = 34 .
We conclude that
“ ” “ ”
P (G) = P (G|A) P (A) + P G|AC P AC
1 1 3 2
= · + ·
4 3 4 3
7
= . 
12

Question 5. A robot performs coin tossing. It is poorly


designed, it produces a lot of sounds, lights, and vapors,
and it takes one hour to toss a coin. Yet in the end, when
the coin finally lands, it somehow has equal probability of
showing heads and tails.
Two scientists, A and B, enjoy observing this robot
and, by analyzing its unusual and faulty behavior, they
became fairly decent at guessing whether the coin will
land heads or tails half an hour before the coin is released
from the robot’s hand. The scientist A has 80% chance of
2.1. DISCRETE PROBABILITY 35

successfully predicting the outcome, while the scientist B


is successful 60% of the time.
The robot started its routine, and the scientist A pre-
dicts the coin will land tails. The scientist B predicts the
coin will land heads. Can you calculate the probability
that the coin will land heads?
Answer: The correct answer to this problem is “No, I can-
not.” We will build two probability spaces that satisfy the
conditions of the problem, but have different probabilities
of heads when conditioned on the described event.
Denote by E the event that A predicts T and B pre-
dicts H, and by LH the event that the coin lands heads.
We will build two probability spaces (Ω1 , P1 ) and (Ω2 , P2 ),
such that
P1 ( LH | E) = P2 ( LH | E) .
First, we consider the following sample space
Ω1 = {HA1 B1 , T A1 B1 , T A1 B0 , T A0 B0 } ,
where the outcomes are sequences of three symbols with
the following meanings:
• The first symbol is H or T , representing whether the
coin lands heads or tails;
• The second symbol is either A1 or A0 ; A1 implying that
A makes the correct prediction, and A0 implying that A
makes the wrong prediction;
• The third symbol is either B1 or B0 , with meanings
analogous to those of A1 and A0 , respectively.
For example, an outcome T A1 B0 means that the coin
lands tails, the scientist A makes the correct prediction,
and the scientist B makes the wrong prediction.
The probability function P1 is defined as
P1 (HA1 B1 ) = 0.5, P1 (T A1 B1 ) = 0.1,
P1 (T A1 B0 ) = 0.2, P1 (T A0 B0 ) = 0.2.
36 CHAPTER 2. SOLUTIONS

Note that, with Ω1 as the sample space, we have E =


{T A1 B0 } and LH ∩ E = ∅, which implies that

P1 ( LH | E) = 0.

We now build another pair (Ω2 , P2 ) of a sample space


and a probability measure for which the conditional prob-
ability P2 ( LH | E) is equal to 1. The sample space Ω2 is
defined as

Ω2 = {HA1 B0 , HA0 B1 , HA0 B0 , T A1 B1 } .

The probability function P2 is defined as

P2 (HA1B0 ) = 0.3, P2 (HA0B1 ) = 0.1,


P2 (HA0B0 ) = 0.1, P2 (T A1 B1 ) = 0.5.

The events E and LH ∩ E, as subsets of Ω2 , contain a


single outcome, HA0 B1 . Thus,

P2 ( LH | E) = 1. 

Question 6. A player chooses a number k ≤ 52 and the


top k cards are drawn one by one from a properly shuffled
standard deck of 52 cards. The player wins if the last
drawn card is an Ace and if there is exactly one more Ace
among the cards drawn. Which k should the player choose
to maximize the chance of winning in this game?

Answer: Denote by Wk the event that the k-th card is


an Ace and that one more card is an Ace among the first
k − 1 cards. Note that k ≤ 50 since there must be at least
two cards (Aces) left after the top 50 cards are drawn. We
need to find 1 ≤ k ≤ 50 such that P(Wk ) is maximized.
Let Nk be the number of ways in which the deck can be
shuffled to have one Ace in the k-th position, one Ace in
2.1. DISCRETE PROBABILITY 37

a position from the set {1, 2, . . . , k − 1}, and two Aces in


positions from the set {k + 1, . . . , 52}. Then,

Nk
P (Wk ) = . (2.5)
52!
Denote by Mk the number of ways in which we can choose
the positions for four Aces. For each choice of positions for
the four Aces, the Aces can be placed in those positions
in 4! ways, while the other cards can be placed in the
remaining positions in 48! ways. Therefore,

Nk = 4! · 48! · Mk . (2.6)

To calculate Mk , note that: the k-th position must be


chosen; one position is in {1, 2, . . . , k − 1} and can be
chosen in k − 1 ways; the other two positions
` ´ are in {k + 1,
k + 2, . . . , 52} and can be chosen in 52−k
2 ways. Thus,
!
52 − k
Mk = (k − 1) ·
2
(k − 1)(52 − k)(51 − k)
= . (2.7)
2
From (2.5–2.7), it follows that the probability of winning,
when choosing k, is

4! · 48! (k − 1)(52 − k)(51 − k)


P (Wk ) = ·
52! 2
12(k − 1)(52 − k)(51 − k)
=
52 · 51 · 50 · 49.
The maximum value of P (Wk ) is obtained for the value
of k that maximizes the function

f (k) = (k − 1)(52 − k)(51 − k)


= (k − 1) · [51 − (k − 1)] · [50 − (k − 1)] .
38 CHAPTER 2. SOLUTIONS

Let z = k − 1, M = 51, and

g(z) = z(51 − z)(50 − z).

Since f (k) = g(k − 1), the maximum of f is attained at


k = z + 1, where 0 ≤ z ≤ 49 is the integer for which
the function g is the largest; recall that 1 ≤ k ≤ 50. The
derivative of g(z) is

g (z) = 3z 2 − 2(2M − 1)z + M (M − 1)

and the solutions of the equation g (z) = 0 are



2M − 1 ± M 2 − M + 1
z1,2 = .
3
Since (M − 1)2 < M 2 − M + 1 < M 2 , we find that
„ «
M −1 M
z1 ∈ , = (16.67, 17) ,
3 3
„ «
2 1
z2 ∈ M − , M − = (50.33, 50.67) .
3 3

The quadratic function g (z) is negative on the interval


(z1 , z2 ) and positive everywhere else. This implies that
g is increasing on (−∞, z1 ), decreasing on (z1 , z2 ), and
increasing on (z2 , +∞). Hence, the value 0 ≤ z ≤ 49
where g attains its maximum is either z1  = 16 or z1  =
17. In other words, z ∈ {16, 17}, which corresponds to
k ∈ {17, 18}. Since f (17) = 19040 and f (18) = 19072,
we conclude that it is optimal to choose is k = 18. 

Question 7. Let N be a random variable whose values


are positive integers. Prove that

X

E [N ] = P (N > i) .
i=0
2.1. DISCRETE PROBABILITY 39

Answer: By definition,

X

E [N ] = i · P [N = i] . (2.8)
i=1

We replace the term i · P [N = i] in (2.8) with i terms,


each being equal to P [N = i]. With this modification, the
formula (2.8) becomes

E [N ]
= P [N = 1]
+ P [N = 2] + P [N = 2]
+ P [N = 3] + P [N = 3] + P [N = 3]
.. .. .. ..
. . . .

Note that the sum of the probabilities in the first column


of the expression above is equal to P [N > 0]. Similarly,
the sum of the probabilities in the second column is equal
to P [N > 1], and so on. Thus,

E [N ] = P [N > 0] + P [N > 1] + P [N > 2] + . . . ,

and therefore we conclude that


X

E [N ] = P (N > i) .  (2.9)
i=0

Question 8. Each box of cereal contains a coupon. If


there are p kinds of coupons, how many boxes of cereal
have to be bought on average to obtain at least one coupon
of each kind?

Answer: This is a well-known coupon collector problem.


Denote by N the random variable representing the num-
ber of boxes of cereal that have to be bought to obtain
all p different coupons. For 1 ≤ k ≤ p, denote by Nk
40 CHAPTER 2. SOLUTIONS

the number of boxes that are bought from the time when
k−1 different coupons were collected until the time when k
different coupons have been collected. Note that N1 = 1,
since the first coupon is obtained by buying the first box.
Then,
Xp
N = Nk . (2.10)
k=1

Since Nk has positive integer values, we can use (2.9) to


obtain that
X

E [Nk ] = P (Nk > i) . (2.11)
i=0

The event Nk > i occurs if and only if in each of the i


boxes, that were bought after k − 1 different coupons were
collected, we only find one of the k − 1 kinds of coupons
already collected. Thus,
„ «i
k−1
P (Nk > i) = , ∀ i ≥ 0. (2.12)
p
From (2.11) and (2.12), it follows that,
X∞ „ «i
k−1 1
E [Nk ] = = k−1
i=0
p 1 − p
p
= , ∀ 1 ≤ k ≤ p. (2.13)
p+1−k
From (2.10) and (2.13), we obtain that
p p
X X p
E [N ] = E [Nk ] =
p+1−k
k=1 k=1
p
X1
= p , (2.14)
j=1
j

where, for the last equality, we used the substitution j =


p + 1 − k.
2.1. DISCRETE PROBABILITY 41

For large values of p, an estimate for (2.14) can be


provided by recalling that

X
n
1 1
≈ ln n + γ + ,
j=1
j 2n

as n → ∞, where γ ≈ 0.5772 is the Euler constant. Thus,

1
E [N ] ≈ p ln p + 0.5772p + .  (2.15)
2

Remark. A popular interview question asks for the ex-


pected number of rolls of a standard die until each of the
numbers appears at least once. Note that this problem
is a special case of the coupon collector problem, as each
roll of a die corresponds to opening a box (of cereal) con-
taining a coupon from the set {1, 2, . . . , 6}.
In particular, here p = 6, and (2.14) becomes
„ «
1 1
E [N ] = 6 1 + + · · · + = 14.70.
2 6

We conclude that the die has to be rolled on average 14.70


times for each number to appear at least once.
Also, note that (2.15) is a very robust approximation:
for p = 6, the approximate value given by (2.15) is 14.71,
while the exact value is 14.70.

Question 9. You roll a fair n-sided die repeatedly and


sum the outcomes. What is the expected number of rolls
until the sum is a multiple of n for the first time?

Answer: Denote by N the number of rolls until the sum


is a multiple of n for the first time. Let Xi be the number
rolled on the i-th roll and let Sk = X1 + . . . + Xk be the
sum of the numbers obtained in rolls 1 through k.
42 CHAPTER 2. SOLUTIONS

Fix k ≥ 1. If Sk is not a multiple of n, then Sk ≡


i (mod n) for some i with 1 ≤ i ≤ n − 1, and Sk+1 =
Sk + Xk+1 is a multiple on n only if Xk+1 = n − i. In
other words, there is only one number you can roll in the
next roll that would make Sk+1 a multiple of n. Hence,
1
P (n  Sk+1 | n  Sk ) = 1 − .
n
We also have
1
P (n  S1 ) = P (n  X1 ) = 1 − .
n
Therefore,

Y
i−1
P (N > i) = P (n  S1 ) · P (n  Sk+1 | n  Sk )
k=1
„ «i
1
= 1− . (2.16)
n

Since N has positive integer values, we can use (2.9) and


(2.16) to obtain that

X

E [N ] = P (N > i)
i=0
X∞ „ «i
1
= 1−
i=0
n
1
= ` ´
1 − 1 − n1
= n. 

Question 10. Is it possible to have two non-fair 6-sided


dice, with sides numbered 1 through 6, with a uniform
sum probability?
2.1. DISCRETE PROBABILITY 43

Answer: It is not possible to construct two dice with


those properties. We will show this by contradiction: as-
sume that probabilities pi,j exist, with i ∈ {1, 2}, j ∈
{1, 2, . . . , 6}, where pi,j denotes the probability of rolling
j with the i-th dice. Denote by Σ the sum of the num-
bers obtained in a single roll of these two dice. Then, the
assumption of the uniform sum probability implies that
1
P (Σ = 2) = p1,1 p2,1 = ; (2.17)
11
1
P (Σ = 12) = p1,6 p2,6 = . (2.18)
11
By using the arithmetic – geometric means inequality,
(2.17), and (2.18), we obtain that

P (Σ = 7) ≥ p1,6 p2,1 + p1,1 p2,6



≥ 2 p1,6 p2,1 p1,1 p2,6
2
= .
11
1
Thus, P (Σ = 7) = 11 , which contradicts the assumption
of the uniform sum probability. 

Question 11. Consider 2n players of equal skill2 play-


ing a game where the players are paired off against each
other at random. The 2n−1 winners are again paired off
randomly, and so on until a single winner remains. Find
the probability that two contestants never play each other.

Answer: Denote the contestants by C1 , C2 , . . . , C2n . Let


Ti,j be the event that Ci and Cj play each other in the
tournament, where 1 ≤ i < j ≤ 2n . Due to symmetry, all
of these events have equal probabilities. Hence, we can
assume that our two contestants in question are A = C1
2
The probability of winning a game between any two players is
1
2 for each player.

You might also like