Assume that you have a block weighing 40 kg and have tools to divide it as you want. Now, your task is to cut that block into 4 pieces such that only using those 4 pieces and a two-way balancing pan, you can measure any weight from 1 kg to 40 kg ? (You should be able to measure any weight like 1 kg, 2 kg, 3 kg upto 40 kg ).
Now since you have to divide it only into 4 pieces, so dividing it into 1, 2, 4 and 8 kg will not serve the task, as they will not be able to measure all the weights upto 40 kg.
So, what we can do is divide it into 4 blocks of weights 1 kg, 3 kg, 9 kg and 27 kg. Now, see how we can measure all the weights using it:
1 kg: 1 kg can be measured directly using block of 1 kg.
2 kg: To measure 2 kg, we can put 1 kg block with 2 kg and then put 3 kg block against these two, i.e., 2 + 1 = 3.
Similarly, 5 kg : It can be done using 5 kg + 1 kg + 3 kg = 9 kg.
7 kg : 7 kg + 3 kg = 1 kg + 9 kg.
Like this we can do for all the weights till 40 kg (40 = 1 + 3 + 9 + 27). Hence, the 4 weights required are 1 kg, 3 kg, 9 kg and 27 kg.
This article is contributed by Mrigendra Singh. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Measuring 6L water from 4L and 9L buckets
- Puzzle 1 | (How to Measure 45 minutes using two identical wires?)
- Puzzle 2 | (Find ages of daughters)
- Puzzle 3 | (Calculate total distance travelled by bee)
- Puzzle 4 | (Pay an employee using a 7 units gold rod?)
- Puzzle 13 | (100 Prisoners with Red/Black Hats)
- Puzzle 5 | (Finding the poisoned wine)
- Puzzle 6 | (Monty Hall problem)
- Puzzle 7 | (3 Bulbs and 3 Switches)
- Puzzle 8 | (Find the Jar with contaminated pills)
- Puzzle 9 | (Find the fastest 3 horses)
- Puzzle 10 | (A Man with Medical Condition and 2 Pills)
- Puzzle 11 | (1000 Coins and 10 Bags)
- Puzzle 12 | (Maximize probability of White Ball)
- Puzzle 14 | (Strategy for a 2 Player Coin Game)