Thread: Problem 29
View Single Post
  #9  
Old December 29th, 2007, 06:06 AM
Isomorphism's Avatar
Isomorphism Isomorphism is offline
Wesnoth Rookie

 
Join Date: Dec 2007
Location: IISc, Bangalore
Posts: 1,343
Country:
Thanks: 440
Thanked 654 Times in 548 Posts
Isomorphism is a splendid one to beholdIsomorphism is a splendid one to beholdIsomorphism is a splendid one to beholdIsomorphism is a splendid one to beholdIsomorphism is a splendid one to beholdIsomorphism is a splendid one to beholdIsomorphism is a splendid one to behold
Default

It is fun going over all these nice, old problems.

Quote:
Originally Posted by ThePerfectHacker View Post
I found this nice problem as an excercise in a math book. We can solve this by induction.
Hey TPH,
I think we can do this only using PHP, without induction(it is in fact akin to galactus solution)

In the group of n people, The different possible handshakes for each person is
0,1,2,3....,(n-1).
Claim:
We note that both 0 and n-1 together are not possible.
Proof:
Since handshake is symmetric, if there is a person with 0 handshake then nobody could have shook hands with this guy. Hence no one in the room would have shook hands with everyone. This implies "n-1" not possible.
However if "n-1" case has happened, then some body shook hands with everyone and therefore everybody would have shaken non-zero hands. So 0 is not possible!
That means "n-1" handshake choices for "n" people.
Apply PHP and wrap it up.

I think this argument is nice since it uses only PHP. We proved this result in graph theory using PHP itself!