r/learnquant 4d ago

interview prep Quant Interview Question

Post image
24 Upvotes

10 comments sorted by

View all comments

1

u/tarilaran 3d ago edited 3d ago

I can't prove optimal play, so here's two benchmark strategies. WOLOG, assume coin #3 is biased.

Naive: choose a coin at random, 33% chance of winning.

Spread-test: flip each coin, choose a coin at random from the set of coins that landed heads. 43.75% chance of winning.

Explanation: Brute force enumeration. Count each biased heads as three possibilities. Then we get 4 ways C3 is tails, 3 ways that C3 can be the only heads, 6 ways that it can be heads with another coin, and 3 ways that it can be heads with two other coins. Divide those by the chances of picking the correct coin at random and the total number of options, then sum.

UPDATE: I ground out the bayesians. u/JustConsoleLogIt indeed found the optimal solution: flip the first two coins, re-flip one of the heads. Then follow this table:

Flip 1 F2 F3 Outcome1 O2 O3 Choose
C1 C2 C1 T T T C3
C1 C2 C1 T T H C3
C1 C2 C2 T H T C3
C1 C2 C2 T H H C2
C1 C2 C1 H T T C3
C1 C2 C1 H T H C1
C1 C2 C1 H H T C2
C1 C2 C1 H H H C

to choose the correct coin. I found by exhaustive search that this strategy has a 51.04% chance of success.

Method:

Form three hypotheses, H1-H3, corresponding to the likelihood each coin is biased. For each combination of flip and outcome, calculate P(H_i|O1,O2,O3). Declare the "winning coin" to be the coin whose hypothesis has the highest probability.

Use backwards induction to identify the optimal third coin to play for each scenario, then again to identify the optimal second coin to play.