In my Computer Science class, we were introduced to the Average Salary problem, where a group of people want to determine their average salary, but they don't want anyone to be able to determine the salary of anyone else.
I proposed a solution which I later looked up and found to be a fairly common one, wherein everyone writes down several numbers on separate pieces of paper that add up to their salary. The papers are then collected in a hat, totaled, and divided by the number of people.
My professor said that he was looking for a solution that only involved direct communication as to avoid the use of "trusted hardware". However, he also told me that my solution was flawed because some information is unnecessarily revealed, and, I must assume for the sole purpose of tormenting me, he said we would go over it later when he revealed the solution to the rest of the class.
He also told me my solution was still inadequate when I said that the numbers could be both positive and negative, and everyone was to submit an arbitrary amount of numbers.
My question is not what is the ultimate solution to this problem, but rather, what is wrong with mine? What information could be revealed from arbitrary numbers that when added up equal the total salary?
Assembled from comments:
There are (at least) two problems. First, information is revealed to whoever adds up the numbers on the papers. More precisely, the person doing the adding up now knows a finite number of possibilities for everyone's salaries, the possibilities being given by considering all possible ways of splitting up the papers into n disjoint subsets (n the number of people).
If you don't mind a lot of slips of paper, you could circumvent this by having everyone write \$1 on as many slips as their salary, and throw all those into the hat, and continue with your method. I don't think that would give away any individual information. (Or if that's too many slips, you could go by \$100s or \$1000s, possibly with one odd slip to make the amount exact.)
However, you then still run into the second problem: you have to assume that nobody peeks into the hat too soon (or looks at exactly how big everyone's stack of slips is). That is, everyone has to trust that the "hardware" the solution is running on behaves the way it should.