Pregunta de entrevista de Jane Street

Problems regarding probability and expectation.