Domanda di colloquio di Jane Street

Two combinatorics/probability questions.