My employer has nine workers. The nine of us want to determine what our average salary is, but none of us wants to divulge his own salary. Can we find the average without doing so?
|
SelectClick for Answer> |
Yes. I privately pick some large random number — say, 645,743 — add my own salary to it, and whisper the total to Worker #2. He adds his own salary to that sum and whispers the new total to Worker #3, and so on. When the last worker has added his own salary, he whispers the final amount back to me. I subtract the random number that I’d chosen and divide the remainder by 9. Now we know the average salary of the nine workers, but none of us knows anything about what the others make.
11/03/2015 UPDATE: The solution above is not quite optimal because the workers can still make some inferences about their coworkers’ maximum salaries. For example, if I give Worker #2 the number 701,229, he knows that my salary cannot be higher than that. This can be improved by allowing the random number to be negative — in that case no inferences are possible, and the math still works. (Thanks, Daniel and Jose.)
|