Suppose I had been invited to the party and I were required to shake hands with only three others, then I must meet three persons and shake hands with each of them. So, the three persons and I make a group of four. In our group, each person gets to shake hands with three others; neither a handshake more nor a handshake less. After that, we are not allowed to go about shaking hands with anybody else. So, if there are "n" people at the party and the condition is that every person must shake hands with only three others, then we can very well consider the "n" people to be divided into n/4 groups with each group having four members. The question has been framed in such a manner so as to ensure that "n" is a multiple of 4; if "n" is not a multiple of 4, then the condition cannot be satisfied.

Now, let's get back to each group consisting of four members. How many handshakes occur in a group of four persons? There are four persons and each shakes hands with three others; so, the obvious answer is 4 * 3 = 12. This is wrong. In a group of four, besides fulfilling the condition that every person shakes hands with only three others, another condition is obviously met: each person shakes hands with everyone else. It takes two persons to shake hands. So, each person shaking hands with everyone else in a group of four would be the same as saying choose two persons out of four. Two persons can be chosen out of four persons in 4C2 ways. 4C2 = 4! / [(2!)(4-2)!] = 4! / (2! * 2!) = 6. So, there will be a total of six handshakes in a group of four.

Let's check this out. Let's say the four persons are A, B, C, and D. "A" shakes hands with "B", "C", and "D"; "B" shakes hand with "A", "C", and "D"; "C" shakes hands with "A", "B", and "D"; and "D" shakes hands with "A", "B", and "C". This can be represented as:

(AB), (AC), (AD);

(BA), (BC), (BD);

(CA), (CB), (CD); and

(DA), (DB), (DC).

On counting the number of handshakes, we have 12 handshakes.

But, (AB) and (BA) are the same because "A" shaking hands with "B" and "B" shaking hands with "A" is the same thing. We have to consider it only once. Similarly, (AC) and (CA), (AD) and (DA), (BC) and (CB), (BD) and (DB), (CD) and (DC) are the same pairs; we have to consider them only once.

So, we are left with (AB), (AC), (AD), (BC), (BD), and (CD). Hence, there are six handshakes in a group of four persons.

We are told there were 24 handshakes in all. Six handshakes occur in one group, so 24 handshakes will occur in 1 * 4 = 4 groups. Each group consists of four members, so four groups will have 4 * 4 = 16 members. Thus, there were 16 people at the party. Did I do it right?

Some useful links for
your career:

  • Union Public Service Commission -
  • IIT-Kharagpur -
  • Indian Statistical Institute -
  • Indian Institute of Technology Madras -
  • Indian Institute of Management, Ahmedabad -
  • Indian Institute of Mass Commission -
  • IIT Bombay -
  • Indian School of Mines, Dhanbad -
  • Birla Institute of Technology, Ranchi -
  • Central Institute of Fisheries Nautical and Engineering Training -
  • Indian Institute of Information Technology, Allahabad (Deemed University) -
  • Central Marine Fisheries Research Institute, Kochi -
  • Tata Institute of Social Sciences, Mumbai -