Chapter 0 Discrete Mathematics 1. A collection of objects called elements; no repetition or order. A = {a 1, …, a n } or {a 1, a 2, …} N = {0, 1, 2, …}{1,

Slides:



Advertisements
Similar presentations
Chapter 2 Revision of Mathematical Notations and Techniques
Advertisements

Recursive Definitions and Structural Induction
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
The Engineering Design of Systems: Models and Methods
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Sets 1.
Sets 1.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
Theoretical Computer Science COMP 335 Fall 2004
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Relation, function 1 Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets.
Induction and recursion
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sifth Edition, Mc Graw-Hill, 2007 Chapter 2: Basic Structures: Sets, Functions, Sequences.
1 Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Mathematical Tools and Techniques.
Section 5.3. Section Summary Recursively Defined Functions Recursively Defined Sets and Structures Structural Induction.
Mathematical Preliminaries Strings and Languages Preliminaries 1.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
1 Lecture 3 (part 3) Functions – Cardinality Reading: Epp Chp 7.6.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Chapter 7 Review Important Terms, Symbols, Concepts 7.1. Logic A proposition is a statement (not a question.
Fall 2005Costas Busch - RPI1 Mathematical Preliminaries.
Prof. Busch - LSU1 Mathematical Preliminaries. Prof. Busch - LSU2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Mathematical Induction
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.
Relations, Functions, and Countability
CS201: Data Structures and Discrete Mathematics I
Discrete Mathematics R. Johnsonbaugh
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Mathematical Preliminaries
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Introduction to Real Analysis Dr. Weihu Hong Clayton State University 8/27/2009.
Basic Structures: Sets, Functions, Sequences, and Sums.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Review 2 Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by lower.
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
1 Mathematical Preliminaries. 2 Sets Functions Relations Graphs Proof Techniques.
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Models of Computation: Automata and Formal Languages Sam M. Kim.
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.
Chapter 5 With Question/Answer Animations 1. Chapter Summary Mathematical Induction - Sec 5.1 Strong Induction and Well-Ordering - Sec 5.2 Lecture 18.
Week 8 - Monday.  What did we talk about last time?  Properties of functions  One-to-one  Onto  Inverses  Cardinality.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Chapter 1 Logic and proofs
1-1 Copyright © 2013, 2005, 2001 Pearson Education, Inc. Section 2.4, Slide 1 Chapter 2 Sets and Functions.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Discrete Mathematics Lecture 6
Discrete Mathematics CS 2610
Relations Chapter 9.
Mathematical Preliminaries
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Cardinality of Sets Section 2.5.
Lesson 5 Relations, mappings, countable and uncountable sets
CSCI-2400 Models of Computation.
Lesson 5 Relations, mappings, countable and uncountable sets
Mathematical Preliminaries
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Presentation transcript:

Chapter 0 Discrete Mathematics 1

A collection of objects called elements; no repetition or order. A = {a 1, …, a n } or {a 1, a 2, …} N = {0, 1, 2, …}{1, 2, 3} = {2, 1, 3} = {1, 1, 2, 3} Z = {…, −2, −1, 0, +1, +2, …} membership: a  A, a  Ae.g. 0  {0, 1} 2  {0, 1} singleton: {a}doubleton: {a, b} a ≠ b empty set:  unique  a(a   )  A(   A) subsets:A  B, A  BA  B  A  A = B A  B  C  A  Ctransitivity of  common set specification: {x  D: P(x)}, Ex: Z + = {x  N: x > 0} Examples: Sets domainproperty SetImplicit Def.Explicit Def. E {n  N: n divisible by 2} {0, 2, 4, 6, …} EP {p  E: p is prime} {2} C{(x, y): x 2 + y 2 = 1}{(cos θ, sin θ): 0 ≤ θ < 2π} parameterized

Operations on sets power set: 2 A = {B : B  A} , A  2 A unionintersectiondifferencecartesian product  \ A  BA  B A  B =  disjoint complement A \ B Cardinality (size): Define |A| = number of elements in A {a, b, c} {a, b}{b, c}{a, c} {a}{a}{b}{b}{c}{c}  operations: finite:|{a 1, …, a k }| = k infinite:|{a 1, a 2, ….}| = ∞ but, set may not be listable e.g. {x  R : 0 ≤ x ≤ 1} (unit interval) Countable Uncountable |2 A | = 2 |A| for finite and infinite 2 {a, b, c} 0 1

Propositional Logic True and False statements (about mathematical objects) Examples using numbers: 17 is prime; 5 < 4; π is rational negation (denial):NOT  p conjunctiondisjunction implication biconditional ANDORIF … THENIFF P  QP  QP  Q hypothesis antecedent → conclusion consequent ↔  (A  B) ↔  A   B Q → P is converse of P → Q contrapositive (  Q →  P) tautology (always true) contradiction (never true) P ↔ P P ↔  P F → FT → F opposites De Morgan’s connectives:

Predicate Logic Open sentence (free variable) x 2 ≥ 0domain Quantifiers  x  R x 2 ≥ 0universal over domain  x  C x 2 < 0 existential √−1 = i is a counterexample to x 2 ≥ 0   x P(x) ↔  x  P(x) All men are mortal:  x man(x) → mortal(x)

Functions function: a map from a domain to a range f : A → B domainrange f  A  B where  a  !b such that (a, b)  f A special type of relation which assigns to each element in the domain a unique element in the range. The application of f to a, written f(a), is the image of a under f. In terms of ordered pairs:  a, f(a)  for each a  A where f(a)  B also:  a, x   f and  a, y   f  x = y(i.e. is single-valued) a is sometimes called an argument of f and f(a) its value. gets cheesedoesn’t get cheese injective (one-one):a 1 ≠ a 2  f(a 1 ) ≠ f(a 2 )  a 1, a 2  A surjective (onto):  b  B  a  A such that f(a) = b bijective: one-one and onto Example: mouse in mazef: Paths → {T, F}

(Binary) Relations relation: subset of a Cartesian product A  B, or... a set of ordered pairs In a graph E  V  V edges vertices A binary relation R (edges) is a set of ordered pairs on a domain S (nodes). There is a one-one correspondence between digraphs and binary relations. (s 1, s 2 )  R  s 1 → s 2 (directed edge) Reflexive:sRs eg. ≤ on reals Symmetric:s 1 Rs 2  s 2 Rs 1 eg. = on reals Transitive:s 1 Rs 2  s 2 Rs 3  s 1 Rs 3 eg. < on reals All three, called equivalence relations, usually written ~ R partitions S into disjoint equivalence classes S 1, …, S i, … such that S i  S j =  i ≠ jS =  {S i : i = 1, … } Write S 1 ~ S 2  S 1 and S 2 are in the same equivalence class [s] = {s′  S : s′ ~ s} 7

A.x ~ xreflexive B.x ~ y  y ~ xsymmetric C. x ~ y  y ~ z  x ~ ztransitive s′ ~ s iff they are in the same equivalence class: [s] = {s′  S | s′ ~ s} n.b. distinct equivalence classes are disjoint. Examples: equality on any set S:  s  S [s] = {s} integers mod 2: (two equivalence classes) … ~ −2 ~ 0 ~ +2 ~ … … ~ −3 ~ −1 ~ +1 ~ +3 … R mod 1: x ~ y  (x − y)  Zi.e. have same fractional part Equivalences groups a set into components for all x, y, z in a set S

Partitions A partition on A is a subset Π  2 A (i.e every element in an element of Π is in A) such that each element of A is in exactly one element of Π. N.b. |Π| = no. of “pieces” in the pie. 1.   Π 2. P 1, P 2,  Π and P 1 ≠ P 2  P 1  P 2 =  3.  {P  Π} = A E.g.:Π = { {s} : s  S} (finest partition) (over S)Π = {S} (one piece) cuts a set into pieces

Equivalences and Partitions Theorem: Let ~ be an equivalence on a set S, then the operation S ∕ ~ = {[x] : x  S} is a partition of S Proof:1.  x  S x  [x] since x ~ x, so [x] ≠  2.x  [y]  [z]  x ~ y and x ~ z  y ~ z  [y] = [z] 3.x  S  x  [x] Hence  {[x] : x  S} = S Theorem: Let Π be a partition of S, then the relation defined by x ~ y iff  P  Π, x, y  P is an equivalence Proof:A.x  S  x  P  Π  x, x  P  Π  x ~ x B.x ~ y  x, y  P  Π  y, x  P  Π  y ~ x C.x ~ y ~ z  x, y  P 1  Π and y, z  P 2  Π. And y  P 1  P 2  P 1 = P 2  x, y, z  P 1 = P 2  Π  x ~ z

Mathematical Induction To show a statement P(i) holds for all i  N, prove the basis P(0) and the induction step P(n)  P(n + 1). Use P(0), …, P(n) for ‘strong’ IH. Example: We want to show the size of a power set satisfies: Theorem:|2 A | = 2 |A| for any finite set A (by induction on |A|) Proof: Base Case: |A| = 0. A = . |2  | = |{  }| = 1 = 2 0 = 2 |A| Induction step: |A| = n + 1. Since |A| ≥ 1, let B = A \ {a} for some a  A. By induction hypothesis |2 B | = 2 |B| = 2 n since |B| = n clearly. Now 2 A = {S  A : a  S}  {S  A : a  S} = {S  A : S  B}  {S  {a} : S  B} = 2 B  {S  {a} : S  2 B }. Since these sets are disjoint, |2 A | = |2 B | + |2 B | = 2 n + 2 n = 2 n+1 = 2 |A|. Note:There is a non-recursive proof by counting binary strings.

Numerical Induction In order to prove a statement holds for all integers Prove:(n + 1)(n − 1) = n 2 − 1don’t need induction Prove: can be done without induction, but … Base case: n = 1 Inductive step: n > 1 Induction hypothesis Can also be used on non-integral examples (but not real numbers)

Structural Induction Show: Every binary tree T of height h has ≤ 2 h+1 − 1 nodes. Proof: By induction on h. Base Case: T is one node (height = 0); 1 ≤ − 1 = 1 Inductive Step: h ≥ 1 implies at least one child. Induction hypothesis says |T 1 | ≤ 2 h − 1 and |T 2 | ≤ 2 h − 1 since height of T 1, T 2 ≤ h − 1. But |T| = |T 1 | + |T 2 | + 1 ≤ 2 h − h − = 2 ∙ 2 h − 1 = 2 h + 1 − 1. T1T1 T2T2 one subtree might be empty heightheight

Mathematical Induction  Pigeon-Hole Principle Mathematical Induction: Any subset of the natural numbers which contains zero and is closed under successor must contain all of them. Pigeon-Hole Principle: There cannot be an injective function from a finite set to a proper subset of itself. Fact:MI ⇒ PHP. Proof: Let f: A → B with A finite and |A| > |B|. Let’s show f is not injective by induction on |B| (B = Ø is trivial). Base Case: |B| = 1 ⇒ B = {b}, which means that f[A] = {b}. But since |A| > 1 this means there are a ≠ a' such that f(a) = f(a'). Induction Step: Take |B| > 1, and any b ∈ B. If |f⁻¹(b)| > 1 we are done. Otherwise, let A' = A \ f⁻¹(b), and B' = B \ {b}. Then since |B'| < |A'|, by induction hypothesis f: A' → B' cannot be injective. So, f: A → B is not either.

Pigeon-Hole Principle  Mathematical Induction MI: Let 0 ∈ P ⊆ N & ∀n ∈ P, n + 1 ∈ P. Then P = N. PHP: If B ⊊ A is finite, then f: A → B is not injective. Fact: PHP ⇒ MI. Proof: Suppose P is inductive and has a least counterexample m ∉ P. Define f: {0, …, m} → {0, …, m − 1} by f(x) = x − [¬P(x)]. Note P(0) ⇒ f(0) = 0 and f(m) = m − 1. f must be one-one because the only possible violation is some n such that f(n + 1) = n = f(n), which would mean P(n) and ¬P(n + 1) which contradicts P being inductive.

Cardinality Definitions: A and B are equinumerous if there is a bijection between them. A set is finite if it is equinumerous with an integer i = {0, 1, …, i − 1}. Infinite means not finite; denumerable means equinumerous with N. Corollary (of the PHP):If B  A finite, then |B| < |A|. Theorem: If infinite B  A denumerable, then B is denumerable. Proof:Let A = {a 0, a 1, …}. Pick n 0 smallest subscript such that a n 0  B, similarly for a n k  A \ {a n 0, …, a n k−1 }. Hence B = {a n 0, …, a n k, …}. Fact: Every infinite set X contains a denumerable subset. Proof: Pick any x 0  X. After having picked {x 0, …, x k } we know X − {x 0, …, x k } ≠ Ø ( ∵ X is infinite), so pick x k+1  X − {x 0, …, x k }, … etc.

Countable Sets A set is countable if it is equinumerous with (a subset of) Z +. Theorem: A countable union of countable sets is countable. Proof: Consider first the union of two countable sets A, B. The cases where either is finite is obvious. So, let A = {a 1, a 2, a 3, … }B = {b 1, b 2, b 3, … } then C = A  B = {a 1, b 1, a 2, b 2, a 3, b 3, … }. Eventually, every element of A or B appears in C. The union of finitely many countable sets can be reduced to this by repeated application. Continues next slide…

Countable Set Theorem, cont. For a countably infinite union of countably infinite sets, let A′ = A 1  A 2  A 3  …… where each A i = {a i1, a i2, a i3, … }. Define A′ = {a 1, a 2, a 3, … } from the following diagram: Eventually, every element of each A i is visited and given a chance to enter A′ (if it has not already been thrown in). A′ = {a ij : i + j = n = 2, 3, 4, …} a k ′ = ?? equivalent to showing N  N is denumerable A3A3 a 31 a 32 a 33 A2A2 a 21 a 22 a 23 A1A1 a 11 a 12 a 13

Diagonalization Theorem: 2 N is uncountable. Proof: Suppose 2 N = {S 0, S 1, S 2, …} is enumerable: 012…k… S0S0 010…0… S1S1 111…1… S2S2 100…0… ::::0… SkSk 1110?… :::::: A “1” appears in row i and column j  j  S i The complement of the diagonal cannot be equal to any of the given sequences (rows) Consider the diagonal set D = {n  N : n  S n }. Since D  N, we must have that D = S k for some k  N. Now, is k  S k ? Consider both possibilities: k  S k  k  D by definition of D  k  D = S k a contradiction k  S k  k  D by definition of D  k  D = S k a contradiction

Transitive Closure Let R + = {  a, b  : there is a non-trivial path from a to b in the graph R}. Define R + inductively (from below) by the rules: A.(a, b)  R  (a, b )  R + B.(a, c)  R + and (c, b)  R +  (a, b )  R + C.nothing else Define R + as the intersection (from above) of all transitive relations containing R, i.e. the smallest transitive relation containing R. A.R + is transitive B.R  R + C.If R  R′  R + then R′ is not transitive

Transitive Closure, cont. Theorem: (1)  (2) Proof: (2)  (1). 1A: If (a, b)  R, then (a, b)  R + by 2B. 1B: If (a, c)  R + and (c, b)  R +, then (a, b)  R + by 2A. 1C: Let (a, b)  R + and suppose that 1A, 1B do not hold for (a, b). Then R  R + \ {(a, b)}  R + by the failure of 1A. But R + \ {(a, b)} is still transitive by the failure of 1B, contradicting 2C. (1)  (2). 1A  2B. 1B  2A. For 2C, suppose towards a contradiction that R  R′  R + with R′ transitive. Well, R  R′  R′ satisfies 1A, and R′ transitive  R′ satisfies 1B. Hence, since R + also satisfies 1A and 1B, R′  R + since the rules only tell what to add to R +. Contradicts assumption that R′  R (monotone rules). Here is where we need 1C, to insure R′ satisfies all rules that R + does. □