Prime Picker Expected Payoff

Expectation · Easy · Free problem

An integer $n$ is chosen uniformly at random from $\{2, 3, 4, 5, 6, 7, 8, 9, 10\}$.

  • If $n$ is prime, you receive $\$n$.
  • If $n$ is composite, you pay $\$n/2$.

What is the fair value of this game?

Hints

  1. List the primes and composites in $\{2, \ldots, 10\}$ separately and compute each group's total payoff.
  2. The primes are $2, 3, 5, 7$ (payoff $= n$). The composites are $4, 6, 8, 9, 10$ (payoff $= -n/2$). Sum everything up.
  3. Expected value $= \frac{1}{9}(2 + 3 - 2 + 5 - 3 + 7 - 4 - 4.5 - 5)$. Simplify the numerator.

Worked Solution

How to Think About It: This is a straightforward expected value calculation. List all outcomes, compute the payoff for each, weight by the uniform probability $1/9$, and add up. The only subtlety is remembering which numbers are prime: the primes in $\{2, \ldots, 10\}$ are $2, 3, 5, 7$. The composites are $4, 6, 8, 9, 10$. Quick gut check: 4 primes paying their face value versus 5 composites costing half their face value -- the composites might outweigh since there are more of them.

Quick Estimate: Sum of prime payoffs: $2 + 3 + 5 + 7 = 17$. Sum of composite penalties: $4/2 + 6/2 + 8/2 + 9/2 + 10/2 = 2 + 3 + 4 + 4.5 + 5 = 18.5$. Net: $17 - 18.5 = -1.5$. Divide by 9 outcomes: $-1.5/9 \approx -0.167$. So the game costs you about 17 cents on average.

Approach: Direct expected value computation.

Formal Solution:

Each of the 9 integers is equally likely with probability $1/9$. The payoff function is:

| $n$ | Type | Payoff | |-----|------|--------| | 2 | Prime | $+2$ | | 3 | Prime | $+3$ | | 4 | Composite | $-2$ | | 5 | Prime | $+5$ | | 6 | Composite | $-3$ | | 7 | Prime | $+7$ | | 8 | Composite | $-4$ | | 9 | Composite | $-4.5$ | | 10 | Composite | $-5$ |

$$E[\text{payoff}] = \frac{1}{9}(2 + 3 - 2 + 5 - 3 + 7 - 4 - 4.5 - 5)$$

$$= \frac{-1.5}{9} = -\frac{1}{6}$$

Answer: The fair value is $-\$1/6 \approx -\$0.167$. The game is slightly unfavorable -- on average you lose about 17 cents per play.

Intuition

This problem is pure expected value arithmetic -- no clever tricks, just careful bookkeeping. The reason it shows up in trading interviews is that market makers need to compute expected values of payout structures quickly and accurately. Speed and precision on problems like this signal that you can price simple exotic payoffs on the fly.

The slightly negative EV is typical of how interview problems are designed -- they want to see if you get the sign right and do not round prematurely. A common mistake is forgetting that 9 is composite (not prime) or miscounting the number of outcomes. In practice, this is the same skill as pricing a digital option with a discrete payoff schedule: enumerate states, multiply by probabilities, sum.

Open the full interactive solver →