![]() So last part of the algorithm is to move the N minus. Okay, so finally, we want to move our smallest two discs to pick for. So at this point, you would have one of the last pay our three largest and on her second pig are two smallest discs. Our third largest are medium sized disc to the fourth pay as well. #Math puzzle with movable disks free#We're gonna move our third largest disc from three 21 to the First pig so that we can free up or second largest peg and move that toothy our second largest disc, and move that to the fourth peg. Okay, is that frees up our fourth egg? We can move it our largest disk onto hey, four. Okay, so start, I'm moving thes third largest to pig for fourth largest to page three, and I'll move our third largest onto our fourth largest on peg three. We had our and my as K two smallest disk on the second Pagan our doing r K three largest discs onto Hegg four. Okay? And so the next and that's don't want to do is move. And they will move our smallest disc on top of that. ![]() And then we'll move our second smallest disc to the second peg what we wanted. ![]() And so to do that, we'll start by moving our smallest disc to peg three yuan. So the first move that we're going to do and follows moving the end minus K, which is equal to five minus threes, is gonna be these second smallest disc from the first to the second peg. See, I from, uh, hang a to B just to simplify how much I'm writing here. So we choose K is equal to three eso for notation I'm gonna consider and save pegs A and B. Okay, well, so since tea too, does he cook? Two? Three is less than five, which is the number of disks that were working with which is less than or equal to t three equals six. Right? So that means is t one is equal to one angle a number 2 to 3. #Math puzzle with movable disks plus#Okay, so for part A here, we're using triangular numbers which were given to us as que times que plus one over too. Frame and Stewart showed that to produce the fewest moves using their algorithm, $k$ should be chosen to be the smallest integer such that $n$ does not exceed $t_$ Finally, recursively move the smallest $n-k$ disks to peg $4,$ using all four pegs. Next move the stack of the $k$ largest disks from peg 1 to peg $4,$ using the three-peg algorithm from the Tower of Hanoi puzzle without using the peg holding the $n-k$ smallest disks. Recursively move the stack of the $n-k$ smallest disks from peg 1 to peg $2,$ using all four pegs. For $n>1$, the algorithm proceeds recursively, using these three steps. $ When there is only one disk, move it from peg 1 to peg 4 and stop. This algorithm, given the number of disks $n$ as input, depends on a choice of an integer $k$ with $1 \leq k \leq n. Before presenting these exercises, we describe the Frame-Stewart algorithm for moving the disks from peg 1 to peg 4 so that no disk is ever on top of a smaller one. Your overall score is the sum of the points that you earn for each move What strategy should you use to maximize your total score?Įxercises $38-45$ involve the Reve's puzzle, the variation of the Tower of Hanoi puzzle with four pegs and $n$ disks. The game ends when you have stacks_ each containing single box: You earn points for each move in particular if you divide one stack of height a b into two stacks with heights and b, then you score ab points for that move. Stacking Game You begin with stack ofn boxes Then you make sequence of moves: In each move, you divide one stack of boxes into two nonempty stacks. Prove using strong induction that : Every way of unstacking blocks gives a score of n Your overall score is the sum of the points that you earn for each move What strategy should you use to maximize your total score?Īs an example suppose that we begin with stack of n= 10 boxes_ Then the game might proceed as shown in Figure On each line the underlined stack is divided in the next step:Īnalyzing the Game Let's use strong induction to analyze the unstacking game: We'Il prove that your score is determined entirely by the number of boxes Your strategy is irrelevant! PROOF BY INDUCTION \textbf Conclusion By the principle of mathematical induction, P ( n ) P(n) P ( n ) is true for all positive integers n n n.SOLVED: Stacking Game You begin with stack ofn boxes Then you make sequence of moves: In each move, you divide one stack of boxes into two nonempty stacks. To proof: The Tower of Hanoi puzzle with n n n disks can be solved in 2 n − 1 2^n-1 2 n − 1 moves for all positive integers n n n. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |