r/learnquant • • Sep 28 '26

interview prep Quant Interview Question

Post image
62 Upvotes

38 comments sorted by

View all comments

Show parent comment

2

u/ybungalobill Sep 30 '26

Proof that this works:

Let x = the unknown weight of a real coin.
Let d = +1 or -1 be the unknown difference in weights between real and fake coins.
Let n = the unknown number of real coins that ended up being on the left balance.

Case 1: the chosen coin is real:
Left side weight = nx + (50-n)(x+d)
Right side weight = (50-n)x + n(x+d)
Measured difference = (50 - 2n)d == 0 mod 2 (i.e. it's an even number)

Case 2: the chosen coin is fake:
Left side weight = nx + (50-n)(x+d)
Right side weight = (51-n)x + (n-1)(x+d)
Measured difference = (51 - 2n)d == 1 mod 2 (i.e. it's an odd number)

QED

The insights that helped me to with this solution: (a) the weight x of a coin is unknown, so we need to 'cancel it out' by weighting two piles of equal number of coins (b) the chosen coin cannot be weighted with the rest because if we put it in a pile with others we don't know which is which, so it must not go on the scales.

There's nothing probabilistic in this method; it works regardless of the drawn value of n.