Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Quantitiative Aptitude
  • Logical Reasoning
  • Verbal Ability
  • Aptitude Quiz
  • Quantitiative Aptitude Quiz
  • Verbal Ability Quiz
  • Aptitude For Placements
  • Interview Corner
  • Practice Sets
Open In App
Next Article:
Puzzle | Two Brothers and Facebook
Next article icon

Puzzle | Two Brothers and Facebook

Last Updated : 18 Jan, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report
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.
Vertices representing persons..
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

Next Article
Puzzle | Two Brothers and Facebook

S

Sahil_Bansall
Improve
Article Tags :
  • Aptitude
  • Logical Puzzles
  • Puzzles
Practice Tags :
  • Puzzles

Similar Reads

    Puzzle | Brothers and Sisters
    There is a family, which has seven children. In this family, each boy has as many sisters as brothers and each of the girl has twice as many brothers as sisters. Now the question is, in this family how many brothers and sisters are there ? Solution : The key to solve this puzzle lies in the puzzle s
    1 min read
    Puzzle - Life and Luck
    Picture this: Two friends, A, and B, find themselves in a thrilling yet terrifying game of life and death. They are captured by a gang of ruthless thugs and forced to play a game of cards. The stakes are high and the rules are deadly, but one question remains: who will survive? The Rule of the Game:
    3 min read
    Puzzle: Four Friends and Their Hobbies
    Four friends - Alex, Ben, Chris, and Daniel - each have a different favorite hobby, the task is to figure out who has which hobby, use the following clues to determine the hobby of each friend: One of the friends enjoys playing chess.Ben hates swimming.Chris likes to paint.Alex loves hiking.Daniel i
    2 min read
    Puzzle | Handshakes
    A couple invites n - 1 other couples to dinner. Once everyone arrives, each person shakes hands with everyone he doesn’t know. Then, the host asks everyone how many hands they shook and each person replies with a different number. Assuming that everyone knows his or her own spouse, how many hands di
    2 min read
    Puzzle 46 | Rich or Poor
    A place has two kinds of residents, Poor, who always tell the truth, and their opposites, Rich, who always lie. You encounter two people A and B. What are A and B if A says “B is a Poor” and B says “The two of us are opposite types” ? Answer: Both A and B are Rich Solution: Let p and q be the statem
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences