Pregunta de entrevista de Squarepoint Capital

Dynamic programming question, simple probability theory problem