Select 4 from Group A (4M, 5W) and 4 from Group B (5M, 4W) such that the total is 4 men and 4 women.
Let k men be selected from Group A, which means 4−k women are chosen from Group A. Since the overall requirement is 4 men and 4 women, from Group B one must select 4−k men and k women.
The parameter k must satisfy 0≤k≤4 for men in Group A, 4−k≤5 for women in Group A, 4−k≤5 for men in Group B, and k≤4 for women in Group B. These conditions hold for k=0,1,2,3,4.
Therefore the total number of ways is given by
N=∑k=04(k4)(4−k5)(4−k5)(k4)
For k=0, the count is (04)(45)(45)(04)=1×5×5×1=25
For k=1, the count is (14)(35)(35)(14)=4×10×10×4=1600
For k=2, the count is (24)(25)(25)(24)=6×10×10×6=3600
For k=3, the count is (34)(15)(15)(34)=4×5×5×4=400
For k=4, the count is (44)(05)(05)(44)=1×1×1×1=1
Summing these gives N=25+1600+3600+400+1=5626
The correct answer is 5626.