the handshakes problem

10 people in the room each greet the other and shake hands only once. How many handshakes happen?

Since 2 people are involved per handshake, the question becomes: how many combinations of 2 out of 10 are there?

The formula for choosing k out of n items is:

$\binom{n}{k} = \frac{n!}{k!(n-k)!}$

So, $\binom{10}{2} = \frac{10!}{2!8!} = 45$ handshakes

a shortcut exists only for when k = 2

$\binom{n}{2} = \frac{n(n-1)}{2}$

e.g. $\binom{10}{2} = \frac{10(10-1)}{2} = 45$ handshakes

Why the shortcut works?

Remember that a factorial is a sequence decreasing by one until reaching 1, multiplied: e.g. $3! = 3 \times 2 \times 1$.

We can also say that $n! = n * (n-1)!$ where $1! = 1$.

Since $10! = 10 \times 9 \times 8!$ we can cancel out the 8! from numerator and denominator.

$\binom{10}{2} = \frac{10!}{2!(10-2)!} = \frac{10 \times 9 \times \cancel{8!}}{2! \times \cancel{8!}} = \frac{10 \times 9}{2} = 45$ handshakes!