0% found this document useful (0 votes)
14 views

d Structure

Uploaded by

Preeshay Jutt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

d Structure

Uploaded by

Preeshay Jutt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

GROUP MEMBERS

 Nazia 110
 Inbasaat talha 115
 Zainab shamim 122
Topic:
 Mathematical Induction
 Recursion
Intr0ducti0n:-
Real Life Example:
Mathematical inducti0n:
 PRINCIPLE OF MATHEMATICAL INDUCTION:
To prove that P (n) is true for all positive integers n, where P
(n) is a propositional function, we complete two steps:
 BASIS STEP:
We verify that P (1) is true.
 INDUCTIVE STEP:
We show that the conditional statement P (k) → P (k + 1)
is true for all positive integers k.
Examples:
 Problem 1:
Use mathematical induction to prove that
1 + 2 + 3 + ... + n = n (n + 1) / 2
for all positive integers n.
 Problem 2:
Prove that
1 2 + 2 2 + 3 2 + ... + n 2 = n (n + 1) (2n
+ 1)/ 6
For all positive integers n.
S0luti0n:
 Solution to Problem 1
 Let the statement P (n) be
1 + 2 + 3 + ... + n = n (n + 1) / 2
STEP 1: We first show that p (1) is true.
Left Side = 1
Right Side = 1 (1 + 1) / 2 = 1
Both sides of the statement are equal hence p (1) is true.
STEP 2: We now assume that p (k) is true
1 + 2 + 3 + ... + k = k (k + 1) / 2
and show that p (k + 1) is true by adding k + 1 to both sides of the above
statement
1 + 2 + 3 + ... + k + (k + 1) = k (k + 1) / 2 + (k + 1)
= (k + 1)(k / 2 + 1)
= (k + 1)(k + 2) / 2
The last statement may be written as
1 + 2 + 3 + ... + k + (k + 1) = (k + 1)(k + 2) / 2
Which is the statement p(k + 1).
S0luti0n:
Solution to Problem 2:
 Statement P (n) is defined by
1 2 + 2 2 + 3 2 + ... + n 2 = n (n + 1) (2n + 1)/ 2
STEP 1: We first show that p (1) is true.
Left Side = 1 2 = 1
Right Side = 1 (1 + 1) (2*1 + 1)/ 6 = 1
Both sides of the statement are equal hence p (1) is true.
STEP 2: We now assume that p (k) is true
1 2 + 2 2 + 3 2 + ... + k 2 = k (k + 1) (2k + 1)/ 6
and show that p (k + 1) is true by adding (k + 1) 2 to both sides of the
above statement
1 2 + 2 2 + 3 2 + ... + k 2 + (k + 1) 2 = k (k + 1) (2k + 1)/ 6 + (k + 1) 2
Set common denominator and factor k + 1 on the right side
= (k + 1) [ k (2k + 1)+ 6 (k + 1) ] /6
Cont.……

Expand k (2k + 1)+ 6 (k + 1)


= (k + 1) [ 2k 2 + 7k + 6 ] /6
Now factor 2k 2 + 7k + 6.
= (k + 1) [ (k + 2) (2k + 3) ] /6
We have started from the statement P(k) and have
shown that
1 2 + 2 2 + 3 2 + ... + k 2 + (k + 1) 2 = (k + 1) [ (k +
2) (2k + 3) ] /6
Which is the statement P(k + 1).
Cont.…….
 Problem 3:
Use mathematical induction to prove
that
1 3 + 2 3 + 3 3 + ... + n 3 = n 2 (n +
1) 2
/4
for all positive integers n.
 Problem 4:
Show that for all n∈N-is divisible by 4
Recursi0n:
 Definition:
Recursion means defining something, such as a
function in terms of itself.
Example:
fact(n)
{ if (n==0)
return 1;
else
return(n*fact(n-1);
}
Recursive definition/ inductive
definition
 Definition:
A recursive definition in mathematical logic and
computer science is used to define the elements in a set in
terms of other elements in the set.
A recursive definition of a function defines values of the
functions for some inputs in terms of the values of the
same function for other inputs.
For example the factorial function n! is defined by the rules:
0!=1
(n+1)!=(n+1).n!
Cont.……
 An inductive definition of a set describes the
elements in a set in terms of other elements in the
set. For example, one definition of the set N
of natural numbers is:
 1 is in N.
 If an element n is in N then n+1 is in N.
 N is the intersection of all sets satisfying (1) and (2).
Cont.…..
 We use two steps to define a function, sequence or set in
terms of recursive definition.
 Basic step: specify the value of function at zero.
 Recursive step: this step defines the rules to find a new
element from existing element.
Examples:
 Suppose that f is defined recursively by:
f(0)=3
f(n+1)=2f(n)+3
Find f(1), f(2), f(3), and f(4)
Cont.…..
Solution:
From the recursive definition it follows that:
f(1)=2f(0)+3=2.3+3=9
f(2)=2f(1)+3=2.9+3=21
f(3)=2f(2)+3=2.21+3=45
f(4)=2f(3)+3=2.45+3=93
Cont.…..

 f(x)=2^x
f(0)=2^0=1 (BASIC STEP)
f(x+1)=2^(x+1)=2.2^x (RECURSIVE STEP)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy