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 | Bilateral Conversations
Next article icon

Puzzle | Bilateral Conversations

Last Updated : 18 Jan, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report
There are n students in a class, each in possession of a different personality attribute. As they are new in the school, so they want to know about each other. To help the students, the teacher decides to conduct an activity. The rule for the activity is that the students will share the personality attributes of each other through a series of bilateral conversations (e.g., via a telephone). Assume that in every conversation both parties exchange all the personality attributes they know at the time. What is the minimum number of conversations they need to guarantee that everyone of them gets all the personality attributes? Solution : Let us denote the n students as S1, S2, S3, ........., Sn. When the Number of students (n) = 1, then the number of conversations required is 0 as no bilateral conversation is possible. For n = 2, the number of conversations required is 1 i.e, between S1 and S2. For n = 3, three conversations are needed which are as (S1 with S2), (S2 with S3), (S1 with S3)). For n = 4, four conversations are needed. For n = 5, six conversations are needed. For n = 6, eight conversations are needed. The above figures shows the optimal personality attribute sharing via bilateral conversations. The sequential order of conversations is indicated by the labels on the edges connecting the vertices, representing the conversing parties. The order of conversations can vary. The logic can be further extended to n = 7, 8 and so on. If observed then it can be seen that the total number of conversations in this algorithm is equal to 2(n - 4) + 4 = 2n - 4 where n >= 4. What is the best way to make conversations ensuring minimality: For n > 4, the solution for n = 4 can be extended by making each of students S5, S6, . . ., Sn talk with person S1 before S1 talks with S2, S3 with S4, S1 with S4 and S2 with S3 and then making S1 talk with each of students S5, S6, . . ., Sn for the second time. Note: The order of conversations may vary but the total number of minimum conversations will remain same which can be clearly seen in images for n = 6. Reference : Algorithmic Puzzles – Anany Levitin, Maria Levitin

Next Article
Puzzle | Bilateral Conversations

B

bansal_rtk_
Improve
Article Tags :
  • Aptitude
  • Analytical Mathematical Puzzles

Similar Reads

    Puzzle | Paradox Dragons
    Puzzle: There are 3 dragons. One of them always speaks the truth, one always lies and one alternate between truth and lie. A series of conversation takes between Ram and the 3 dragons which lets you identify the nature of each dragon. Dragon 1: "You may ask us one question, then you must guess which
    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
    Top 100 Puzzles Asked In Interviews
    Puzzles are asked in Interviews to check our problem-solving skills. Here we are providing you with the top 100 puzzles that are asked in Interviews. The main aim of puzzles is entertainment. Puzzles can be of many types:- picture puzzles, logical puzzles, mathematical puzzles, etc. It is very helpf
    4 min read
    Communication Cycle - Definition, Components, Methods, Significance
    The correspondence cycle is characterized as a correspondence interaction that makes sense of how the process for conveying and understanding messages capabilities. In a correspondence cycle, a source, message, encoder, channel, decoder, recipient, commotion, criticism kinds of components are contai
    8 min read
    Amazon Interview Experience | Set 352 (For SDE I)
    1) Online coding round of 45 minutes. We had a question where we had to read an unknown number of lines from a data file. Each line had a formatted date time stamp and a person's name. We were supposed to tell if some person had appeared twice on the same date or not. For C++, i used getline to take
    3 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