and Structural Induction II

Slides:



Advertisements
Similar presentations
What is the sum of the following infinite series 1+x+x2+x3+…xn… where 0
Advertisements

Number Sequences Lecture 5 (chapter 4.1 of the book and chapter 9 of the notes) ? overhang.
11.4 – Infinite Geometric Series. Sum of an Infinite Geometric Series.
Number Sequences Lecture 7: Sep 28 (chapter 4.1 of the book and chapter 9 of the notes) ? overhang.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2009 Heap Lecture Chapter 6 Use NOTES feature to see explanation.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2007 Heap Lecture Chapter 6 Use NOTES feature to see explanation.
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.
Aim: What are the arithmetic series and geometric series? Do Now: Find the sum of each of the following sequences: a)
Number Sequences Lecture 7: Sep 29 ? overhang. This Lecture We will study some simple number sequences and their properties. The topics include: Representation.
State whether the sequence below is arithmetic, geometric or neither and then write the explicit definition of the sequence. 3, 7, 11, 15...
THE BEST CLASS EVER…ERRR…. PRE-CALCULUS Chapter 13 Final Exam Review.
Sequences and Series By: Olivia, Jon, Jordan, and Jaymie.
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
Number Sequences ? overhang. This Lecture We will study some simple number sequences and their properties. The topics include: Representation of a sequence.
Notes 9.4 – Sequences and Series. I. Sequences A.) A progression of numbers in a pattern. 1.) FINITE – A set number of terms 2.) INFINITE – Continues.
12.4 – Find Sums of Infinite Geometric Series. Think about this… What will happen when n becomes really big? It will get closer and closer to zero.
Series Ch. 13.
13.3 – Arithmetic and Geometric Series and Their Sums Objectives: You should be able to…
Mathematical Background and Linked Lists. 2 Iterative Algorithm for Sum Find the sum of the first n integers stored in an array v : sum (v[], n) temp_sum.
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.
Recursion Algorithm : Design & Analysis [3]. In the last class… Asymptotic growth rate The Sets ,  and  Complexity Class An Example: Maximum Subsequence.
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.
Copyright © 2011 Pearson, Inc. 9.5 Series Goals: Use sigma notation to find the finite sums of terms in arithmetic and geometric sequences. Find sums of.
{ 12.3 Geometric Sequence and Series SWBAT evaluate a finite geometric series SWBAT evaluate infinite geometric series, if it exists.
13.3 Arithmetic and Geometric Series and Their Sums Finite Series.
Trees CSIT 402 Data Structures II 1. 2 Why Do We Need Trees? Lists, Stacks, and Queues are linear relationships Information often contains hierarchical.
Arithmetic vs. Geometric Sequences and how to write their formulas
Number Sequences Lecture 7: Sep 27 (chapter 4.1 of the book and chapter of the notes) ? overhang.
Copyright © 2012 Pearson Education, Inc. Publishing as Addison Wesley CHAPTER 8: Sequences, Series, and Combinatorics 8.1 Sequences and Series 8.2 Arithmetic.
Inductive Proof (the process of deriving generalities from particulars) Mathematical Induction (reasoning over the natural numbers)
11.3 – Geometric Sequences and Series
13.3 – Arithmetic and Geometric Series and Their Sums
Red-Black Trees Bottom-Up Deletion.
Aim: What is the geometric series ?
Mathematical Induction Recursion
Mathematics for Computer Science MIT 6.042J/18.062J
Sequences, Induction, & Probability
Mathematics for Computer Science MIT 6.042J/18.062J
Asymptotics & Stirling’s Approximation
Unit 1 Test #3 Study Guide.
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
Homework Lesson 8.3 Page #1-17 (EOO), (ODD),
Mathematics for Computer Science MIT 6.042J/18.062J
and Structural Induction II
ex. 2, 7, 12, 17, 22, 27 5 is the common difference. an+1 = an + d
and Structural Induction
and Structural Induction II
Mathematics for Computer Science MIT 6.042J/18.062J
Mathematics for Computer Science MIT 6.042J/18.062J
and Structural Induction
and Structural Induction
Computational Processes II
Asymptotics & Stirling’s Approximation
Mathematics for Computer Science MIT 6.042J/18.062J
Asymptotics & Stirling’s Approximation
Truth and Proof Math vs. Reality Propositions & Predicates
Asymptotics & Stirling’s Approximation
Math/CSE 1019: Discrete Mathematics for Computer Science Fall 2011
and Structural Induction
Geometric Sequences and Series
Tutorial 2 - Daniel Razavi
11.4 Mathematical Induction
Recursion 1. The computer science equivalent of mathematical induction. 2. A way of defining something in terms of itself. 3. Ex. f(n) = 1,
Unit 13 Pretest.
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

Finite-Path Trees with 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

Proof by structural induction on def. of FP Finite-Path Trees Proof by structural induction on def. of FP 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

Mathematics for Computer Science MIT 6.042J/18.062J Sums, Products & Asymptotics Copyright © Albert Meyer, 2002. Prof. Albert Meyer & Dr. Radhika Nagpal

C. F. Gauss Picture source: http://www-groups.dcs.st-and.ac.uk/~history/PictDisplay/Gauss.html

Sum for children 8900 + 9003 + 9106 + 9209 + 9312 + 9415 + … 9930 + … 10,445 + 10,960 + … +11,372

Sum for children Nine-year old Gauss (so the story goes) saw that each number was 103 greater than the previous one.

Sum for children 8900 + (8900 + 103) + (8900 + 2(103)) + (8900 + 3(103)) + … + (8900 + 24(103)) = 8900(25) + 103(1 + 2 + 3 + … + 24)

Arithmetic Series A ::= 1 + 2 + … + (n-1) + n

A ::= 1 + 2 + … + (n-1) + n A = 1 + 2 + … + (n-1) + n Arithmetic Series A ::= 1 + 2 + … + (n-1) + n A = 1 + 2 + … + (n-1) + n

A ::= 1 + 2 + … + (n-1) + n A = n + (n-1) + … + 2 + 1 Arithmetic Series A ::= 1 + 2 + … + (n-1) + n A = n + (n-1) + … + 2 + 1

2A =(n+1)+(n+1) + … + (n+1) + (n+1) Arithmetic Series A ::= 1 + 2 + … + (n-1) + n A = ------------------------------------------------ n + (n-1) + … + 2 + 1 2A =(n+1)+(n+1) + … + (n+1) + (n+1)

2A =(n+1)+(n+1) + … + (n+1) + (n+1) Arithmetic Series A ::= 1 + 2 + … + (n-1) + n A = ------------------------------------------------ n + (n-1) + … + 2 + 1 2A =(n+1)+(n+1) + … + (n+1) + (n+1) = n(n+1)

Arithmetic Series So

Geometric Series

Geometric Series

Geometric Series

Geometric Series 1 - xn+1

Geometric Series n+1

The future value of $$. I will promise to pay you $100 Annuities The future value of $$. I will promise to pay you $100 in exactly one year, if you will pay me $X now.

X = $100/1.03 ≈ $97.09 My bank will pay me 3% interest. Annuities My bank will pay me 3% interest. I can’t lose if you pay me: X = $100/1.03 ≈ $97.09

97.09¢ today is worth $1.00 in a year Annuities 97.09¢ today is worth $1.00 in a year $1.00 in a year is worth $1/1.03 today $n in a year is worth $nr today, where r = 1/1.03

$n in two years is worth $nr2 today $n in k years is worth $nrk today Annuities $n in two years is worth $nr2 today $n in k years is worth $nrk today

I will pay you $100/year for 10 years If you will pay me $Y now. Annuities I will pay you $100/year for 10 years If you will pay me $Y now. I can’t lose if you pay me 100r + 100r2 + 100r3 + … + 100r10 =100r(1+ r + … + r9) = 100r(1-r10)/(1-r) = $853.02

In-Class Problem Problems 3 & 4