Gold Bar Puzzle (Interview Puzzle)
10 months ago codedestine 0
Gold Bar Puzzle :- You have hired a person for seven days to work on your house and you have agreed to pay him a gold bar as a compensation. The gold bar is divided into seven pieces and is connected with each other like a chain. You have to give him a piece of gold at the end of everyday work. What and where are the minimum number of cuts to the chain of gold bar pieces will be made, So that you can pay him a piece of gold every day?
Now try to solve this on your own…
Solution of Gold Bar Puzzle :-
To solve this gold bar puzzle, cuts will be made on a chain of gold pieces by using a mathematical formula 2^n – 1 (where n is a number that starts from 1 to k, where 2^k-1 < total number of connections).
In this case, a total number of connections are 6.
First cut :- 2^1 -1 = 1
Second cut :- 2^2 -1 = 3
Third cut :- 2^3 -1 = 7 (Since the total number of connections are 6, so this cut is not applicable)
So minimum number of cuts require to solve this problem will be 2 and cuts will be made on position 1 and 3 as shown in the image below.
Here is the explanation how it works, for easy understanding let’s name them.
A B C
Day 1 : Give A (1)
Day 2 : Take back A and give B (2)
Day 3 : Give A (2 + 1 = 3)
Day 4 : Take back A and B and give C (4)
Day 5 : Give A (4 +1 = 5)
Day 6 : Take back A and give B (4 + 2 = 6)
Day 7 : Give A (4 + 2 + 1 = 7)
That’s all for Gold Bar Puzzle, If you liked it, please share your thoughts in a comments section and share it with others too. For more interesting puzzles visit Interview Puzzles.