Miscellaneous Company Exam
Company
In the island of Hanoi is trapped a princess. To rescue her, the prince has to transfer a set of rings
numbered 1 to 7 from tower A to tower C. The rings are stacked one over the other in an order, with 1
at the top and 6 at the bottom, and have to be stacked in the same fashion on tower C. The prince can
move only one ring at a time, and can store the rings in a stack, temporarily, in another tower B.
Minimum how many moves of rings, between the towers, will it take the prince to arrange the rings in
tower C ?
Read Solution (Total 2)
-
- As a total of 7 rings are to be transferred, it is mentioned that only 6 rings are present in Tower A. So, either 1 ring is present separately or there are 7 rings itself in tower A. In both cases, answer should be "13".
As a temporary stack can be used, therefore transfer top 6 rings of Tower A(or all 6 rings in case 7th ring is present separately) to Tower B in "Last in first out" order one ring at a time, so that the 6th ring is at the top of the stack in Tower B. .................-> 6 Moves made
Now, place the seventh ring at the bottom of the stack in Tower C.....1 move made here, so total moves till now= 6+1 =7
Again start transferring all 6 rings from Tower B to Tower C keeping the 6th ring above 7th ring n 1st ring at the top. ...........6 moves made here. Total moves made till now= 7+6 =13 - 12 years agoHelpfull: Yes(20) No(6)
- Very old puzzle.
If there are n rings, no of moves reqd = (2^n)-2
Here n= 7 , then no of moves = 2^7-1= 128-1=127 - 13 years agoHelpfull: Yes(17) No(22)
Miscellaneous Company Exam Other Question