# Puzzle | Bilateral Conversations

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.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

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.

Article Tags :
Practice Tags :

1

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.