imagine you have people from different groups and you would like to pair them up so that no pair is constituted by people of the same group. i've spent a couple of minutes simulating different possibilities and have come to the conclusion that it is always possible given that no set (group) has more than $\displaystyle n/2$ elements (people) in it.

but i am looking for a mathematical proof or some reference of what this problem is called. i have a feeling it is a very general set theory concept and i'm overcomplifying it.

thanks!