Any Wizard of Oz fans? It is always best to start at the beginning - - PDF document

any wizard of oz fans
SMART_READER_LITE
LIVE PREVIEW

Any Wizard of Oz fans? It is always best to start at the beginning - - PDF document

Any Wizard of Oz fans? It is always best to start at the beginning Discrete Math Basics -- Glynda, the good witch of the North Outline Sets Sets A set is a collection of elements. Relations Finite set has finite


slide-1
SLIDE 1

Discrete Math Basics Any Wizard of Oz fans?

“It is always best to start at the beginning”

  • - Glynda, the good witch of the North

Outline

  • Sets
  • Relations
  • Proofs

Sets

  • A set is a collection of elements.

– Finite set – has finite number of elements

  • A = { 1, 3, 5, 6, 9 }

– Infinite Set – has infinite number of elements

  • B = { x | x is an odd integer }

– Null (Empty) set – has no elements.

Sets

  • Membership

– If an element x is a member of a set A, we write:

  • x ∈ A.

– If an element x is not a member of a set A, we write:

  • x ∉A
  • Subsets:

– A is a subset of B if all elements of A are also in B. – A ⊆ B if x ∈A then x ∈ B – A = B is the same as saying A ⊆ B and B ⊆ A.

  • Power Set

– 2A = Set of all subsets of A

Set Operations

  • Union:

– A ∪ B = set consisting of all elements in either A or B

  • r both.
  • Intersection

– A ∩ B = set of elements that are in both A and B – If A ∩ B = ∅, A and B are disjoint.

  • Difference

– A – B = set of all elements of A that are not elements of B

  • Complement (wrt a universal set U)

– A’ = All elements in U that are not in A – U - A

slide-2
SLIDE 2

Set Operations

  • A = { 1, 3, 5, 6, 9 }
  • B = { x | x is an odd integer }
  • A ∪ B = { x | x = 6 or x is an odd integer}
  • A ∩ B = { 1, 3, 5, 9 }
  • A – B = { 6 }
  • B’ = { x | x is an even integer }

– With respect to the Universal set of Positive integers.

Cartesian Product of Sets

  • A x B = set of ordered pairs (a,b) such that

– a ∈ A and b ∈ B.

  • A x B x C = set of ordered triplets (a, b, c)

such that

– a ∈ A and b ∈ B and c ∈ C

  • In general: A1 x A2 x … x An = the set of all

n-tuples (a1, a2, …, an) such that

– ai ∈ Ai for all i.

Relations on sets

  • Means to relate or associate a member of
  • ne set with a member of another:

– R : A → B – Relation is simply a subset of A x B

  • If a ∈ A is related to b ∈ B then (a, b) ∈ R
  • Can also be written aRb
  • Or R(a) contains b

Functions

  • Functions are restricted relations

– f: A → B – Every element of A is associated with exactly 1 element of B

Functions

  • A function, f: A → B is:

– Onto (Surjective) if every element of B is related to at least one element of A – One-to-one (Injective) if every element of B is related to at most one element of A. – A bijection if it is both one-to-one and onto

  • Every element in B is related to one and only one

element of A.

Functions

  • f : A → B

– A and B can themselves be Cartesian Products – f: A x B → C

  • Elements of f are ((a,b), c) where a ∈ A, b ∈B, c ∈

C

  • f (a,b) = c
slide-3
SLIDE 3

Equivalence Relations

  • If R is a relation on A (R: A → A), R is an

equivalence relation if:

– R is reflexive – (a, a) ∈ R for all a in A – R is symmetric – if (a,b) ∈ R then (b,a) ∈ R – R is transitive – if (a, b) ∈ R and (b,c) ∈ R then (a,c) ∈ R

Equivalence Relations

  • An equivalence relation on A (R: A → A)

partitions the elements of A into disjoint equivalence classes.

– For each class, elements in the class are related only to all elements in the same partition. – Example:

  • ≡4: Ν → Ν : x ≡4 y if ( x mod 4) == (y mod 4 )
  • [0] = { 0, 4, 8, 12, …}
  • [1] = { 1, 5, 9, 13, …}
  • [2] = { 2, 7, 10, 15, …}
  • [3] = { 3, 8, 11, 16, …}

Functions and Relations

  • Questions?
  • Next: proofs

Mathematical Proofs

  • An argument that something is true

– If X, then Y

  • Types of proofs

– Direct/Constructive proofs – Proof by contradiction – Proof by induction

