Checking whether the approach is correct and correcting it to get the total number of people . Handshake/pigeonhole principle problem?

The problem here reads :


*

*There a number of people in a party. Each person shakes hands with exactly 20 people. For each pair of people that shakes hands with each other, there is exactly 1 other person who shakes hands with both of them; while for each pair of people that don’t shake hands with each other, there are exactly 6 other people who shake hands with both of them. Find the total number of people in the room.


I approached it differently from the solution given there , i would like to know whats going wrong in my method :


*

*Consider the set $S$ = {${(P_i ,P_j),P_k}$} where each element in $S$ consists of a person $P_k$ , who is having handshake with both $P_i$ and $P_j$  ,we will determine the cardinality of $S$ in two ways .     First we fix the pair $P_i,P_j$ as there are two possible cases that either they maybe both themselves had handshake or not , let $X$ denoted the number of pairs of people having handshake among them then counting this way we arrived at $6(\binom{N}{2}-X)+ X$ as the cardinality of $S$ . Another way of counting would be to fix $P_k$ , since there are $20$ people he had handshakes so there are $\binom{20}{2}$ pairs he had handshakes so cardinality again is $\binom{20}{2}$ $N$ , where $N$ is total number of people. So we can equate both relations we got for caridinality , but we would need to have a one more relation since there are two variables and one equation only .


If this method looks fine what should the other equation be or how can i bit modify it to get the correct answer, if there are some wrong steps ?

 A: This method looks fine. The missing equation is the equation for $X$: if there are $N$ people, and each one shakes hands $20$ times, then the product $20N$ counts each handshake twice (once from each person's point of view). So there are $(20N)/2 = 10N$ handshakes: $X = 10N$.
Now your equation $6(\binom N2 - X) + X = \binom{20}2 N$ becomes
$$
    6\left(\binom N2 - 10N\right) + 10N = \binom{20}{2} N
$$
which gives us $N=81$ (in addition to the trivial solution $N=0$).
We can compare this method with the accepted solution to the original question. In both cases, the approach is to count triples $a-b-c$ where $b$ shakes hands with both $a$ and $c$ (and the order of $a$ and $c$ doesn't matter. There is one difference:

*

*In the solution here, the set $S$ doesn't care whether $a$ and $c$ shake hands. This gives us a more complicated expression of $6(\binom N2-X)+X$ when we count the number of ways to complete $\{a,c\}$ to the triple $a-b-c$, since we have to do casework on whether $a$ and $c$ shake hands. However, every $b$ is in exactly $\binom{20}{2}$ triples.

*In the older solution, we only include triples $a-b-c$ where $a$ and $c$ did not shake hands. This means that every pair $\{a,c\}$ can be completed in $6$ ways to a triple $a-b-c$, and so the number of triples is always $6\binom N2$. However, finding a different way to count the triples is harder now: the older solution shows that there are $36$ ways to complete the pair $\{a,b\}$ to a triple $a-b-c$, and then divides by two to avoid double-counting, to get $18X$.

