Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Recursive Definitions - Discrete Mathematics and its Applications - Lecture Slides, Slides of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Recursive Definitions, Fractals, Examples of Images, Recursive Functions, Value of Function, Set of Nonnegative Integers, Rule for Producing, Fibonacci Numbers, Golden Section, Recursively Defined Sets

Typology: Slides

2012/2013

Uploaded on 04/27/2013

atmaja
atmaja 🇮🇳

4.2

(45)

182 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture 13
3.4 Recursive Definitions
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Recursive Definitions - Discrete Mathematics and its Applications - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Lecture 13

3.4 Recursive Definitions

Fractals

fractals are examples of images where the same elements is being recursively.

Fibonacci Numbers

Fibonacci numbers: f(0) = 0, f(1) = 1, f(n+1) = f(n) + f(n-1) for n = 1,2,3,... f(2) = 1 + 0 = 1; f(3) = 1 + 1 = 2; f(4) = 2 + 1 = 3; f(5) = 3 + 2 = 5; Suppose a newly-born pair of rabbits, one male, one female, are put in a field. Rabbits are able to mate at the age of one month so that at the end of its second month a female can produce another pair of rabbits. Suppose that our rabbits never die and that the female always produces one new pair (one male, one female) every month from the second month on. The puzzle that Fibonacci posed was... How many pairs do we have after one year?

More on Fibonacci

Golden Section

x y x

Phi

x y

x (^) y

Back to Math...

Whenever n >= 3 we have that F(n) > phi^(n-2) phi = golden section, F(n) = Fibonacci number. prove by induction:

  1. First check by hand that its true for n=3 and n=4.
  2. Assume for some j: F(j) > phi^(j-2) We use that phi^2 = phi + 1 (check it) F(j+1) = F(j) + F(j-1) >? phi^(j-1) (to be shown) F(j) + F(j-1) >! phi^(j-2) + phi^(j-3) (induction) = phi^(j-3) (phi + 1) = phi^(j-3) phi^2 (property phi) = phi^(j-1) 

Recursively defined sets

Strings: S = set of strings A = alphabet Basic step: empty string is in S Recursive step: if w is in S and x in A  wx is in S Example: binary strings: A={0,1}

  1. empty string
  2. 0 & 1
  3. 00 & 01 & 10 & 11
  4. ...

Recursive Definitions

From definition 3 & examples 9,10,11 are not required. Rooted Trees: A rooted tree has vertices, a distinguished vertex called the root and edges which connect the vertices. Basic Step: A single vertex is a rooted tree. Recursive Step: Suppose T1,...,Tn,... are rooted trees with roots r1,....rn,... If we start with a new root r and connect this root to any of the existing roots r1,...rn,... with a new edge, we construct a new rooted tree. basis step: Step 1: ... Step 2: already exists etc. Trees are often very important data-structures for instance to search and sort data.

Binary Trees

Full binary Trees : Only difference in the Basic Step: Basic Step : A single vertex is a full binary tree. Recursive Step : As in extended binary trees. The result is that you cannot attach the empty set on the left or the right. BASIC: Step 1: