and Structural Induction II

Slides:



Advertisements
Similar presentations
§6 Leftist Heaps CHAPTER 5 Graph Algorithms  Heap: Structure Property + Order Property Target : Speed up merging in O(N). Leftist Heap: Order Property.
Advertisements

1 Union-find. 2 Maintain a collection of disjoint sets under the following two operations S 3 = Union(S 1,S 2 ) Find(x) : returns the set containing x.
QuickSort Average Case Analysis An Incompressibility Approach Brendan Lucier August 2, 2005.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2009 Heap Lecture Chapter 6 Use NOTES feature to see explanation.
CS 206 Introduction to Computer Science II 09 / 22 / 2008 Instructor: Michael Eckmann.
A tree is a simple graph satisfying: if v and w are vertices and there is a path from v to w, it is a unique simple path. a b c a b c.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2007 Heap Lecture Chapter 6 Use NOTES feature to see explanation.
Prof. Busch - LSU1 Pumping Lemma for Context-free Languages.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Heap Lecture 2 Chapter 7 Wed. 10/10/01 Use NOTES feature to.
Sequences and Series (T) Students will know the form of an Arithmetic sequence.  Arithmetic Sequence: There exists a common difference (d) between each.
Data Structures - CSCI 102 Binary Tree In binary trees, each Node can point to two other Nodes and looks something like this: template class BTNode { public:
UNCA CSCI September, 2001 These notes were prepared by the text’s author Clifford A. Shaffer Department of Computer Science Virginia Tech Copyright.
CSE 311 Foundations of Computing I Lecture 16 Recursively Defined Sets and Structural Induction Spring
4.8 Huffman Codes These lecture slides are supplied by Mathijs de Weerd.
Copyright © Cengage Learning. All rights reserved. CHAPTER 10 GRAPHS AND TREES.
Data Structure & Algorithm II.  Delete-min  Building a heap in O(n) time  Heap Sort.
CompSci 100e Program Design and Analysis II March 29, 2011 Prof. Rodger CompSci 100e, Spring20111.
Prof. Busch - LSU1 Mathematical Preliminaries. Prof. Busch - LSU2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Preview  Graph  Tree Binary Tree Binary Search Tree Binary Search Tree Property Binary Search Tree functions  In-order walk  Pre-order walk  Post-order.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Recursive Data Structures and Grammars  Themes  Recursive Description of Data Structures  Recursive Definitions of Properties of Data Structures  Recursive.
1 Mathematical Preliminaries. 2 Sets Functions Relations Graphs Proof Techniques.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Chapter 6 – Trees. Notice that in a tree, there is exactly one path from the root to each node.
Trees CSIT 402 Data Structures II 1. 2 Why Do We Need Trees? Lists, Stacks, and Queues are linear relationships Information often contains hierarchical.
Complexity and Computability Theory I Lecture #12 Instructor: Rina Zviel-Girshin Lea Epstein.
CSE 373 Data Structures Lecture 7
11.7 – Proof by Mathematical Induction
CC 215 Data Structures Trees
Red-Black Trees Bottom-Up Deletion.
CSE 373 Data Structures Lecture 7
Red-Black Trees Bottom-Up Deletion.
Mathematics for Computer Science MIT 6.042J/18.062J
CSE 311: Foundations of Computing
Mathematics for Computer Science MIT 6.042J/18.062J
Computational Processes
Mathematics for Computer Science MIT 6.042J/18.062J
Trees CSE 373 Data Structures.
Asymptotics & Stirling’s Approximation
Red-Black Trees Bottom-Up Deletion.
Computational Processes II
Asymptotics & Stirling’s Approximation
Mathematics for Computer Science MIT 6.042J/18.062J
Mathematics for Computer Science MIT 6.042J/18.062J
Mathematics for Computer Science MIT 6.042J/18.062J
Ch. 12: Binary Search Trees
and Structural Induction II
Mathematics for Computer Science MIT 6.042J/18.062J
and Structural Induction II
and Structural Induction
Mathematics for Computer Science MIT 6.042J/18.062J
Red-Black Trees Bottom-Up Deletion.
Mathematics for Computer Science MIT 6.042J/18.062J
Half-Angle Identities
and Structural Induction
and Structural Induction
Computational Processes II
Computational Processes
Asymptotics & Stirling’s Approximation
Mathematics for Computer Science MIT 6.042J/18.062J
Asymptotics & Stirling’s Approximation
Red-Black Trees Bottom-Up Deletion.
Asymptotics & Stirling’s Approximation
Math/CSE 1019: Discrete Mathematics for Computer Science Fall 2011
and Structural Induction
Trees CSE 373 Data Structures.
Trees CSE 373 Data Structures.
11.4 Mathematical Induction
Presentation transcript:

and Structural Induction II Mathematics for Computer Science MIT 6.042J/18.062J Recursive Definitions and Structural Induction II Copyright © Albert Meyer, 2002. Prof. Albert Meyer & Dr. Radhika Nagpal

… Single node is a rooted tree If t1, t2, …, tn are RTs, so is: t1 t2 Rooted Trees Single node is a rooted tree If t1, t2, …, tn are RTs, so is: … t1 t2 tn

Rooted Trees In scheme: (((())()())((())())((()))(()(()())))

Structural vs Ordinary Induction Structural Induction on Rooted Trees reduces to Strong Induction on SIZE of subtrees. But what is the "size" of the COSINE function? Data objects may be infinite: The 18.01 Functions

Structural vs Ordinary Induction For 18.01F, replace structural induction by induction on number of steps to construct an object . Function no. of steps x, sin(x), cos(x), ex : 1 log(x) [inverse,ex] 2 cos(log(x)) [cos,log,compose] 4 x ·cos(log(x)) [id,times,] 6

Structural vs Ordinary Induction derivation tree for x ·cos(log(x)) * x cos(log x) x  cos(log x) cos inv log ex

Structural vs Ordinary Induction But Structural Induction also applies to Infinite Trees

… … … … … Infinitely wide Game Tree for Problem 1 (0,0) (0,1) (1,0) (1,1) (0,2) (2,0) (1,2) (2,1) … … (0,0) (0,0) … … (0,0) (0,1) (0,2) (0,1) (0,2) Infinitely wide

In-Class Problem Problem 1

… … Single node is an FP tree If t1, t2, …, tn are FPs, so is: t1 t2 Finite-Path Trees Single node is an FP tree If t1, t2, …, tn are FPs, so is: … … t1 t2 tn May have infinitely many subtrees

With finitely many nodes Finite-Path Trees Rooted Trees are Finite-Path Trees With finitely many nodes

Finite-Path Trees … …

Finite-Path Trees … …

Finite-Path Trees: Unboundedly Deep

Finite-Path Trees: Wide & Deep

But every downward path in an FP eventually stops Finite-Path Trees But every downward path in an FP eventually stops

Proof by structural induction on def. Of FP Finite-Path Trees Proof by structural induction on def. Of FP Base Case (t is one node): Has only a 0 length path Induction Step (t has subtrees): Assume in subtrees all down paths are finite. Now path from root of t goes to root of subtree. Rest of the path in subtree must be finite by induction. QED

In-Class Problem Problem 2