how would you go about solving this problem recursivelyof course you need to think about the base casethe recursive caseand how each recursive call reduces the size of the problem we will derive all of these in timebut the easiest way to solve this problem is to think about the problem from the bottom up instead of thinking about the easiest stepmoving the top disklet' start with the hardest step of moving the bottom disk suppose we already know how to move the top four disks from pole to pole bresulting in the board shown in figure moving the disk from pole to pole is now rather easy since it' the only disk left on pole and there are no disks on pole after moving the largest diskwe then move the other four disks from pole to pole pole pole pole figure the towers of hanoi puzzle with four disks moved to pole of coursewe still have to figure out how to move the top four disks there is no reason we cannot use the same technique to move the top four disks and in fact we must use the same techniquewhich leads to recursive solution given disks and three poles labeled source ( )destination ( )and intermediate ( )we can define the recursive operation asmove the top disks from pole to pole using pole move the remaining disk from pole to pole move the disks from pole to pole using pole the first and last steps are recursive calls to the same operation but using different poles as the sourcedestinationand intermediate designations the base casewhich is implicit in this descriptionoccurs when there is single disk to moverequiring that we skip the first and last step finallythe solution makes progress toward the base case since the recursive calls move one less disk than the current invocation eventuallywe will end up with single disk to move the high-level solution given above for solving the towers of hanoi puzzle can be easily converted to python functionas shown in listing for the second step of the process where we actually move diskwe simply print message indicating which disk was moved and the two poles it was moved between