Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.

Slides:



Advertisements
Similar presentations
Week 6 - Wednesday CS322.
Advertisements

Discrete Structures Chapter 6: Set Theory
Discrete Mathematics I Lectures Chapter 6
Prof. Johnnie Baker Module Basic Structures: Sets
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
Instructor: Hayk Melikya
(CSC 102) Discrete Structures Lecture 14.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built.
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
Week 5 - Friday.  What did we talk about last time?  Sequences  Summation and production notation  Proof by induction.
Denoting the beginning
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
Discrete Mathematics Lecture 4 Harper Langston New York University.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Discrete Mathematics Lecture 5
Sets 1.
Sets 1.
1 Set Theory. 2 Set Properties Commutative Laws: Associative Laws: Distributive Laws:
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
Week 8 - Wednesday.  What did we talk about last time?  Cardinality  Countability  Relations.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
Applied Discrete Mathematics Week 9: Relations
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Solving Second-Order Recursive Relations Lecture 36 ½ Section 8.3 Wed, Apr 19, 2006.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Sets Defined A set is an object defined as a collection of other distinct objects, known as elements of the set The elements of a set can be anything:
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
1 ENM 503 Block 1 Algebraic Systems Lesson 2 – The Algebra of Sets The Essence of Sets What are they?
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Discrete Structure Sets. 2 Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element.
Week 7 - Monday.  What did we talk about last time?  Sets.
Mathematical Proofs. Chapter 1 Sets 1.1 Describing a Set 1.2 Subsets 1.3 Set Operations 1.4 Indexed Collections of Sets 1.5 Partitions of Sets.
CS201: Data Structures and Discrete Mathematics I
1. Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element of A” A = {a 1, a 2,
CompSci 102 Discrete Math for Computer Science
Copyright © Cengage Learning. All rights reserved.
Chapter 2 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
Chapter 8 Recursion. 8.3 More Recurrence Second-Order Recurrence Definition – A second-order linear homogeneous recurrence relation with constant coefficients.
Chapter 2 With Question/Answer Animations. Section 2.1.
Discrete Mathematics. Set Theory - Definitions and notation A set is an unordered collection of elements. Some examples: {1, 2, 3} is the set containing.
Review 2 Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by lower.
Agenda Lecture Content:  Recurrence Relations  Solving Recurrence Relations  Iteration  Linear homogenous recurrence relation of order k with constant.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
Section 6.1 Set and Set Operations. Set: A set is a collection of objects/elements. Ex. A = {w, a, r, d} Sets are often named with capital letters. Order.
Set. Outline Universal Set Venn Diagram Operations on Sets.
The Language of Sets If S is a set, then
Set Theory.
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
Week 7 - Monday CS322.
CS100: Discrete structures
Set Operations Section 2.2.
Discrete Mathematics CS 2610
Presentation transcript:

Week 6 - Friday

 What did we talk about last time?  Solving recurrence relations

 This is a donkey made of toothpicks  Move exactly one toothpick to make an identical donkey oriented in another direction

Student Lecture

 Second-order linear homogeneous relations with constant coefficients are recurrence relations of the following form:  a k = Aa k-1 + Ba k-2 where A, B  R and B  0  These relations are:  Second order because they depend on a k-1 and a k-2  Linear because a k-1 and a k-2 are to the first power and not multiplied by each other  Homogeneous because there is no constant term  Constant coefficients because A and B are fixed values

 I'm sure you're thinking that this is an awfully narrow class of recurrence relations to have special rules for  It's true: There are many (infinitely many) ways to formulate a recurrence relation  Some have explicit formulas  Some do not have closed explicit formulas  We care about this one partly for two reasons 1. We can solve it 2. It lets us get an explicit formula for Fibonacci!

 Which of the following are second-order linear homogeneous recurrence relations with constant coefficients? a) a k = 3a k-1 + 2a k-2 b) b k = b k-1 + b k-2 + b k-3 c) c k = (1/2)c k-1 – (3/7)c k-2 d) d k = d 2 k-1 + d k-1 d k-2 e) e k = 2e k-2 f) f k = 2f k g) g k = g k-1 + g k-2 h) h k = (-1)h k-1 + (k-1)h k-2

 We will use a tool to solve a SOLHRRwCC called its characteristic equation  The characteristic equation of a k = Aa k-1 + Ba k-2 is:  t 2 – At – B = 0 where t  0  Note that the sequence 1, t, t 2, t 3, …, t n satisfies a k = Aa k-1 + Ba k-2 if and only if t satisfies t 2 – At – B = 0

 We can see that 1, t, t 2, t 3, …, t n satisfies a k = Aa k-1 + Ba k-2 if and only if t satisfies t 2 – At – B = 0 by substituting in t terms for a k as follows:  t k = At k-1 + Bt k-2  Since t  0, we can divide both sides through by t k-2  t 2 = At + B  t 2 – At – B = 0

 Consider a k = a k-1 + 2a k-2  What is its characteristic equation?  t 2 – t – 2 = 0  What are its roots?  t = 2 and t = -1  What are the sequences defined by each value of t?  1, 2, 2 2, 2 3, …, 2 n, …  1, -1, 1, -1, …, (-1) n, …  Do these sequences satisfy the recurrence relation?

 An infinite number of sequences satisfy the recurrence relation, depending on the initial conditions  If r 0, r 1, r 2, … and s 0, s 1, s 2, … are sequences that satisfy the same SOLHRRwCC, then, for any C, D  R, the following sequence also satisfies the SOLHRRwCC  a n = Cr n + Ds n, for integers n ≥ 0

 Solve the recurrence relation a k = a k-1 + 2a k-2 where a 0 = 1 and a 1 = 8  The result from the previous slide says that, for any sequence r k and s k that satisfy a k  a n = Cr n + Ds n, for integers n ≥ 0  We have these sequences that satisfy a k  1, 2, 2 2, 2 3, …, 2 n, …  1, -1, 1, -1, …, (-1) n, …  Thus, we have  a 0 = 1 = C2 0 + D(-1) 0 = C + D  a 1 = 8 = C2 1 + D(-1) 1 = 2C – D  Solving for C and D, we get:  C = 3  D = -2  Thus, our final result is an = 3∙2 n – 2(-1) n

 We can generalize this result  Let sequence a 0, a 1, a 2, … satisfy:  a k = Aa k-1 + Ba k-2 for integers k ≥ 2  If the characteristic equation t 2 – At – B = 0 has two distinct roots r and s, then the sequence satisfies the explicit formula:  a n = Cr n + Ds n  where C and D are determined by a 0 and a 1

 Fibonacci is defined as follows:  F k = F k-1 + F k-2, k ≥ 2  F 0 = 1  F 1 = 1  What is its characteristic equation?  t 2 – t – 1 = 0  What are its roots?  Thus,

 So, we plug in F 0 = 1 and F 1 = 1  Solving for C and D, we get  Substituting in, this yields

 Our previous technique only works when the characteristic equation has distinct roots r and s  Consider sequence a k = Aa k-1 + Ba k-2  If t 2 – At – B = 0 only has a single root r, then the following sequences both satisfy a k  1, r 1, r 2, r 3, … r n, …  0, r, 2r 2, 3r 3, … nr n, …

 Our old rule said that if r 0, r 1, r 2, … and s 0, s 1, s 2, … are sequences that satisfy the same SOLHRRwCC, then, for any C, D  R, the following sequence also satisfies the SOLHRRwCC  a n = Cr n + Ds n, for integers n ≥ 0  For the single root case, this means that the explicit formula is:  a n = Cr n + Dnr n, for integers n ≥ 0  where C and D are determined by a 0 and a 1

 To solve sequence a k = Aa k-1 + Ba k-2  Find its characteristic equation t 2 – At – B = 0  If the equation has two distinct roots r and s  Substitute a 0 and a 1 into a n = Cr n + Ds n to find C and D  If the equation has a single root r  Substitute a 0 and a 1 into a n = Cr n + Dnr n to find C and D

 For example, we can define sets recursively  To do so, we need three things: I. Base: A statement of that certain things are in the set II. Recursion: A set of rules saying how new objects can be shown to be in the set based on ones that are already known to be in the set III. Restriction: A statement that no objects belong to the set other than those coming from I and II

 The set P of all strings of legal parenthesizations I. Base: () is in P II. Recursion: a. If E is in P, so is (E) b. If E and F are in P, so is E F III. Restriction: No configurations of parentheses are in P other than those derived from I and II

 Even functions can be defined recursively  The Ackermann function is famous because it grows faster than any algebraic function  It is defined for all non-negative integers as follows:  A(0,n) = n + 1  A(m,0) = A(m – 1, 1)  A(m,n) = A(m – 1, A(m,n – 1))  Find A(1,2)  I won't make you find A(4,4), because it is roughly

 A set is a collection of elements  The set is defined entirely by its elements  Order doesn't matter  Repetitions don't matter (but, in general, we write each element of set only a single time)  Examples  { 1, 4, 9, 25 }  { 1 } is not the same as 1  { } is the empty set

 For a finite set, we can write all of the elements inside curly braces  For infinite sets, we don't have that luxury  What's in each of the following sets?  A = { x  R | -3 < x < 4 }  B = { x  Z | -3 < x < 4 }  C = { x  Z + | -3 < x < 4 }  D = { x  Q | -3 < x < 4 }

 Perhaps the simplest relationship between sets is the subset relationship  We say that X is a subset of Y iff every element of X is an element of Y  Notation X  Y  Examples:  Is { 1, 2, 3 }  { 1, 2, 3, 4 } ?  Is { 1, 2, 3, 4 }  { 1, 2, 3 } ?  Is { 1, 2, 3 }  { 1, 2, 3 } ?  Is { }  { 1, 2, 3 } ?  Is { {1}, {2}, {3} }  { 1, 2, 3 } ?

 We say that X is a proper subset of Y iff every element of X is an element of Y, but there is some element of Y that is not an element of X  Notation X  Y  Examples:  Is { 1, 2, 3 }  { 1, 2, 3, 4 } ?  Is { 1, 2, 3, 4 }  { 1, 2, 3 } ?  Is { 1, 2, 3 }  { 1, 2, 3 } ?  Is { }  { 1, 2, 3 } ?  Is { {1}, {2}, {3} }  { 1, 2, 3 } ?

 Venn diagrams show relationships between sets  They can help build intuition about relationships, but they do not prove anything  Also, their usefulness is limited to 2 or 3 sets  Beyond that, they become difficult to interpret  Example: For X  Y, there are 3 possibilities: X X Y Y X X Y Y X X Y Y

 The idea of being an element of a set is strongly tied to the idea of one set being the subset of another  These two relationships are different, however  x  X means that x is an element of X  Y  X means that Y is a subset of X  Which of the following are true?  2  {1, 2, 3}  {2}  {1, 2, 3}  2  {1, 2, 3}  {2}  {1, 2, 3}  {2}  {{1}, {2}}  {2}  {{1}, {2}}

 We say that two sets are equal if they contain exactly the same elements  Another way of saying this is that X = Y iff X  Y and Y  X  Examples:  A = { n  Z | n = 2p, p  Z }  B = the set of all even integers  C = { m  Z | m = 2q – 2, q  Z }  D = { k  Z | k = 3r + 1, r  Z }  Does A = B?  Does A = C?  Does A = D?

 We usually discuss sets within some superset U called the universe of discourse  Assume that A and B are subsets of U  The union of A and B, written A  B is the set of all elements of U that are in either A or B  The intersection of A and B, written A  B is the set of all elements of U that are in A and B  The difference of B minus A, written B – A, is the set of all elements of U that are in B and not in A  The complement of A, written A c is the set of all elements of U that are not in A

 Let U = {a, b, c, d, e, f, g}  Let A = {a, c, e, g}  Let B = {d, e, f, g}  What are: A  BA  B A  BA  B  B – A AcAc

 There is a set with no elements in it called the empty set  We can write the empty set { } or   It comes up very often  For example, {1, 3, 5}  {2, 4, 6} =   The empty set is a subset of every other set (including the empty set)

 Two sets A and B are considered disjoint if A  B =   Sets A 1, A 2, … A n are mutually disjoint (or nonoverlapping) if A i  A j =  for all i  j  A collection of nonempty sets {A 1, A 2, … A n } is a partition of set A iff: 1. A = A 1  A 2  …  A n 2. A 1, A 2, … A n are mutually disjoint

 Given a set A, the power set of A, written P (A) or 2 A is the set of all subsets of A  Example: B = {1, 3, 6}  P (B) = { , {1}, {3}, {6}, {1,3}, {1,6}, {3,6}, {1,3,6}}  Let n be the number of elements in A, called the cardinality of A  Then, the cardinality of P (A) is 2 n

 An ordered n-tuple (x 1, x 2, … x n ) is an ordered sequence of n elements, not necessarily from the same set  The Cartesian product of sets A and B, written A x B is the set of all ordered 2-tuples of the form (a, b), a  A, b  B  Thus, (x, y) points are elements of the Cartesian product R x R (sometimes written R 2 )

 Inclusion of Intersection:  For all sets A and B A  B  AA  B  A A  B  BA  B  B  Inclusion in Union:  For all sets A and B  A  A  B  B  A  B  Transitive Property of Subsets:  If A  B and B  C, then A  C

 The basic way to prove that X is a subset of Y 1. Suppose that x is a particular but arbitrarily chosen element of X 2. Show that x is an element of Y  If every element in X must be in Y, by definition, X is a subset of Y

 We want to leverage the techniques we've already used in logic and proofs  The following definitions help with this goal: 1. x  X  Y  x  X  x  Y 2. x  X  Y  x  X  x  Y 3. x  X – Y  x  X  x  Y 4. x  X c  x  X 5. (x, y)  X  Y  x  X  y  Y

