Pregunta de entrevista de Jane Street

Expectation questions, counting and combinatorics problems