Direct Proofs

  • If X, then Y
  • Assume X is true, show directly that Y is

true.

Direct Proofs

  • Example:

– For integers a,b: If a and b are odd, then ab is

  • dd.

– Given: a and b are odd integers

  • There exists integer x such that a= 2x +1
  • There exists integer y such that b = 2y + 1

– Must prove: a times b is also odd

  • There exists integer z such that ab = 2z + 1
slide-4
SLIDE 4

Direct Proofs

  • Perform the multiplication directly

– ab = (2x + 1)(2y + 1) = 4xy + 2x + 2y + 1 = 2(2xy + x + y) + 1 So z = 2xy + x + y Not only did you prove that a z exists, you constructed an “algorithm” for generating this z. This is an example of a constructive proof.

Proof by contradiction

  • If X, then Y
  • With proof by contraction

– You assume that Y is false – Then derive a contradiction to a fact known to be true – If we find a contradiction, then we know our initial assumption (I.e. Y is false) must be invalid and thus Y must be true.

Proof by contradiction

  • Example

– A, B, and C are sets. If A ∩ B = ∅ and C ⊆ B, then A ∩ C = ∅ – Given:

  • A and B have nothing in common
  • C is a subset of B

– Must show:

  • A and C have nothing in common

Proof by contradiction

  • If X, then Y -- Assume Y is false
  • 1. Assume that A ∩ C ≠ ∅
  • Meaning, there is an element x which is in both A and C
  • 2. Since C is a subset of B then x, being a member of C

must a member of B as well.

  • 3. However, by #1, x ∈A.
  • 4. x ∈A and x ∈B implies that A ∩ B ≠ ∅
  • 5. This contradicts X
  • 6. The assumption in #1 must be invalid and as such A ∩

C = ∅

Proof by Induction

  • Used to prove statements involving an

integer that we wish to prove true for all integers greater than a given integer

– Example: For all n ≥ 0

=

+ = + + + + + =

n i

n n n i

1

2 ) 1 ( 4 3 2 1 L

Proof by Induction

  • Notice there are two elements to the

problem to be proven:

– Statement involving an integer, P(n) – A specific integer n0 for which we are trying to show that P(n) is true for all values greater than

  • r equal to.
slide-5
SLIDE 5

Proof by induction

  • How :

– Let P(n) is some statement involving an integer, n. To prove that P(n) is true for every integer ≥ a given integer n0, it is sufficient to show these two things:

  • 1. P(n0) is true
  • 2. For any k ≥ n0, if P(k) is true, then P(k+1) is true.

Proof by induction

  • Steps to an inductive proof:
  • 1. Basis step:

Show P(n) is true when n=n0

  • 2. Induction hypothesis

Assume that P(n) is true for some k ≥ n0

  • 3. Inductive step

Prove P(n) is true for n = k+1 using the induction hypothesis.

Proof by induction

  • Example:

– Show that for n ≥ 0

=

+ = + + + + + =

n i

n n n i

1

2 ) 1 ( 4 3 2 1 L

  • 1. Basis step: Show true for n = 0

=

=

1 i

i

2 ) 1 ( = +

Proof by Induction

  • 2. Inductive Hypothesis: Assume true for n=k

=

+ =

k i

k k i

1

2 ) 1 (

  • 3. Inductive Step: Show true for n=k +1

+ =

+ + =

1 1

2 ) 2 )( 1 (

k i

k k i

Proof by induction

) 1 (

1 1 1

+ + =∑

= + =

k i i

k i k i

By the induction hypothesis so…

=

+ =

k i

k k i

1

2 ) 1 ( 2 ) 1 ( 2 ) 1 ( ) 1 ( 2 ) 1 (

1 1

+ + + = + + + =

+ =

k k k k k k i

k i

2 ) 2 )( 1 ( 2 2 2

2

+ + = + + = k k k k

Proof by induction

  • Steps to an inductive proof:
  • 1. Basis step:

Show P(n) is true when n=n0

  • 2. Induction hypothesis

Assume that P(n) is true for some k ≥ n0

  • 3. Inductive step

Prove P(n) is true for n = k+1 using the induction hypothesis.

slide-6
SLIDE 6

Summary

  • Proof

– Direct / constructive – Proof by contradiction – Proof by induction

  • Any questions?

Reminder

  • Next class…

– Quiz on all this discrete math. – Start to look at strings and languages