Pergunta de entrevista da empresa Two Sigma

Online coding test. Probability questions.