Premium problem38. Which Yes/No Question Tells You More

Medium Locked

A card is drawn uniformly from a standard 52-card deck. You may ask one yes/no question before guessing it. Compare these two:

  1. "Is it red?" splits the deck 26/26
  2. "Is it an ace?" splits the deck 4/48

For each, work out the expected number of cards still possible after you hear the answer, weighting each answer by how likely it is. Return 1 or 2 for whichever question leaves fewer cards on average.

Output

1

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)