P(A and B get same number of heads) = P(A and B both get 0 head ) + P(A and B both get 1 head) + P(A and B both get 1 head) + P(A and B both get 1 head) .................(1)
Now P(A and B both get 0 head ) : 3C0 (1/2)3 . 3C0 (1/2)3 [Since A and B toss 3 coins each separately so they need to be considered separate events.Also since it is a coin toss problem so it considers the requirements of binomial distribution and hence we apply this formula but separately for A and B and multiplying them since both of them will occur hence follows multiplication principle and also A and B are separate events as mentioned earlier]
= 1/64
SImilarly P(A and B both get 1 head ) : 3C1 (1/2)3 . 3C1 (1/2)3
= 9/64
SImilarly P(A and B both get 2 heads ) : 3C2 (1/2)3 . 3C2 (1/2)3
= 9/64
SImilarly P(A and B both get 3 heads) : 3C3 (1/2)3 . 3C3 (1/2)3
= 1/64
Hence from (1) , we have :
P(A and B get same number of heads) = 1/64 + 9/64 + 9/64 + 1/64
= 20/64
= 5/16
Hence , C) should be the correct option.