If the 13 pupils are A,B,C,D,E,F,G,H,I,J,K,L,M
First consider the three groups to be Group A of 4, Group B of 5, and
Group C of 4.
Choose the pupils for Group A:
That's 13 pupils choose 4, or 13C4
Choose the pupils for Group B:
That's 9 remaining pupils choose 5, or 9C5
Choose the pupils for Group C:
That's 4 remaining pupils choose 4, or 4C4
That would be (13C4)(9C4)(4C4) = (715)(126)(1) = 90090
if such groupings as these 2:
Group A = {C,G,I,M}, Group B = {B,D,E,J,L}, Group C ={A,F,H,K}
and
Group A = {A,F,H,K}, Group B = {B,D,E,J,L}, Group C ={C,G,I,M}
were distinguishable (with Groups A and C swapped).
But they probably aren't, so we will divide 90090 by 2 and get
Answer = 45045.
Edwin