Interview Preparation Exam  >  Interview Preparation Notes  >  Puzzles for Interview  >  Know Average Salary without Disclosing Individual Salaries

Know Average Salary without Disclosing Individual Salaries | Puzzles for Interview - Interview Preparation PDF Download

Introduction 

Have you ever been in a situation where you wanted to know the average salary of a group of people, but you were not allowed to share individual salaries? Here's a solution to that problem.

Problem Statement

How to Find Average Salary without Disclosing Individual Salaries

Steps to Follow

1. X adds a Random Number and his salary and tells the sum to Y.
2. Y also adds a Random Number and his salary to the sum told by X and tells the new sum to Z.
3. Z also adds a Random Number and his salary to the sum told by Y and tells the new sum to X.
4. X subtracts its random number from the sum told by Z and tells the new number to Y.
5. Y subtracts its random number from the sum told by X and tells the new number to Z.
6. Z subtracts its random number from the sum told by Y and announces the new number.

Calculation of Average Salary

The new number announced by Z is now the sum of the three salaries, and the average can be calculated by dividing the sum by 3. This way, nobody knows the salary of others, but all know the average.

Explanation

To understand this process better, let's take an example. Suppose X, Y, and Z have salaries of $50,000, $60,000, and $70,000, respectively. They want to know the average of their salaries without disclosing their individual salaries.
X adds a random number, say 5, to his salary and tells the sum, which is $50,005, to Y. Y adds a random number, say 7, to his salary and the sum told by X, which is $110,012, and tells the new sum, which is $110,019, to Z.
Z also adds a random number, say 3, to his salary and the sum told by Y, which is $170,022, and tells the new sum, which is $170,025, to X. X subtracts his random number, which is 5, from the sum told by Z, which is $170,020, and tells the new number, which is $170,015, to Y.
Similarly, Y subtracts his random number, which is 7, from the sum told by X, which is $120,024, and tells the new number, which is $120,017, to Z. Finally, Z subtracts his random number, which is 3, from the sum told by Y, which is $180,029, and announces the new number, which is $180,026.
Therefore, the sum of the three salaries is $50,000 + $60,000 + $70,000 = $180,000, and the average salary is $180,000/3 = $60,000.

Conclusion

This method is a great way to find out the average salary of a group of people without disclosing individual salaries. It helps to maintain privacy and ensures that no one feels uncomfortable sharing their salary.

The document Know Average Salary without Disclosing Individual Salaries | Puzzles for Interview - Interview Preparation is a part of the Interview Preparation Course Puzzles for Interview.
All you need of Interview Preparation at this link: Interview Preparation
109 docs

Top Courses for Interview Preparation

Explore Courses for Interview Preparation exam

Top Courses for Interview Preparation

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Free

,

Know Average Salary without Disclosing Individual Salaries | Puzzles for Interview - Interview Preparation

,

ppt

,

Previous Year Questions with Solutions

,

past year papers

,

study material

,

Viva Questions

,

Sample Paper

,

shortcuts and tricks

,

Objective type Questions

,

MCQs

,

video lectures

,

Important questions

,

Extra Questions

,

Exam

,

Summary

,

practice quizzes

,

Semester Notes

,

Know Average Salary without Disclosing Individual Salaries | Puzzles for Interview - Interview Preparation

,

mock tests for examination

,

pdf

,

Know Average Salary without Disclosing Individual Salaries | Puzzles for Interview - Interview Preparation

;