Given:
2 boys and 2 girls are in Room X,and 1 boy and 3 girls in Room Y. A room is selected and then a person
Room X:
Let B1,B2 and G1,G2 are the boys and girls in room X respectively.
Possible outcomes are when room X is selected then a person: {XB1,XB2,XG1,XG2}
Room Y:
Let B3, and G3,G4,G5 are the boys and girls in room Y respectively.
Possible outcomes when room Y is selected then a person : {YB3,YG3,YG4,YG5}
Hence the required sample space is
S={XB1,XB2,XG1,XG2,YB3,YG3,YG4,YG5}.