1.

He then enters a mushroom market. In the market, whenever two people greet each other, they have to swap their mushrooms. There are 64 people present in the Market.In order to save time, each pair of people is only allowed to greet each other atmost once. After a lot of greetings, Mario notices that it is no longer possible to return all mushrooms to their respective owners through more greetings. To sensibly resolve this maddening confusion, he decides to bring in even more people (with more mushrooms), to allow for even more greetings and mushroom swappings. How many extra people are needed to return all mushrooms (including the extra ones) to their rightful owners?Assume a person has exactly one mushroom.

Answer»

Solution :​Two extra people​ are needed to return correct mushrooms​ using the followingmethod­Let the extra people have names E1 and E2.
Step 1:​ Arrange the 64 people into lines such that ­ In each LINE, every person is having themushroom of the person directly BEHIND. Except the last person whose mushroom is withthe first person in that line.
NOTE : ​If two people have each others’ mushrooms, they will make a separate line of onlytwo people.
Step 2:​: For a single line, first E1 SWAPS mushrooms with the last person. Then E2 swapsmushrooms with each person in middle one at a time from front to back. Finally E1 willswap mushrooms with the first person.Then E1 & E2 swap each others’ mushrooms. Thisway everyone in this line ALONG with E1 & E2 will have their own mushrooms.
Step 3​: Repeat Step 2 for each line.


Discussion

No Comment Found

Related InterviewSolutions