Solving Probability Puzzles: Logic & Counting

Thinking Through the Possibilities

Some probability questions are like little puzzles. Instead of just plugging numbers into a complex formula, they require us to think clearly about all the different ways something can happen.

The "zebras on a triangle" (or often "ants on a polygon") problem is a great example. We need to figure out:

  • What choices does each zebra have?
  • How many total combinations of choices are there for all zebras?
  • Out of all those combinations, which ones result in the outcome we want (like "no zebras collide")?

This often involves listing out possibilities systematically or finding clever ways to count them, especially by looking for patterns or symmetry.

Key Steps for These Puzzles

  1. Understand the Setup:
    • Who are the actors? (e.g., 3 zebras)
    • Where are they? (e.g., corners of a triangle)
    • What can they do? (e.g., run to an adjacent corner)
    • Are there any restrictions or special conditions? (e.g., choices are random and simultaneous)
  2. Count All Possible Ways (Total Outcomes):
    • How many choices does the first zebra have?
    • How many choices does the second zebra have (is it affected by the first)? In this problem, choices are independent.
    • Multiply the number of choices for each zebra to get the grand total of different scenarios. This is your sample space.
  3. Count the "Good" Ways (Favorable Outcomes):
    • What specific outcome are we interested in? (e.g., "no zebras collide").
    • Think carefully: under what conditions will this happen? Try to visualize or list these specific scenarios.
    • Look for symmetries. For instance, if "all going clockwise" works, does "all going counter-clockwise" also work?
  4. Calculate the Chance (Probability): The probability is simply:
    (Number of "Good" Ways) / (Total Number of All Possible Ways)

Zebras on Triangle - No Collision

MODERATE

Three zebras are chilling in the desert. Suddenly a lion attacks! Each zebra is sitting on a corner of an equilateral triangle (sides of equal length). Simultaneously, each zebra randomly picks a direction (it can only choose to run towards one of the two adjacent corners along an edge) and starts moving along the outline of the triangle to that chosen adjacent vertex.

What is the probability that none of the zebras collide?

Generalize: What would be the probability of no collision if there were N zebras on an N-sided regular polygon, each randomly choosing to move along an edge to an adjacent vertex? Does the pattern from the triangle hold?

Nerchuko Academy · Free DS Interview Prep