(i) Given :
An experiment consists of recording boy-girl composition of families with 2 children.
A family with 2 children may be either boy or girl or both.
Let B denote boy and G denote girl.
Depending upon what is first birth and what is second birth, possible outcomes are (BB,GG,BG,GB).
Hence the required sample space is S={BB,BG,GB,GG}.
(ii) Given : An experiment consists of recording boy-girl composition of families with 2 children.
In the family with two children can have 0 girl or 1 girl or 2 girls.
So, the possible outcomes are (0,1,2)
Hence the required sample space is S={0,1,2}.