Skip to main content

Probability Puzzles 1

· 4 min read
Hinny Tsang
Data Scientist @ Pollock Asset Management

Below are some probability puzzles.

  1. There are 6 players, numbered 1 to 6. Player 1 rolls a die. If Player 1 rolls a 1, he wins and the game ends.

    If Player 1 rolls any other number, the die is passed to the player corresponding to the rolled number, and the game continues with that player rolling. The game ends when a player rolls their own number.

    Solution
    p=16+561p5p = \frac{1}{6} + \frac{5}{6} \frac{1 - p}{5}
  2. A line of 100 airline passengers is waiting to board a plane. They each hold a ticket to one of the 100 seats on that flight. For convenience, let's say that the n th passenger in line has a ticket for seat number 'n'. Being drunk, the first person in line picks a random seat (equally likely for each seat). All of the other passengers are sober, and will go to their assigned seats unless it is already occupied; If it is occupied, they will then find a free seat to sit in, at random. What is the probability that the last (100th) person to board the plane will sit in their own seat (#100)?

    Solution
    p=1/100+99/100(1/99+98/99(1/98+))p = 1 / 100 + 99 / 100 * (1 / 99 + 98 / 99 * (1 / 98 + \cdots )) p=1/100+1/100+98/100(1/98+97/)p = 1 / 100 + 1 / 100 + 98 / 100 * (1 / 98 + 97 / \cdots) p=1/100+1/100++1/100p = 1 / 100 + 1 / 100 + \cdots + 1 / 100 p=1/100+1/100++1/100p = 1 / 100 + 1 / 100 + \cdots + 1 / 100 p=1/2p = 1 / 2
  3. Expected number of flip to get 2 heads in a row.

    Solution

    The answer is simple, let say the expected number is xx.

    1. If we first flip the first tail, we need x+1x + 1 flips to get two heads, with prob = 12\frac{1}{2}.

    2. If we first flip the first head (p=12p=\frac{1}{2}):

      1. 1/21/2 probability to get a head. Than the total number of flips is 22.

      2. 1/21/2 probability to get a tail. Than the total number of flips is x+2x + 2 as we already wasted two flips.

    x=12(x+1)+12(122+12(x+2))x = \frac{1}{2} (x + 1) + \frac{1}{2} \left( \frac{1}{2} \cdot 2 + \frac{1}{2} (x + 2) \right)

    Hance, x=6x = 6.

  4. Generalie to question 3, what if nn heads in a row?

    Solution

    Inspired by reference 2.

    Denot EnE_n as the expected number of flips to get nn heads in a row.

    When we need to get 1 more head from En1E_{n-1}, we have two cases:

    1. We flip a head then we need 11 more flips.

    2. We flip a tail then we need En+1E_n + 1 more flips (One for the current useless flip)

    En=12(En1+1)+12(En1+En+1)E_n = \frac{1}{2} (E_{n - 1} + 1) + \frac{1}{2} (E_{n - 1} + E_n + 1)

    Rearranging gives:

    En=2En1+2E_n = 2 E_{n - 1} + 2

    Let f(n)=En+2f(n) = E_n + 2, we have 2f(n1)=2En1+4=f(n)2 f(n - 1) = 2 E_{n - 1} + 4 = f(n). Hance

    f(n)=2n+1f(n) = 2^{n + 1}

    and

    En=2n+12E_n = 2^{n + 1} - 2
  5. Expected number of steps for a drunk man to reach one end of the bridge.

    Question from A Practical Guide to Quantitative Finance Interviews.

    The drunk man initially stands as pp-th meter of a 100m long bridge, and it have 1/2 probability to move 1 meter left or right. What is the expected number of steps for him to reach either end of the bridge?

    Solution

    Observed that

    E(Sn)=1/2(E(Sn1)+1)+1/2(E(Sn+1)1)=E(Sn1)=0E(S_n) = 1 / 2 (E(S_{n - 1}) + 1) + 1 / 2 (E(S_{n + 1}) - 1) = E(S_{n - 1}) = 0

    Hence it is a martingale, and we can use the optional stopping theorem.

    Let EnE_n be the expected number of steps to reach either end of the bridge from nn-th meter, let PpP_p be the probability of reaching the left end first.

    E(Sn)=Pp(p)+(1Pp)(100p)=0E(S_n) = P_p (p) + (1 - P_p) (100 - p) = 0

    Rearranging gives:

    Pp=100p100P_p = \frac{100 - p}{100}

    Using another martingale

    E(Sn2n)=0E(S_n ^ 2 - n) = 0

    gives

    Pp(p2)+(1Pp)((100p)2)n=0P_p (p^2) + (1 - P_p) ((100 - p)^2) - n = 0

    Rearranging gives:

    n=Ppp2+(1Pp)(100p)2n = P_p p^2 + (1 - P_p) (100 - p)^2

References

  1. CodeChef - Mathematical Expectation

  2. Math Stack Exchange - Probability Puzzles