Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Mathematical Analysis Note

Tower of Hanoi

For n ≥ 0
n = Total number of disks
Tn = minimum number of step

T0 = 0
T1 = 1
T2 = 3
T3 = 7
So we can write a general eqn.
T0 = 0
Tn = 2Tn-1 + 1
Tn-1 = 2Tn-2 + 1

Now
T1 = 2T0 + 1
= 2.0 + 1 = 1
T2 = 2T1 + 1
= 2.1 + 1 = 3
Aha! It certainly looks as if
Tn = 2n – 1, for n ≥ 0 - - - - - (1)

Basis step:
n = 0, 20 – 1 = 0
n = 1, 21 – 1 = 1
n = 2, 22 – 1 = 3
n = 3, 23 – 1 = 7

Equation (1) is True.

1|Page
Inductive step:
For n = k, for k ≥ 0, the equation (1) is true.

k = 2k – 1 - - - - - (2)

Now consider n = k+1


Tk+1 = 2k+1 – 1 - - - - - (3)

Will be True.

L.H. S = # step to move K+1 disks [ # = number of]


= 2(# step to move k disks) + 1 by the algorithm
= 2 (2k - 1) + 1
= 2k+1 -2 +1
= 2k+1 - 1

Eqn (3) is true.

Since both the basis and the inductive step are true.
Now we can say that the function is true for all n ε N.

For n disks the minimum number of step to solve the tower of Hanoi problem is 2n – 1
moves.

2|Page
Lines in the Plane (Pizza cutting)
For n ≥ 0,

Ln = Total number of Cut


L0 = 1
L1 = 2
L2 = 4
L3 = 7
So we can write a general eqn.
L0 = 1
L1 = L0+ 1
L2= L1+ 1
.
.
Ln = Ln-1 + n - - - - (1)
= Ln-2 + n – 1 + n
Ln = L0 + 1 + 2 + 3 + . . . + n
= 1 + Sn
= 1 + (n(n+1))/2

Basis step:
n = 0, L0 = 1 + (0(0+1))/2 = 1
n = 1, L1 = 1 + (1(1+1))/2 = 2

So the equation (1) is True.

Inductive step:
Let, n = k - 1 the equation (1) is true.
Lk-1 = 1 + k (k – 1)/2 - - - - - (2)

Eqn is True.

3|Page
Now the equation will be also true for m = k
Lk = 1 + k (k + 1)/2 - - - - - (3)

From (1)
Ln = Ln-1 + n
= 1 + (k (k – 1))/2 + k
= (k2 / 2 – k / 2) + 1 + k
= k2 / 2 + k / 2 + 1
= 1 +( k (k + 1)) / 2

Which is true.

Since both the basis and the inductive step are true.

Now we can say that the function is true for all m ε N.

For n slices the number of cut in the plane will be 1 + (n(n+1))/2

4|Page
The Josephus Problem
J(n) = the last Survivor’s number
n = 10

10 1 2 STEP 1

9 3
STEP 2
8 4
STEP 3
7 6 5

The Elimination order is 2,4,6,8,10,3,7,1,9.


So 5 is the last survivor.

Now we can guess that,


For 2n(even) number of people, after the first go round, we’re left with

2n-1 1
3
2n-3

... 7 5

And 3 will be next to go.

For n ≥ 1,

J(2n) = 2 J(n) – 1

5|Page
For 2n + 1(odd) number of people, after the first go round, we’re left with

2n+1 3
5
2n-1

... 9 7

For n ≥ 1,

J(2n+1) = 2 J(n) + 1
2n 20 21 22 23 24
l 0 0 1 0 1 2 3 0 1 2 3 4 5 6 7 0
n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
J(n) 1 1 3 1 3 5 7 1 3 5 7 9 11 13 15 1

If we write n = 2m + l
Where, 2m is the largest power of 2 not exceeding n
And l is what left. The solution would be
J (2m + l) = 2l + 1, m ≥ 0 and 0 ≤ l ≤ 2m ----(1)

We must now prove (1)


The induction is on m, when

Basis step:
m = 0, we must have l = 0, thus the basis of (1) reduces to J (1) = 1 which is true.

Inductive step:
If m > 0 and 2m + l = 2n then l is even and
J (2n) = 2 J(n) -1
= 2 J (2m/2 + l/2) -1
= 2 J (2m-1 + l/2) -1
= 2(2l/2 +1) – 1
= 2l +2 -1
= 2l - 1

Similarly, we can proof for odd case.


Now we can say that the function is true for all m ε N.
Form n number of people the last person survives the fall in the Josephus problem will be 2l – 1.

6|Page
Summation factor
anTn = bnTn-1 + cn
multiplying sn in both sides.

snanTn = snbnTn-1 + sncn


let snanTn = Sn

Sn = Sn-1 + sncn
S1 = S0 + s1c1
S2 = S1 + s2c2
= S0 + s1c1+ s2c2
S3 = S2 + s3c3
= S0 + s1c1+ s2c2+ s3c3
we can write the general formula,

n
Sn = S0 + ∑ skck
K=1

n
Sn = s0a0T0 + ∑ skck
K=1

n
snanTn = s0a0T0 + ∑ skck
K=1

n
Tn = (s0a0T0 + ∑ skck) / snan
K=1

[Proved]

7|Page
All horses are the same color and What’s wrong with the Proof.
Proof. The proof is by induction. Let P (n) be the proposition that in every set of n horses,
all are the same color.

Basis step:
P (1) is true, because all horses in a set of 1 must be the same color.

Inductive step:
Assume that P (n) is true, where n is a positive integer; that is, assume that
in every set of n horses, all are the same color.
Now consider a set of n + 1 horses
h1, h2, . . . hn, hn +1
By our assumption, the first n horses are the same color:

h 1, h 2, . . . h n, h n +1

Same color
Also by our assumption, the last n horses are the same color:
h 1, h 2, . . . h n, h n +1

Same color
Therefore, horses h1, h2, . . ., hn +1 must all be the same color, and so P (n + 1) is true. Thus, P
(n) implies P (n + 1). By the principle of induction, P (n) is true for all n ≥ 1. The theorem is
a special case where n is equal to the number of horses in the world.

Wrong:
We’ve proved something false.
The error in this argument is in the sentence that begins, “Therefore, horse’s h 1, h 2, . . .,
hn, h n +1 must all be the same color.” The “. . .” notation creates the impression that the
sets h 1, h 2, . . ., h n and h 2, . . ., h n, h n +1 overlap. However, this is not true when n = 1. In
that case, the first set is just h 1 and the second is h 2, and these do not overlap at all!
This mistake knocks a critical link out of our induction argument. We proved P (1) and
we proved P (2) ⇒ P (3), P (3) ⇒ P (4), etc. But we failed to prove P (1) ⇒ P (2), and so
everything falls apart: we cannot conclude that P (3), P (4), etc. are true. And, of course,
these propositions are all false; there are horses of a different color.

8|Page
15 or 8 Puzzle Problem
A B C A B C
D E F D E F
H G G H
Solved
Problem

We’ll build up a sequence of observations, stated as lemmas. Once we achieve a critical


mass, we’ll assemble these observations into a complete proof.
A row moves as a move in which a tile slides horizontally and a column move as
one in which a tile slides vertically.
Lemma 1. A row move does not change the order of the tiles.
A row move moves a tile from cell i to cell i + 1 or vice versa. This tile does not
change its order with respect to any other tile.

A B C A B C
D E F D E F
H G H G

Lemma 2. A column moves changes the relative order of exactly two pairs of tiles.
Sliding a tile down moves it after the next two tiles in the order. Sliding a tile up
moves it before the previous two tiles in the order. Either way, the relative order changes
between the moved tile and each of the two it crosses.

[Incomplete]

9|Page
12 + 22 + . . . + n2 = (n (n + 1) (2n + 1)) / 6 proof by Contradiction.
Proof:
Let assume the above statement is False.
Basis step:
n = 0, 02 = (0 (0 + 1) (2.0 + 1)) / 6 = 0
n = 1, 12 = (1 (1 + 1) (2.1 + 1)) / 6 = 1

Eqn is true.
Inductive step:
Let n = m the Eqn is true.
12 + 22 + . . . + m2 = (m (m + 1) (2m + 1)) / 6 … (2)

So n = m+1 the Eqn will be true.


12 + 22 + . . . + (m+1)2 = (m+1) (m + 2) (2m + 3)) / 6 … (2)

