Download presentation
Presentation is loading. Please wait.
Published byMeredith Maria Andrews Modified over 8 years ago
1
Chapter 0 Discrete Mathematics 1
2
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
3
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
4
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:
5
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)
6
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}
7
(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
8
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
9
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
10
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
11
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.
12
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)
13
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 ≤ 2 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 − 1 + 2 h − 1 + 1 = 2 ∙ 2 h − 1 = 2 h + 1 − 1. T1T1 T2T2 one subtree might be empty heightheight
14
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.
15
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.
16
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.
17
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…
18
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
19
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
20
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
21
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. □
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.