Towers of hanoi induction- slight bit i don't understand

In summary: Hi, the absolute function is explicitly defined, so just distinguish the cases where f(x) = x when x > 0 and -x when x < 0; when x> 3 x-3 , when x < 3 -(x-3) or 3-x|x| is equal to x if x\ge 0, -x if x< 0. So |x-3| is equal to x-3 if x\ge 3, -(x-3)= -x+ 3 if x< 3.If x\ge 3 then |x- 3| becomes x- 3= 8 or x= 8+ 3= 11, which is, in
  • #1
pyrosilver
39
0
Towers of hanoi induction-- slight bit i don't understand

Homework Statement


I am trying to prove towers of hanoi. Now I am on the induction part and there is a part I don't get. I have the whole thing, but i don't understand a couple lines.

Homework Equations


The Attempt at a Solution



WTS: f(n+1) = 2n+1 - 1
By the Induction Hypothesis, f(n) = 2n-1.

Earlier, we showed f(n) = f(n-1) + 1 + f(n-1).

By the recursive definition,
f(n+1) = f(n) + 1 + f(n).
f(n+1) = 2f(n) + 1
f(n+1) = 2(2n-1) + 1
f(n+1) = 2(2n - 2) + 1
f(n+1) = 2n+1 - 1.
QED.

Ok I get the first line...get the second line...I get that you substitute f(n) in the third line... but I have no idea what the fourth and fifth lines are about! Please help me? I need to understand this by tomorrow :(
 
Physics news on Phys.org
  • #2


pyrosilver said:

Homework Statement


I am trying to prove towers of hanoi. Now I am on the induction part and there is a part I don't get. I have the whole thing, but i don't understand a couple lines.

Homework Equations


The Attempt at a Solution



WTS: f(n+1) = 2n+1 - 1
By the Induction Hypothesis, f(n) = 2n-1.

Earlier, we showed f(n) = f(n-1) + 1 + f(n-1).

By the recursive definition,
f(n+1) = f(n) + 1 + f(n).
f(n+1) = 2f(n) + 1
f(n+1) = 2(2n-1) + 1
f(n+1) = 2(2n - 2) + 1
f(n+1) = 2n+1 - 1.
QED.

Ok I get the first line...get the second line...I get that you substitute f(n) in the third line... but I have no idea what the fourth and fifth lines are about! Please help me? I need to understand this by tomorrow :(
I believe that the induction hypothesis should be (2^n) - 1, it should be clear after fixing that up
 
  • #3


Oh okay, i missed that, thanks. I'm still confused though...so the third line would be

f(n+1) = 2(2n - 1) + 1, right? why is the next line 2(2n - 2) + 1?
 
  • #4


after 2(2^n - 1) , you should get (2^n+1 - 2) + 1 --> 2^n+1 - 1 and it is proven.

you have some more typo errors, that line should be 2(2^n - 1) + 1, since you had above that 2f(n) + 1 - which now after clearing up, is definitely 2(2^n - 1) + 1
 
  • #5


OHHH sorry that took me awhile! Thank you so much lol xD

I have another question on a diff topic? I feel really stupid for asking but I'm not sure what to do.

for proving this carefully:

|x-3| = 8

I know you have to split it into two cases, x-3> 0. x-3 < 0.

For x-3>0,
x-3 = 8
x= 11.

For x-3<0, what do I do? I know it equals -5, but i don't know how to prove it?
 
  • #6


pyrosilver said:
OHHH sorry that took me awhile! Thank you so much lol xD

I have another question on a diff topic? I feel really stupid for asking but I'm not sure what to do.

for proving this carefully:

|x-3| = 8

I know you have to split it into two cases, x-3> 0. x-3 < 0.

For x-3>0,
x-3 = 8
x= 11.

For x-3<0, what do I do? I know it equals -5, but i don't know how to prove it?

Hi, the absolute function is explicitly defined, so just distinguish the cases where f(x) = x when x > 0 and -x when x < 0; when x> 3 x-3 , when x < 3 -(x-3) or 3-x
 
  • #7


|x| is equal to x if [itex]x\ge 0[/itex], -x if x< 0.

So |x-3| is equal to x-3 if [itex]x\ge 3[/itex], -(x-3)= -x+ 3 if x< 3.

If [itex]x\ge 3[/itex] then |x- 3| becomes x- 3= 8 or x= 8+ 3= 11, which is, in fact, greater than 3. If x< 3 then |x- 3|= -(x-3)= -x+ 3= 8 so -x= 8- 3= 5 and x= -5, which is, in fact, less than 3. (You should always check to see if the result is in the correct range.)

x= 11 and x= -5 satisfy this equation. If x= 11, then x- 3= 11-3= 8 so |x- 3|= 8. If x= -5, x- 3= -5- 3= -8 so |-8|= 8.
 

What is the Towers of Hanoi puzzle?

The Towers of Hanoi is a mathematical puzzle that involves moving a stack of disks from one tower to another, following specific rules.

What are the rules of the Towers of Hanoi puzzle?

The rules of the puzzle are as follows:

  • Only one disk can be moved at a time.
  • Each move consists of taking the top disk from one stack and placing it on top of another stack.
  • A disk can only be placed on top of a larger disk or an empty stack.

How many moves are required to solve the Towers of Hanoi puzzle?

The minimum number of moves required to solve the puzzle is 2^n - 1, where n is the number of disks.

What is the role of induction in the Towers of Hanoi puzzle?

Induction is a mathematical proof technique that is used to prove that the minimum number of moves required to solve the puzzle is 2^n - 1. It involves breaking down the problem into smaller, simpler cases and showing that the solution holds for each case.

What is the significance of the Towers of Hanoi puzzle?

The Towers of Hanoi puzzle is significant as it is a classic example of a problem that can be solved using mathematical induction. It also has real-world applications in computer science, such as in the design of algorithms and data structures.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
10
Views
609
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
8K
  • Precalculus Mathematics Homework Help
Replies
2
Views
2K
  • Math Proof Training and Practice
Replies
10
Views
1K
  • Precalculus Mathematics Homework Help
Replies
9
Views
2K
Replies
11
Views
2K
  • Precalculus Mathematics Homework Help
Replies
12
Views
2K
Back
Top