# Puzzle | Two Brothers and Facebook

Sahil and Ritik are brothers. One day they were discussing who is smarter. But gradually the discussion turned into an argument. Mother came and tried to handle the situation. She gave them a problem to solve and the one who will solve the problem first, would be considered smarter than the other. The problem is :

In a group of 6 people, you might find some people are friends on Facebook, or you might find that no one is friend on Facebook. The brothers are supposed to prove that there is always a group of 3 people where either :

– All 3 people are mutual friends on Facebook.

– All 3 people are strangers (i.e, no one is friend on Facebook).

Can you help the brothers to reach to the solution ?

**Answer :**

The problem can be visualised using graph theory. Imagine each person is the vertex of a graph. Represent 6 people using 6 vertices of the graph. Draw a blue line between people who are friends and a red line between people who are not friends.

From one vertex, there can be 0,1,2,3,4,5 blue lines which is accompanied by 5,4,3,2,1,0 red lines. From a vertex, draw lines to other vertices. The lines which are not blue must be red and vice-versa. The number of red lines and blue lines will always be 5. For example, if there is 2 red lines , then there must be 3 blue lines. Because of this, there will always be either 3+ blue lines or 3+ red lines.(i.e, either will be present for atleast 3 times). Consider both the cases separately.

First consider that there are 3 red lines and 2 blue lines. The representation is shown in the figure as :

Look at the vertices which are connected by red lines. Look at the friends of this person. If none are friends, it means these are 3 mutual strangers(shown by red triangle).

If any are friends, it means these are 3 mutual friends(shown by blue triangle).

So, this proves that there are always atleast 3 mutual friends or atleast 3 strangers.

Same can be proven by taking the other case(i.e if we have 3 blue lines and 2 red lines).In that case there would be a blue triangle if there are atleast 3 friends and a red triangle if there are atleast 3 strangers.

**References-**Youtube-The Friendship Riddle

## Recommended Posts:

- Puzzle | Brothers and Sisters
- Puzzle 51| Cheryl’s Birthday Puzzle and Solution
- Puzzle 15 | (Camel and Banana Puzzle)
- Puzzle | 3 Priests and 3 devils Puzzle
- Puzzle 34 | (Prisoner and Policeman Puzzle)
- Puzzle 85 | Chain Link Puzzle
- Puzzle 81 | 100 people in a circle with gun puzzle
- Puzzle 33 | ( Rs 500 Note Puzzle )
- Puzzle 36 | (Matchstick Puzzle)
- Puzzle 27 | (Hourglasses Puzzle)
- Puzzle 24 | (10 Coins Puzzle)
- Puzzle 31 | (Minimum cut Puzzle)
- Puzzle | Elevator Puzzle
- Puzzle 29 | (Car Wheel Puzzle)
- Puzzle 28 | (Newspaper Puzzle)

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.