The Total solution for NCERT class 6-12
Let us denote 2 boys and 2 girlsin room X as B1, B2 and G1, G2 respectively. Let us denote 1 boy and 3 girls inroom Y as B3, and G3, G4, G5 respectively.
Accordingly,the required sample space is given by S = {XB1, XB2,XG1, XG2, YB3, YG3, YG4, YG5}