All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Gossip (Posted on 2012-07-26)
n people know each a different piece of gossip.

They can phone each other and exchange all they know so that after the call the parties know anything that either of them knew before the call.

What is the smallest number of calls needed so that everyone knows everything and how is this number achieved?

Comments: ( Back to comment list | You must be logged in to post comments.)
 solution | Comment 2 of 12 |
(2n - 3) : n > 1

As gossip requires at least 2 persons involved, there is no need to offer the case where n = {0,1}, to which the number of calls required is 0.

One person can call each party, exchanging gossip. Then, but for the last person called, call each party again relaying all the gossip.  Everyone then would know the same information that was considered gossip.
The number of calls to garnish all the gossip would be (n-1). The - 1 is because two individuals are involved in one call. The number of calls required then to relay the total gossip is, then, (n-1) - 1, with the additional - 1 due to not needing to call the last person called again. (n-1) + (n-1) - 1 = (2n - 3).
 Posted by Dej Mar on 2012-07-26 12:35:33

 Search: Search body:
Forums (0)