Five coworkers want to know what the average of all their salaries is, but refuse to reveal ANY information about their own salaries to their coworkers. How can they calculate the average ?
courtesy: Vibhaj
Click here to see the solution.
p.s. - For Remarks please hit the given link once. For Hint, hit it twice and for the solution, hit it thrice.
Hints: No Hints. Hit again for solution. |
|
Solution:
One of them may choose any random number (not to be known any other) and add his salary to it and tell the sum to the second person, then he will add his salary to the sum and tell the result to the third person and so on. The fifth person after adding his salary to the sum will tell it to the first person. He will subtract the random number he choose from the final sum giving them the sum of their salaries and the average. |
|
|