Adding (m+1)2 in Eqn (2).


12 + 22 + . . . + m2 + (m+1)2 = (m (m + 1) (2m + 1)) / 6+ (m+1)2
= (m + 1) (m(2m+1) + 6(m + 1)) / 6
= (m+1) (2m2 + 7m + 6) / 6
= (m+1) (m+2) (2m + 3) / 6

We can say that for n = m+1 eqn is true.


Now we can say that the function is true for all m ε N.
So we can say that our assumption is False and the equation is true.

10 | P a g e
13 + 23 + . . . + n3 = (n2 (n + 1)2) / 4 proof by Well ordering principle.

Proof:

Let the equation is true for n = 0,1,2,3,4 …


n = 0, 03 = (02 (0 + 1)2) / 4 = 0
n = 1, 13 = (12 (1 + 1)2) / 4 = 1

So in this equation will be false for some value of x.


Let the set of value C = {x,y,z …}
Which prove that the equation is false.
Let, there will be a smallest element, x, in C.
So the equation will br true for x-1.
For n = x-1

13 + 23 + . . . + (x-1)3 = ((x-1)2 x2) / 4 … (2)

Now add x3 in both side of the equation.


13 + 23 + . . . + (x-1)3 + x3 = ((x-1)2. x2) / 4 + x3
= x2 {(x2 – 2x + 1) + 4x / 4}
= x2(x+1)2 / 4
So we can say that for n = x-1 the equation is true.
If for n = x-1, the equation is true than n = x will be true.
So there is not possible for assume a set of C = {x,y,z …} of this equation.

