Home/Study Plan/Classic Probability Brainteasers
๐Ÿง 

Brainteasers & Logic

Classic Probability Brainteasers

Medium4โ€“5 hrsAntsGeometric ProbabilitySecretary ProblemRandom WalksOptimal Stopping

Overview

These puzzles each contain a single elegant insight that makes a seemingly hard problem easy. The ants puzzle: 'pass through' trick makes interacting particles independent. The broken stick: translate probability into geometry. The secretary problem: the optimal threshold 1/e appears because the derivative of the success probability equals zero there. Finding the insight is the skill โ€” once you have it, the math is straightforward.

How to Recognize

  • โ†’Ants walking on a stick โ€” 'when do they all fall off?'
  • โ†’Random points on a line, circle, or square
  • โ†’Optimal stopping: 'when should you stop searching?'
  • โ†’'Two random chords / two random points' geometric probability

Step-by-Step Approach

  1. 1.Ants: use the pass-through trick โ€” treat collisions as pass-throughs, compute independently
  2. 2.Geometric probability: P(event) = favorable area (or length) / total area (or length)
  3. 3.Secretary problem: skip first 1/e โ‰ˆ 37% of options, take next that beats all seen
  4. 4.Random chord: must specify the probability model โ€” the question is often ambiguous

Key Formulas

01Ants on stick length L: last ant falls at time โ‰ค L (max distance any ant must travel)
02Broken stick triangle: P=1/4P = 1/4 (all three pieces < half the total length)
03Secretary problem: optimal skip = n/en/e; success probability โ†’1/eโ‰ˆ36.8%\to 1/e \approx 36.8\%
04Two friends meeting: P(โˆฃXโˆ’Yโˆฃโ‰คw)=1โˆ’(1โˆ’w/T)2P(|X-Y| \leq w) = 1 - (1-w/T)^2 (both Uniform[0,T], wait ww)

Worked Examples

0Quick Example
Broken stick into 3 pieces: P(forms a triangle) = 1/4. Need all pieces < 1/2. Geometric proof: favorable region is 1/4 of the unit square.

Problem

100 ants are placed on a 1-meter stick, each moving at 1 m/min left or right. When two ants collide, they reverse directions. When an ant reaches an end, it falls off. What is the maximum time until all ants have fallen off?

Solution

1

Key trick: two ants colliding and reversing is IDENTICAL to two ants passing through each other (from outside the system, the 'swarms' move identically).

2

So pretend all ants pass through each other. Now each ant is independent โ€” it just walks until it reaches its end.

3

The time for one ant to fall off = distance to the nearer end (in the direction it's walking).

4

Maximum time: the ant with the largest distance to its end in its walking direction. This is at most 1 meter (the full stick length), achieved by an ant at one end walking toward the other end.

5

Therefore: ALL ants fall off in at most 1 minute, regardless of positions and directions.

Answer

Maximum 1 minute. The trick: collisions look like pass-throughs from outside โ†’ each ant independently reaches its end โ‰ค 1 min away.

Common Mistakes

  • !

    Ants: trying to track which ant is which after collisions. The trick makes this unnecessary โ€” positions of collisions are the same as if ants pass through.

  • !

    Broken stick: checking only two triangle inequalities instead of all three (each piece < 1/2 is a sufficient combined condition).

  • !

    Meeting problem: forgetting both directions (X meets Y if X arrives while Y is there OR Y arrives while X is there) โ€” the |Xโˆ’Y| โ‰ค 15 condition captures both.

Practice Problems

Click "Show Answer" to reveal
1

A point is chosen uniformly inside a unit circle. What is P(it is closer to the center than to the boundary)?

Hint: The point is closer to the center iff its distance from center < radius/2.
2

Two numbers are chosen independently and uniformly from [0,1]. What is the probability that their sum is less than 1 and their product is less than 2/9?

Hint: Draw the unit square. First condition: below the line x+y=1. Second: inside the hyperbola xy=2/9.
3

A secretary problem with 10 candidates: optimal strategy? What is the exact probability of success?

Hint: Optimal threshold r = floor(10/e) โ‰ˆ 3 or 4. Success probability = sum formula.

Only works in the Electron app

<webview> is an Electron-only tag. Run npm run electron:dev to use this.

25:00Focus
0

25 min focus ยท 5 min break ยท long break every 4 sessions

The Ultimate Grind