lec13-recursive

# lec13-recursive - EECS 203 Winter 2007 Discrete Mathematics...

• Notes
• 6

This preview shows pages 1–6. Sign up to view the full content.

EECS 203, Winter 2007 Discrete Mathematics Lecture 13 Recursive structures February 15 Reading: Rosen [4.3] February 15 Recursive structures, Page 1

This preview has intentionally blurred sections. Sign up to view the full version.

13.1 More inductions Critical steps in applying induction: The number to do induction on. Reduce k + 1 case to k case. Example. Suppose a m,n is defined as follows: a 0 , 0 = 0 , a m,n = a m - 1 ,n + 1 if n = 0 and m > 0 a m,n - 1 + n otherwise. Prove that a m,n = m + n ( n + 1) / 2 for all m, n N . Proof: Induction on m + n . February 15 Recursive structures, Page 2
13.2 Fibonacci numbers f 0 = 0, f 1 = 1, f n = f n - 1 + f n - 2 , n 2 . Proposition. f n = φ n - (1 - φ ) n 5 , where φ = 1+ 5 2 1 . 618 ... is the golden ratio. February 15 Recursive structures, Page 3

This preview has intentionally blurred sections. Sign up to view the full version.

13.3 Rooted trees A rooted tree is a tree with a vertex designated as the root and is defined recursively as follows: 1. A single vertex v is a rooted tree, with the root v . 2. If T 1 , · · · , T n are disjoint rooted trees with roots r 1 , · · · , r n , then the graph T formed by starting with an additional vertex r and adding an edge between r to r i , i = 1 ...n , is also a rooted

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: tree with the root r . Each T i is called a subtree of T , and each r i is a child of r , and r is a parent of r i . A binary tree is a rooted tree of which each vertex has no more than 2 children. A full binary tree is a binary tree of which each vertex has either 0 or 2 children. The height h ( T ) of a rooted tree T is 1. 0 if T consists of a single vertex; February 15 Recursive structures, Page 4 13.3 Rooted trees 2. max { h ( T i ) : i = 1 ...n } + 1 if T 1 ...T n are subtrees of v . Fact. If T is a binary tree with n vertices, then n ≤ 2 h ( T )+1-1. February 15 Recursive structures, Page 5 13.4 Lower bound for sorting Theorem. Any sorting algorithm based on pair-wise comparisons must compare ≥ n log 2 n-cn times, for some constant c > 0 to sort n numbers. February 15 Recursive structures, Page 6...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern