It is given that 2 boys and 2 girls are in room X, and 1 boy and 3 girls are in room Y.
Let the 2 boys in room X areB1 and B2 and 2 girls in room XareG1 and G2. Consider 1 boy and 3 girls in room Y areB3, G3, G4 and G5 respectively.
Therefore, the sample space for which a room is selected is given by
Thus, the sample space for which a room is selected and then a person is given by,