Open In App

Puzzle 26 | (Know Average Salary without Disclosing Individual Salaries)

Last Updated : 13 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Three Employees want to know the average of their salaries. They are not allowed to share their individual salaries.

Answer: Follow these steps

Step 1) X adds a Random Number and his salary and tells the sum to Y.

Step 2) Y also adds a Random Number and his salary to the sum told by X and tells new sum to Z.

Step 3) Z also adds a Random Number and his salary to the sum told by Y and tells new sum to X.

Step 4) X subtracts its random number from the sum told by Z and tells the new number to Y.

Step 5) Y subtracts its random number from the sum told by X and tells the new number to Z.

Step 6) Z subtracts its random number from the sum told by Y and announces the new number. The new number is now the sum of three salaries and the average can be calculated by dividing the sum by 3. Finally, nobody knows the salary of others, but all know average.

This can be extended to more than 3 employees also.


Previous Article
Next Article

Similar Reads

Puzzle | Disclosing Secret
Problem Statement: A secret can be told only to 2 persons in 5 minutes. The same person tells to 2 more persons and so on. So How long will take to spread a secret to 768 persons? Solution: In the beginning, let only 1 person know the secret. Now, this 1 person will tell disclose the secret to 2 other persons in 5 mins. (Secret known = 2, Remaining
2 min read
How to know if a function is positive/negative and how to know if it's fractional?
In mathematics, a number system is a system of expressing numbers in various forms through writing. It is also often called the numeral system, which represents numbers by consistently using digits or other symbols. We have different types of number systems, such as a binary number system, an octal number system, a decimal number system, and a hexa
7 min read
Puzzle | Man fell in well Puzzle
A man fell in a 50m deep well. He climbs 4 meters up and slips 3 meters down in one day. How many days would it take for him to come out of the well? Answer: 47days Explanation: On the first day, the man climbs 4 meters up and slips 3 meters down, therefore he only climbs 1 meter up totally.On the second day, again he climbs 1 meter up, so the tota
1 min read
Puzzle - A LITTLE TRAIN PUZZLE
A nonstop express going sixty miles an hour starts from Bustletown for Ironchester, and another nonstop express going forty miles an hour starts at the same time from Ironchester for Bustletown. How far apart are they exactly an hour before they meet?Because the two stations cannot be found on any map or gazetteer, we cannot state the distance betw
1 min read
Puzzle | The Einstein's Puzzle
Einstein's puzzle is a famous logic puzzle that was supposedly created by Albert Einstein as a boy. The puzzle goes as follows:There are five houses in a row, each with a different color. In each house lives a person of a different nationality. The five owners drink a certain type of beverage, smoke a certain brand of cigar, and keep a certain pet.
4 min read
Puzzle 15 | (Camel and Banana Puzzle)
A person has 3000 bananas and a camel. The person wants to transport the maximum number of bananas to a destination which is 1000 KMs away, using only the camel as a mode of transportation. The camel cannot carry more than 1000 bananas at a time and eats a banana every km it travels. What is the maximum number of bananas that can be transferred to
4 min read
Puzzle 24 | (10 Coins Puzzle)
You are blindfolded and 10 coins are placed in front of you on the table. You are allowed to touch the coins but can’t tell which way up they are by feel. You are told that there are 5 coins head up, and 5 coins tails up but not which ones are which. Can you make two piles of coins each with the same number of heads up? You can flip the coins any n
1 min read
Puzzle 27 | (Hourglasses Puzzle)
Puzzle: Given two hourglass of 4 minutes and 7 minutes, the task is to measure 9 minutes. Solution: At 0 minutes: Start both hourglasses at the same time. At 4 minutes: 4 minutes hourglass runs out and flip it. 7 minutes hourglass is left with 3 minutes. At 7 minutes: 4 minutes hourglass is left with 1 minute. 7 minutes hourglass runs out and flip
1 min read
Puzzle 28 | (Newspaper Puzzle)
Question: A newspaper made of 16 large sheets of paper folded in half. The newspaper has 64 pages altogether. The first sheet contains pages 1, 2, 63, 64. If we pick up a sheet containing page number 45. What are the other pages that this sheet contains? Answer: On the back of 45, it is 46. The pages are such that for each page p, 65-p will be also
1 min read
Puzzle 31 | (Minimum cut Puzzle)
Puzzle: You have got someone working for you for five days and a gold bar to pay him. You must give them a piece of gold at the end of every day. What are the fewest number of cuts to the bar of gold that will allow you to pay him 1/5th each day? Answer: 2 cuts. Solution: Explanation 1: After two cut there are three pieces of [1 unit and two 2 unit
2 min read