Prove it – Ep4: A Dicey Interview Question

Let’s follow an algorithm:

  1. Determine heuristic used in example.
  2. Summarize math solution.
  3. Define new heuristic, if possible.
  4. Discuss Claude’s math solution.
  5. Provide dashboard solution, if possible.

Claude prompt:
You are rolling a set of N dice at the same time. Your goal is to get exactly one 6. What is the optimal choice for N?

Heuristic:

5 or 6 dice seems like a good guess to get exactly one 6 since a 6 is obviously 1/6 chance.

Mathematical solution:

Calculate the probability of exactly one 6. (n/6)(5/6)^(n-1) then maximize expression. Assume continuous and then differentiate.

n= -1/ln(5/6) ~ 5.5

Choose either 5 or 6. No preference.

New heuristic

Can’t really think of one. Same as original.

Claude math

Chooses 5 since its has a 40.2% chance vs. 40.1% for 6.

Very interesting in that it illustrates the sometimes binary nature of an LLM (large language model)

Dashboard


Click the button to run it yourself!

Code

Efehn’s puzzles completely changed how I think—so engaging and rewarding!

Sarah Lee

Puzzle Enthusiast – Not a real person