So the equation is true.


[Proved]

11 | P a g e
Repertoire Method:
Arithmetic sequence: an = a + bn
Recurrent equation for the sum Sn = a0 + a1 + a2 + ··· + an:

S0 = a
S1 = a + a + b.1
= 2a + b
S2 = 2a + b + a + 2b
= 3a + 3b
We can generalize the eqN
Sn = Sn−1 + (a + bn), for n > 0

Let’s find a closed form for a bit more general recurrent equation:

R0 = α
Rn = Rn-1 + β + γ .1, for n > 0 … (1)
R1 = R0 + β + γ.1
= α+β+γ
R2 = R1 + β + γ.2
= α + β + γ+ β + γ.2
= α +2 β+ 3γ
We can generalize the eqn
Rn = A(n)α +B(n) β +C(n) γ … (2)

A (n), B (n), C (n) can be evaluated using repertoire method:


Now we will consider 3 cases:
Rn = 1 For all n
Rn = n for all n
Rn = n2 for all n

Case 1:
Lemma 1: A(n) = 1, for all n
1 = R0 = α
From Rn = Rn −1 + (β + γn)
follows that
1 = 1+ (β + γn).
This is possible only when β = γ = 0
Hence
1 = A(n). 1 + B(n). 0 + C(n). 0

12 | P a g e
Case 2:
Lemma 2: B(n) = n, for all n
α = R0 = 0
From Rn = Rn −1 + (β + γn)
follows that
n = n-1+ (β + γn).
i.e 1 = β + γn
This gives that β = 1 and γ = 0
Hence
n = A(n). 1 + B(n). 0 + C(n). 0

Case 3:
Lemma 3: C(n) = (n2+n)/2, for all n
α = R0 = 02 = 0
From Rn = Rn −1 + (β + γn)
follows that
n2 = (n-1)2+ (β + γn).
= n2-2n+1+ (β + γn).
0 = (1 + β) + n (γ− 2)
This is valid iff 1 + β = 0 and γ− 2 = 0
Hence
n2 = A(n). 0 + B(n). (- 1) + C(n). 2

Due to Lemma 2 we get


n2 = −n + 2C(n)
According to lemma 1,2,3, we get
Rn = 1 For all n => A(n) = 1
Rn = n for all n => B (n) = n
Rn = n2 for all n => C(n) = (n2+n)/2

That means that


Rn = α + n β +( (n2 + n) / 2) γ
The sum for arithmetic sequence we obtain taking α = β = a and γ = b:
n
Sn = ∑ (a + bk) = (n+1) a + ((n2+n)/2) b
k=0

13 | P a g e
Definitions:

Propositions:
A proposition is a statement that is either true or false.
Example:
2 + 3 = 5.
1 + 1 = 3.

Predicates:
A predicate is a proposition whose truth depends on the value of one or more variables.
Example:
“n is a perfect square”
whose truth depends on the value of n.

Validity:
A propositional formula is called valid when it evaluates to T no matter what truth
values are assigned to the individual propositional variables.
Example:
P AND (Q OR R) is equivalent to (P AND Q) OR (P AND R).

Satisfiability:
A proposition is satisfiable if some setting of the variables makes the proposition
true.
Example:
P AND Q is satisfiable because the expression is true if P is true or Q is false.

Axioms:
Propositions like these that are simply accepted as true are called axioms.
Example:
“There is a straight line segment between every pair of points.”

Proof:
A Proof is a verification of a preposition by a chain of logical deduction from a set of axioms.

The Well Ordering Principle


Every nonempty set of nonnegative integers has a smallest element.

[MORE]

14 | P a g e

You might also like