In this problem, what we can do to solve for the number of ways is to use the combination formula:
nCr = n! / r! (n – r)!
where n is the total number of people and r is the number of person per team.
We can identify two cases in this problem.
1st case: We select the first 9 people for the green team, and the rest of 9 automatically gets to the yellow team therefore the selection is only made on the green team, so
18C9 = 18! / 9! (18 – 9)! = 48,620
2nd case: We select the first 9 people for the yellow team, and the rest of 9 automatically gets to the green team therefore the selection is only made on the yellow team, so
18C9 = 18! / 9! (18 – 9)! = 48,620
The total combination is the sum of the two:
total number of ways = 48,620 + 48,620
total number of ways = 97,240