# Complicated constrained 'numbers of handshake' style problem

How do i calculate the number of 1-to-1 handshakes in this scenario?

If i have n number of people, but they can only shake hands with a maximum of i number of people (and assume they all maximize at i if that is feasible) how many handshakes would there be?

As example, with 6 people (n=6), maximum i=4 handshakes, then the total handshakes will be 12 (calculating manually). In this case, it can be solved that every person does 4 exactly shakes.

What is the formula to generalize this?

• Try another example with numbers such that not everyone can give the maximum number of handshakes. How would you manually calculate that? Try to generalize from there. Also, how can you tell, given $(n, i)$, if everyone is going to be able to give $i$ handshakes or not. If everyone can give $i$ handshakes, how many unique handshakes will there be? – RGS Jan 25 '17 at 10:38

It can be fully maximized if and only if $n,i$ are not both odd (and of course, we must have $i < n$).