Pergunta de entrevista da empresa Jane Street

Some probability and number theory puzzles