-
Average Salary
There are three friends. All three earns and have a fixed monthly salary.
They sit together one day and tried to calculate their average salary.
But the quest is that one cannot disclose his salary to other friends.
How can they calculate their average salary?
-
Re: Average Salary
Suppose A,B,C are d 3 frnds.
Now, A 's salary -- AS
B's salary -- BS
C's salary --- CS
And A, to his salary adds a random no.(AR) and den tells dat to B.
B also adds sm random number(BR) to his salary and adds to the number whatever A has given ie. AS+AR+BS+BR. and gives to C
C also adds sm random number to his salary and adds dat to wtevr B has given him. AS+BS+CS+AR+BR+CR
Now...
A subtracts his random no. from the sum --- AS+BS+CS+BR+CR
Then B 2 vl subtract his random no. --- AS+BS+CS+CR
C 2 vl subtract -------------------- AS +BS +CS
Now,after C is done..the result is divided by 3 --- which gives the average of the salary.
From this,once d average is known..any of them cn knw d sum of d other 2 salaries
-
Re: Average Salary
-
Re: Average Salary
I have 2+ years of experience how much salary will take