Search⌘ K
AI Features

Solution: Soup Servings

Explore a recursive dynamic programming solution that computes the probability of soup A emptying first. Understand how to normalize inputs and use memoization to handle state space efficiently while keeping computations manageable.

Statement

You begin with two types of soup, A and B, each containing n milliliters. During each turn, exactly one of the following four operations is selected uniformly at random (each with probability 0.250.25), independent of all prior turns:

  • Serve 100100 mL of soup A and 00 mL of soup B.

  • Serve 7575 mL of soup A and 2525 mL of soup B.

  • Serve ...