Quant Memo
Coding/●●●●●

Build a fair d7 from a fair d5

Asked at HRT, Citadel

You are handed rand5(), which returns a uniform integer in {1,2,3,4,5}\{1, 2, 3, 4, 5\}, and nothing else.

Implement rand7(), returning a uniform integer in {1,,7}\{1, \dots, 7\}. Prove it is uniform and give the expected number of rand5() calls.

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions