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?
(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 |