Vandermonde's Identity states that , which can be proven combinatorially by noting that any combination of objects from a group of objects must have some objects from group and the remaining from group .
We have different hats. We split them into two groups, each with k hats: then we choose hats from the first group and hats from the second group. This may be done in ways. Evidently, to generate all possible choices of hats from the hats, we must choose hats from the first and the remaining hats from the second ; the sum over all such is the number of ways of choosing hats from . Therefore , as desired.