Theorem: For all sets A and B, A  B  A Proof:  Let x be some element in A  B  x  A  x  B  x  A  Thus, all elements in A  B are in A A  B  AA  B  A QED  Premise  Definition of intersection  Specialization  By generalization  Definition of subset

NameLawDual Commutative A  B = B  AA  B = B  A Associative (A  B)  C = A  (B  C)(A  B)  C = A  (B  C) Distributive A  (B  C) = (A  B)  (A  C)A  (B  C) = (A  B)  (A  C) Identity A   = AA  U = A Complement A  A c = UA  A c =  Double Complement(A c ) c = A Idempotent A  A = AA  A = A Universal Bound A  U = UA   =  De Morgan’s (A  B) c = A c  B c (A  B) c = A c  B c Absorption A  (A  B) = AA  (A  B) = A Complements of U and  U c =  c = U Set Difference A – B = A  B c

 To prove that X = Y  Prove that X  Y and  Prove that Y  X

Theorem: For all sets A,B, and C, A  (B  C) = (A  B)  (A  C) Proof:  Let x be some element in A  (B  C)  x  A  x  (B  C)  Case 1: Let x  A  x  A  x  B  x  A  B  x  A  x  C  x  A  C  x  A  B  x  A  C  x  (A  B)  (A  C)  Case 2: Let x  B  C  x  B  x  C  x  B  x  A  x  B  x  A  B  x  C  x  A  x  C  x  A  C  x  A  B  x  A  C  x  (A  B)  (A  C)  In all possible cases, x  (A  B)  (A  C), thus A  (B  C)  (A  B)  (A  C)

 Let x be some element in (A  B)  (A  C) x  (A  B)  x  (A  C)x  (A  B)  x  (A  C)  Case 1: Let x  A  x  A  x  B  C  x  A  (B  C)  Case 2: Let x  A x  A  Bx  A  B  x  A  x  B  x  B  x  A  C  x  A  x  C  x  C  x  B  x  C  x  B  C  x  A  x  B  C  x  A  (B  C)  In all possible cases, x  A  (B  C), thus (A  B)  (A  C)  A  (B  C)  Since both A  (B  C)  (A  B)  (A  C) and (A  B)  (A  C)  A  (B  C), A  (B  C) = (A  B)  (A  C) QED

 Prove that, for any set A, A   =   Hint: Use a proof by contradiction

 More on set theory  Russell’s paradox

 Homework 4 is due Monday  Keep reading Chapter 6