Pergunta de entrevista da empresa EXL Service

Question on total probability theorem.