Average Salary
12 Sep 2008

Four honest and hard-working computer engineers are sipping coffee at Starbucks. They wish to compute their average salary. However, nobody is willing to reveal an iota of information about his/her own salary to anybody else. How do they do it?


Heard from a fellow student at UC Berkeley in 1996.


The first engineer picks a random k-digit integer for some large k, adds his salary to it and writes the sum on a chit. The chit is passed around. When it returns to the first engineer, he subtracts the k-digit integer.

© Copyright 2008—2018, Gurmeet Manku.