CPSC 121: Models of Computation 2008/9 Winter Term 2

Slides:



Advertisements
Similar presentations
Trees Chapter 11.
Advertisements

22C:19 Discrete Structures Induction and Recursion Spring 2014 Sukumar Ghosh.
Introduction to Computer Science 2 Lecture 7: Extended binary trees
22C:19 Discrete Structures Induction and Recursion Fall 2014 Sukumar Ghosh.
Recursive Definitions and Structural Induction
22C:19 Discrete Structures Trees Spring 2014 Sukumar Ghosh.
Algorithms Recurrences. Definition – a recurrence is an equation or inequality that describes a function in terms of its value on smaller inputs Example.
Discrete Structure Li Tak Sing( 李德成 ) Lectures
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 Introduction to Induction Steve Wolfman 1.
CPSC 121: Models of Computation
Snick  snack CPSC 121: Models of Computation 2009 Winter Term 1 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Snick  snack CPSC 121: Models of Computation 2009 Winter Term 1 Introduction to Induction Steve Wolfman 1.
Parallel Prefix Computation Advanced Algorithms & Data Structures Lecture Theme 14 Prof. Dr. Th. Ottmann Summer Semester 2006.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Propositional Logic: Conditionals and Logical Equivalence Steve Wolfman, based on notes.
Advanced Topics in Algorithms and Data Structures 1 Lecture 4 : Accelerated Cascading and Parallel List Ranking We will first discuss a technique called.
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Accelerated Cascading Advanced Algorithms & Data Structures Lecture Theme 16 Prof. Dr. Th. Ottmann Summer Semester 2006.
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
CS2420: Lecture 27 Vladimir Kulyukin Computer Science Department Utah State University.
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 3 Recurrence equations Formulating recurrence equations Solving recurrence equations.
Lecture 19 Exam: Tuesday June15 4-6pm Overview. General Remarks Expect more questions than before that test your knowledge of the material. (rather then.
1 Recitation 10. Induction Introduction. Induction is useful in proving properties of recursive algorithms, like their execution times. It is also the.
Advanced Topics in Algorithms and Data Structures Page 1 An overview of lecture 3 A simple parallel algorithm for computing parallel prefix. A parallel.
3/10/03Tucker, Sec.3-51 Tucker, Applied Combinatorics, Sec. 3.5, Jo E-M “Big O” Notation We say that a function is if for some constant c, when n is large.
General Info Check out gilgarn.org. QUIZ DO YOU: – Love CSC 171 ? – Want a job? – Like to exert power over others? – Want to improve CSC UR?
Induction and recursion
Fundamental Structures of Computer Science March 02, 2006 Ananda Guna Binomial Heaps.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 9b: Mathematical Induction - part 2.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Review Midterm.
Binary Trees. Binary Tree Finite (possibly empty) collection of elements A nonempty binary tree has a root element The remaining elements (if any) are.
Snick  snack CPSC 121: Models of Computation 2013W2 Introduction to Induction Steve Wolfman 1.
CPSC 121: Models of Computation Unit 0 Introduction George Tsiknis Based on slides by Patrice Belleville and Steve Wolfman.
5.5.3 Rooted tree and binary tree  Definition 25: A directed graph is a directed tree if the graph is a tree in the underlying undirected graph.  Definition.
Proofs, Induction and Recursion Basic Proof Techniques Mathematical Induction Recursive Functions and Recurrence Relations.
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Introduction to Induction Steve Wolfman 1.
Recursive Data Structures and Grammars  Themes  Recursive Description of Data Structures  Recursive Definitions of Properties of Data Structures  Recursive.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 3.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Recursive Data Structures and Grammars  Themes  Recursive Description of Data Structures  Recursive Definitions of Properties of Data Structures  Recursive.
CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction Linda Shapiro Winter 2015.
1 CMSC 250 Chapter 4, Summations and Products. 2 CMSC 250 Induction l Induction is a proof technique used to verify a property of a sequence –2,4,6,8,…
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Sorting Lower Bounds n Beating Them. Recap Divide and Conquer –Know how to break a problem into smaller problems, such that –Given a solution to the smaller.
DAST Tirgul 6. What is a Binary Search Tree? The keys in a binary search tree (BST) are always stored in such a way as to satisfy the search property:
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Trees.
CPSC 121: Models of Computation 2008/9 Winter Term 2
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CPSC 121: Models of Computation 2008/9 Winter Term 2
CS 3343: Analysis of Algorithms
CS2210:0001Discrete Structures Induction and Recursion
CPSC 121: Models of Computation
Algorithm : Design & Analysis [4]
CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction
CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction
Multi-Way Search Trees
Advance Analysis of Lecture No 9 Institute of Southern Punjab Multan
CPSC 121: Models of Computation 2013W2
Fundamental Structures of Computer Science
Recurrences (Method 4) Alexandra Stefan.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Trevor Brown CS 341: Algorithms Trevor Brown
Algorithms Recurrences.
Presentation transcript:

CPSC 121: Models of Computation 2008/9 Winter Term 2 Introduction to Induction Steve Wolfman

Lecture Prerequisites Read Section 4.1. Note: 4.1 is background information. We don’t intend to directly assess this material, but assignment and exam questions may require skills and knowledge from 4.1 to answer. Solve problems like Exercise Set 4.1, #1-8, 12-14, 18-31, 37-44, 52-60. Complete the open-book, untimed quiz on Vista that’s due before the next class.

Learning Goals: Pre-Class By the start of class, you should be able to: Convert sequences to and from explicit formulas that describe the sequence. Convert sums to and from summation/”sigma” notation. Convert products to and from product/”pi” notation. Manipulate formulas in summation/product notation by adjusting their bounds, merging or splitting summations/products, and factoring out values.

Learning Goals: In-Class By the end of this unit, you should be able to: Establish properties of self-referential structures using inductive proofs that naturally build on those self-references. Discuss point of learning goals.

Problem: Single-Elimination Tournaments In a single-elimination tournament, during each round pairs of teams play each other, with the losing team eliminated from the tournament. The tournament ends when only one team remains. Problem 1: Determine the maximum number of teams in an n-round single-elimination tournament. Problem 2: Prove your result.

Problem: Number of Nodes in a Binary Tree A “binary tree” is a root “node” and a collection of “child nodes” beneath the root. Each node is an object that has up to two children—a left child and a right child—each of which are themselves binary trees. A binary tree’s “height” is the maximum number of steps it takes to get from the root down to a node with no children. Problem 1: What’s the maximum number of nodes in a binary tree of height n? Problem 2: Prove your result.

Problem: Binary Trees, Take Two Problem 1: Give an algorithm to determine the height of a binary tree. Problem 2: Prove that your algorithm is correct.

An Induction Proof Pattern Type of Problem: Prove some property of a structure that is naturally defined in terms of itself. Part 1: Insight. Induction doesn’t help you with this part. It is not a technique to figure out patterns, only to prove them. Part 2: Proof. Establish that the property holds for simple structures. Establish that it holds at each step of construction of a more complex structure.

Natural Numbers and Induction Can we prove things about the natural numbers using induction? Are they “self-referential”? Let’s try one... Problem: What is the sum of the natural numbers 0..n?

Partly Worked Problem: Sum of 0..n Partly Worked Problem: What is the sum of the natural numbers 0..n? Insight: It’s n(n+1)/2. Now, how do we prove it?

Partly Worked Problem: Sum of 0..n Partly Worked Problem: Prove that the sum of the natural numbers 0..n is n(n+1)/2. Is this self-referential? If we knew the sum of the numbers 0..(n-1), would it tell us anything about the sum of the numbers 0..n?

Learning Goals: In-Class By the end of this unit, you should be able to: Establish properties of self-referential structures using inductive proofs that naturally build on those self-references. Note: this learning goal is not yet looking for formal inductive proofs. Instead, we’re just exploring how we work with things that are defined in terms of themselves. Discuss point of learning goals.

Next Lecture Learning Goals: Pre-Class By the start of class, you should be able to: Given a theorem to prove stated in terms of its induction variable (i.e., usually, in terms of n), write out the skeleton of an inductive proof including: the base case(s) that need to be proven, the induction hypothesis, and the inductive step that needs to be proven. In other words, take what we did in this lecture and use the textbook readings to formalize your understanding. We will have much more practice on inductive proofs. Discuss point of learning goals.

Next Lecture Prerequisites Read Section 4.2-4.4. Solve (or at least “set up”, by writing the base case(s) that need to be proved, the induction hypothesis, and the inductive step that needs to be proved) problems like Exercise Set 4.2 #1-2, 5-17, and 31; 4.3 #1, 8-27, 29, and 30-31, and 4.4 #1-7, 9-10, and 24. Solve problems like Exercise Set 4.2 #3-4 and 32, 4.3 #6-7 and 30-31, and 4.4 #17. Complete the open-book, untimed quiz on WebCT that’s due before the next class.