If there's no restriction, we can choose 3 out of 8 in 8 choose 3 ways, or 8!/5!(8-5)! = 56 ways. Then, we need to consider the committees that have both genders.⬇️
For the committees with both genders, we can think of it as two problems: choosing men and women separately. So, we can choose 2 out of 5 men in 5 choose 2 ways. Then, we can choose 1 out of 3 women in 3 choose 1 ways. Since these events are independent, we can multiply them together to get 5!/3!(5-3)! x 3!/2!(3-2)! = 15. Since there are 56 possible committees without restrictions, and 15 with restrictions, we can conclude that there are 56 - 15 = 41 committees with only men or only women.