Puzzles


Probability

Jane Stree Real numbers: P1

Puzzle:

Solution

P(>=2) = 1 - [P(==0) + P(==1)]

P(==0) means you didn't get even a single night's full sleep. ie, dog woke you up on 5 days.

P(==1) means you were able to sleep well on one day, but the dog woke you up on the other 4 days.

P(==0) = 5C5 * (2/3)⁵

Number of sleepless nights = 5 days
5 days can be chosen in 5C5 ways

--

P(==1) = 5C4 * (2/3)⁴ * (1/3)

Number of sleepless nights = 4 days
5 days can be chosen in 5C4 ways

Therefore,

P(>=2) = 1 - [P(==0) + P(==1)]
       = 1 - [(2/3)⁵ + 5*(1/3)*(2/3)⁴]
       = 0.54

Info

Generally,

Independent events:

Dependent events:

Independent events and disjoint events are not same

If two events are disjoint, they are dependent unless one of the event is of zero probability.


A coin fip and a die roll simultaneously:

Example:

  P(coin=H ∧ die=1)  
= P(coin=H)* P(die=1)
=    1/2   *  1/6
=    1/12

---

  P(die=3 ∨ die=5)  
= P(die=3)+ (die=5)  
= 1/6     + 1/6
= 1/3

Probability of event union for non-disjoint events:

P(A ∪ B) = P(A) + P(B) - P(A ∩ B)

P(coin=H) and P(die=1) in our example are not disjoint events.

∵ Coin can be head while die shows 1.

  P(coin=H ∨ die=1)  
= P(coin=H) + P(die=1) - P(coin=H ∧ die=1)
= P(coin=H) + P(die=1) - [P(coin=H) * P(die=1)]
=    (1/2)  + (1/6)    -  (1/2)*(1/6)
=        (4/6)         -  (1/12)
=    7/12

Could also be done like: 

  P(coin=H ∨ die=1)  
= 1 - P(¬(coin=H ∨ die=1))
= 1 - P(¬(coin=H) ∧ ¬(die=1))
= 1 - [P(¬(coin=H)) * P(¬(die=1))]
= 1 - [1 - P(coin=H)] * [1 - P(die=1)]
= 1 - [1 - (1/2)] * [1 - (1/6)]
= 1 - [1/2] * [5/6]
= 1 - [5/12]
= 7/12

P(A ∧ ¬A) = 0

Dependent events.

  P(A ∩ ¬A)
= P(A) * P(¬A/A) 
= P(A) * 0
= 0

P(A ∨ ¬A) = 1

Dependent events.

  P(A ∪ ¬A)
= P(A) + P(¬A) - P(A ∩ ¬A)  
= x + (1-x) - 0
= 1

HMMT 2023: Q1

Puzzle:

Four people are playing rock-paper-scissors. They each play one of the three options (rock, paper, or scissors) independently at random, with equal probability of each choice. Compute the probability that someone beats everyone else.


Solution:

    Scissor

  ∧       ∨ 

Stone  <  Paper

Observe that:

P = 4*3 * (1/3 * (1/3)³)
  = 12/81 = 4/27

Related:

Jane Stree Real numbers: P2

Puzzle

Solution

4.1 of Green book: Coin toss game

Puzzle:

Solution:

Combinatronics

Number of trailing zeros in n!

General forumla:

 ∞   │ n │
 Σ   │───│
i=1  │ 5ⁱ│
     └   ┘

Example: 100!

  100/5 + 100/5² + 100/5³ + ....
= 20 + 4
= 24

So, there are 24 trailing zeros in 100!

An easier way: Keep dividing recursively to get the numbers and sum up.

100/5 = 20
 20/5 = 4
  4/5 = 0
      ─────
        24

ie, f(n) = n/5 + f(n/5)

Consider 25!.

25/4 is 5

Likewise 4 consists of two 2s too. But we needn't care in this case, because number of 5s will always be lesser than that of 2s.

See:

Minimum cut

See:

Facts