Average salary of n people in the room
Question:
How can n people know the average of their salaries without disclosing their own salaries to each other?
Solution:
Let’s say salaries of n people (P1, P2, P3…..Pn) are S1, S2, S3…..Sn respectively. To know the average of the salary i.e. (S1 + S2 + S3 + ….. + Sn) / n, they will follow the following steps -
P1 adds a random amount, say R1 to his own salary and gives that to P2 (P2 won’t be able to know P1’s salary as he has added a random amount known to him only).
[Read More]