Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in...

1366
Discrete Mathematics I CS127 Lecturer: Dr. Alex Tiskin http://www.dcs.warwick.ac.uk/˜tiskin Department of Computer Science University of Warwick Discrete Mathematics I – p. 1/29

Transcript of Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in...

Page 1: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics ICS127

Lecturer: Dr. Alex Tiskinhttp://www.dcs.warwick.ac.uk/˜tiskin

Department of Computer Science

University of Warwick

Discrete Mathematics I – p. 1/292

Page 2: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IMathematics relevant to computer scienceUsed in other CS courses

29 lectures in Autumn TermWeekly problem sheets, seminars from week 2 —please sign up!

Website: http://www.dcs.warwick.ac.uk/~tiskin/teach/dm1.html

Seminar signup open now

Discrete Mathematics I – p. 2/292

Page 3: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IClass test in week 7 (new from 2002/03!)

Exam in week 1 of Summer TermResults at the end of Summer Term

Discrete Mathematics I – p. 3/292

Page 4: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics ILecture notes available at lectures

Website: http://www.dcs.warwick.ac.uk/~tiskin/teach/dm1.html

Forum: http://forums.warwick.ac.uk, thenclick on Departments > Computer Science> UGyear1 > CS127

Please participate!

Discrete Mathematics I – p. 4/292

Page 5: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IDiscrete Maths II — a Summer Term optionLecturer: Dr. Mike Joy

Discrete maths in depth, highly recommended!

Discrete Mathematics I – p. 5/292

Page 6: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IRecommended books:

Discrete MathematicsRoss and Wright (Prentice Hall, 2003)

Discrete Mathematics and its ApplicationsRosen (McGraw-Hill, 2003)

Discrete Mathematics for Computer ScientistsTruss (Addison-Wesley, 1999)

Discrete Mathematics I – p. 6/292

Page 7: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IWhich is the best?

• Ross and Wright: the most helpful. . .

• Rosen: the most interesting. . .

• Truss: the most advanced. . .

Hundreds more, the choice is yours!

Discrete Mathematics I – p. 7/292

Page 8: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IWhich is the best?

• Ross and Wright: the most helpful. . .

• Rosen: the most interesting. . .

• Truss: the most advanced. . .

Hundreds more, the choice is yours!

Discrete Mathematics I – p. 7/292

Page 9: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IWhich is the best?

• Ross and Wright: the most helpful. . .

• Rosen: the most interesting. . .

• Truss: the most advanced. . .

Hundreds more, the choice is yours!

Discrete Mathematics I – p. 7/292

Page 10: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IWhich is the best?

• Ross and Wright: the most helpful. . .

• Rosen: the most interesting. . .

• Truss: the most advanced. . .

Hundreds more, the choice is yours!

Discrete Mathematics I – p. 7/292

Page 11: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IWhich is the best?

• Ross and Wright: the most helpful. . .

• Rosen: the most interesting. . .

• Truss: the most advanced. . .

Hundreds more, the choice is yours!

Discrete Mathematics I – p. 7/292

Page 12: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IAlso:

Proofs and Fundamentals: a First Course in AbstractMathematicsBloch (Birkhäuser, 2002)

Does not cover whole course, but helps with proofs

Discrete Mathematics I – p. 8/292

Page 13: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Discrete Mathematics IAlso:

Proofs and Fundamentals: a First Course in AbstractMathematicsBloch (Birkhäuser, 2002)

Does not cover whole course, but helps with proofs

Discrete Mathematics I – p. 8/292

Page 14: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Introduction

Discrete Mathematics I – p. 9/292

Page 15: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionMathematics:

the science of abstraction

Natural numbers: 0, 1, 2, 3, 4, 5, 6, 7, . . .What does “5” mean?

Five apples, five hats, five lottery numbers. . .Abstraction of all five-element sets

What set does 0 represent? The empty set

Discrete Mathematics I – p. 10/292

Page 16: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionMathematics: the science of abstraction

Natural numbers: 0, 1, 2, 3, 4, 5, 6, 7, . . .What does “5” mean?

Five apples, five hats, five lottery numbers. . .Abstraction of all five-element sets

What set does 0 represent? The empty set

Discrete Mathematics I – p. 10/292

Page 17: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionMathematics: the science of abstraction

Natural numbers: 0, 1, 2, 3, 4, 5, 6, 7, . . .What does “5” mean?

Five apples, five hats, five lottery numbers. . .Abstraction of all five-element sets

What set does 0 represent? The empty set

Discrete Mathematics I – p. 10/292

Page 18: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionMathematics: the science of abstraction

Natural numbers: 0, 1, 2, 3, 4, 5, 6, 7, . . .What does “5” mean?

Five apples, five hats, five lottery numbers. . .Abstraction of all five-element sets

What set does 0 represent? The empty set

Discrete Mathematics I – p. 10/292

Page 19: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionMathematics: the science of abstraction

Natural numbers: 0, 1, 2, 3, 4, 5, 6, 7, . . .What does “5” mean?

Five apples, five hats, five lottery numbers. . .Abstraction of all five-element sets

What set does 0 represent?

The empty set

Discrete Mathematics I – p. 10/292

Page 20: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionMathematics: the science of abstraction

Natural numbers: 0, 1, 2, 3, 4, 5, 6, 7, . . .What does “5” mean?

Five apples, five hats, five lottery numbers. . .Abstraction of all five-element sets

What set does 0 represent? The empty set

Discrete Mathematics I – p. 10/292

Page 21: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionA set is any collection of elements

{Peter Pan, Gingerbread Man, Wrestling Fan}

{♠,♥,♣,♦}{0, 1, 2, 3, 4, 5, 6, 7, . . . } = N natural numbers

{0, 2, 4, 6, 8, 10, 12, 14, . . . } = Neven even naturals

{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

First two sets finite, last three infinite

Discrete Mathematics I – p. 11/292

Page 22: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionA set is any collection of elements

{Peter Pan, Gingerbread Man, Wrestling Fan}

{♠,♥,♣,♦}{0, 1, 2, 3, 4, 5, 6, 7, . . . } = N natural numbers

{0, 2, 4, 6, 8, 10, 12, 14, . . . } = Neven even naturals

{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

First two sets finite, last three infinite

Discrete Mathematics I – p. 11/292

Page 23: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionA set is any collection of elements

{Peter Pan, Gingerbread Man, Wrestling Fan}

{♠,♥,♣,♦}

{0, 1, 2, 3, 4, 5, 6, 7, . . . } = N natural numbers

{0, 2, 4, 6, 8, 10, 12, 14, . . . } = Neven even naturals

{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

First two sets finite, last three infinite

Discrete Mathematics I – p. 11/292

Page 24: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionA set is any collection of elements

{Peter Pan, Gingerbread Man, Wrestling Fan}

{♠,♥,♣,♦}{0, 1, 2, 3, 4, 5, 6, 7, . . . } = N natural numbers

{0, 2, 4, 6, 8, 10, 12, 14, . . . } = Neven even naturals

{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

First two sets finite, last three infinite

Discrete Mathematics I – p. 11/292

Page 25: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionA set is any collection of elements

{Peter Pan, Gingerbread Man, Wrestling Fan}

{♠,♥,♣,♦}{0, 1, 2, 3, 4, 5, 6, 7, . . . } = N natural numbers

{0, 2, 4, 6, 8, 10, 12, 14, . . . } = Neven even naturals

{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

First two sets finite, last three infinite

Discrete Mathematics I – p. 11/292

Page 26: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionA set is any collection of elements

{Peter Pan, Gingerbread Man, Wrestling Fan}

{♠,♥,♣,♦}{0, 1, 2, 3, 4, 5, 6, 7, . . . } = N natural numbers

{0, 2, 4, 6, 8, 10, 12, 14, . . . } = Neven even naturals

{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

First two sets finite, last three infinite

Discrete Mathematics I – p. 11/292

Page 27: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionA set is any collection of elements

{Peter Pan, Gingerbread Man, Wrestling Fan}

{♠,♥,♣,♦}{0, 1, 2, 3, 4, 5, 6, 7, . . . } = N natural numbers

{0, 2, 4, 6, 8, 10, 12, 14, . . . } = Neven even naturals

{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

First two sets finite, last three infinite

Discrete Mathematics I – p. 11/292

Page 28: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionThe empty set: {} = ∅Plays a role for sets similar to 0 for numbers

Discrete Mathematics I – p. 12/292

Page 29: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome “tough” questions:

Do infinite sets have “sizes”?Yes, but these are beyond natural numbers

Can infinite sets have different sizes?Yes, a huge variety of possible sizes

Is there a set of all sets?No! Not even a set of all (infinite) set sizes

Why? It can be proved!

Discrete Mathematics I – p. 13/292

Page 30: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome “tough” questions:

Do infinite sets have “sizes”?

Yes, but these are beyond natural numbers

Can infinite sets have different sizes?Yes, a huge variety of possible sizes

Is there a set of all sets?No! Not even a set of all (infinite) set sizes

Why? It can be proved!

Discrete Mathematics I – p. 13/292

Page 31: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome “tough” questions:

Do infinite sets have “sizes”?Yes, but these are beyond natural numbers

Can infinite sets have different sizes?Yes, a huge variety of possible sizes

Is there a set of all sets?No! Not even a set of all (infinite) set sizes

Why? It can be proved!

Discrete Mathematics I – p. 13/292

Page 32: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome “tough” questions:

Do infinite sets have “sizes”?Yes, but these are beyond natural numbers

Can infinite sets have different sizes?

Yes, a huge variety of possible sizes

Is there a set of all sets?No! Not even a set of all (infinite) set sizes

Why? It can be proved!

Discrete Mathematics I – p. 13/292

Page 33: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome “tough” questions:

Do infinite sets have “sizes”?Yes, but these are beyond natural numbers

Can infinite sets have different sizes?Yes, a huge variety of possible sizes

Is there a set of all sets?No! Not even a set of all (infinite) set sizes

Why? It can be proved!

Discrete Mathematics I – p. 13/292

Page 34: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome “tough” questions:

Do infinite sets have “sizes”?Yes, but these are beyond natural numbers

Can infinite sets have different sizes?Yes, a huge variety of possible sizes

Is there a set of all sets?

No! Not even a set of all (infinite) set sizes

Why? It can be proved!

Discrete Mathematics I – p. 13/292

Page 35: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome “tough” questions:

Do infinite sets have “sizes”?Yes, but these are beyond natural numbers

Can infinite sets have different sizes?Yes, a huge variety of possible sizes

Is there a set of all sets?No! Not even a set of all (infinite) set sizes

Why? It can be proved!

Discrete Mathematics I – p. 13/292

Page 36: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome “tough” questions:

Do infinite sets have “sizes”?Yes, but these are beyond natural numbers

Can infinite sets have different sizes?Yes, a huge variety of possible sizes

Is there a set of all sets?No! Not even a set of all (infinite) set sizes

Why?

It can be proved!

Discrete Mathematics I – p. 13/292

Page 37: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome “tough” questions:

Do infinite sets have “sizes”?Yes, but these are beyond natural numbers

Can infinite sets have different sizes?Yes, a huge variety of possible sizes

Is there a set of all sets?No! Not even a set of all (infinite) set sizes

Why? It can be proved!

Discrete Mathematics I – p. 13/292

Page 38: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionNatural sciences are based on evidence

Mathematics is based on proof(but evidence helps to understand proofs)

Discrete Mathematics I – p. 14/292

Page 39: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionNatural sciences are based on evidence

Mathematics is based on proof(but evidence helps to understand proofs)

Discrete Mathematics I – p. 14/292

Page 40: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionTo write proofs, we need a special language:

• precise (unambiguous)

• concise (clear and relatively brief)

The “grammar” of this language is logic

Discrete Mathematics I – p. 15/292

Page 41: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionAll eagles can flySome pigs cannot fly

Therefore, some pigs are not eagles

Proof.

Consider all creatures. If it is an eagle, it can fly.Hence, if it cannot fly, it is not an eagle.

There is a creature that is a pig and cannot fly.By the above statement, it is not an eagle.

Discrete Mathematics I – p. 16/292

Page 42: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionAll eagles can flySome pigs cannot fly

Therefore, some pigs are not eagles

Proof.

Consider all creatures. If it is an eagle, it can fly.Hence, if it cannot fly, it is not an eagle.

There is a creature that is a pig and cannot fly.By the above statement, it is not an eagle.

Discrete Mathematics I – p. 16/292

Page 43: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionAll eagles can flySome pigs cannot fly

Therefore, some pigs are not eagles

Proof.

Consider all creatures. If it is an eagle, it can fly.Hence, if it cannot fly, it is not an eagle.

There is a creature that is a pig and cannot fly.By the above statement, it is not an eagle.

Discrete Mathematics I – p. 16/292

Page 44: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionThe same in mathematical notation:

If for all x, eagle(x) ⇒ canfly(x),and for some y, pig(y) ∧ ¬canfly(y),

then for some z, pig(z) ∧ ¬eagle(z)

Proof. Consider all x ∈ Creatures .

By first condition, ¬canfly(x) ⇒ ¬eagle(x).

Take any y such that pig(y) ∧ ¬canfly(y).By the above, we have pig(y) ∧ ¬eagle(y).Take z = y.

Discrete Mathematics I – p. 17/292

Page 45: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome concepts are basic, i.e. need no definitionExamples: set, natural number

All other concepts must be definedExamples: finite set, even number

Some facts are axioms, i.e. need no proofExample: equal sets have the same elements

All other facts must be provedExample: the set of even numbers is infinite

This is the axiomatic method

Discrete Mathematics I – p. 18/292

Page 46: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome concepts are basic, i.e. need no definitionExamples: set, natural number

All other concepts must be definedExamples: finite set, even number

Some facts are axioms, i.e. need no proofExample: equal sets have the same elements

All other facts must be provedExample: the set of even numbers is infinite

This is the axiomatic method

Discrete Mathematics I – p. 18/292

Page 47: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome concepts are basic, i.e. need no definitionExamples: set, natural number

All other concepts must be definedExamples: finite set, even number

Some facts are axioms, i.e. need no proofExample: equal sets have the same elements

All other facts must be provedExample: the set of even numbers is infinite

This is the axiomatic method

Discrete Mathematics I – p. 18/292

Page 48: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome concepts are basic, i.e. need no definitionExamples: set, natural number

All other concepts must be definedExamples: finite set, even number

Some facts are axioms, i.e. need no proofExample: equal sets have the same elements

All other facts must be provedExample: the set of even numbers is infinite

This is the axiomatic method

Discrete Mathematics I – p. 18/292

Page 49: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionSome concepts are basic, i.e. need no definitionExamples: set, natural number

All other concepts must be definedExamples: finite set, even number

Some facts are axioms, i.e. need no proofExample: equal sets have the same elements

All other facts must be provedExample: the set of even numbers is infinite

This is the axiomatic method

Discrete Mathematics I – p. 18/292

Page 50: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionCourse structure:

• Logic

• Sets

• More fun: relations, functions, graphs

Any questions?

Discrete Mathematics I – p. 19/292

Page 51: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

IntroductionCourse structure:

• Logic

• Sets

• More fun: relations, functions, graphs

Any questions?

Discrete Mathematics I – p. 19/292

Page 52: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Discrete Mathematics I – p. 20/292

Page 53: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

In everyday life, we use all sorts of sentences:

Five is less than ten. Welcome to Tweedy’s farm!Pigs can fly. What’s in the pies?There is life on Mars. It’s not as bad as it looks. . .

A statement is a sentence that is either true or false(but not both!).

Discrete Mathematics I – p. 21/292

Page 54: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

In everyday life, we use all sorts of sentences:

Five is less than ten.

Welcome to Tweedy’s farm!

Pigs can fly.

What’s in the pies?

There is life on Mars.

It’s not as bad as it looks. . .

A statement is a sentence that is either true or false(but not both!).

Discrete Mathematics I – p. 21/292

Page 55: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

In everyday life, we use all sorts of sentences:

Five is less than ten. Welcome to Tweedy’s farm!Pigs can fly. What’s in the pies?There is life on Mars. It’s not as bad as it looks. . .

A statement is a sentence that is either true or false(but not both!).

Discrete Mathematics I – p. 21/292

Page 56: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

In everyday life, we use all sorts of sentences:

Five is less than ten. Welcome to Tweedy’s farm!Pigs can fly. What’s in the pies?There is life on Mars. It’s not as bad as it looks. . .

A statement is a sentence that is either true or false(but not both!).

Discrete Mathematics I – p. 21/292

Page 57: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

False and true are Boolean values: B = {F, T}

(After G. Boole, 1815–1864)

value(5 < 10) = T

value(“Pigs can fly”) = F

value(“It’s not as bad as it looks”) — ?

value(“The pie is not as bad as it looks”) = F

Discrete Mathematics I – p. 22/292

Page 58: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

False and true are Boolean values: B = {F, T}(After G. Boole, 1815–1864)

value(5 < 10) = T

value(“Pigs can fly”) = F

value(“It’s not as bad as it looks”) — ?

value(“The pie is not as bad as it looks”) = F

Discrete Mathematics I – p. 22/292

Page 59: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

False and true are Boolean values: B = {F, T}(After G. Boole, 1815–1864)

value(5 < 10) = T

value(“Pigs can fly”) = F

value(“It’s not as bad as it looks”) — ?

value(“The pie is not as bad as it looks”) = F

Discrete Mathematics I – p. 22/292

Page 60: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

False and true are Boolean values: B = {F, T}(After G. Boole, 1815–1864)

value(5 < 10) = T

value(“Pigs can fly”) = F

value(“It’s not as bad as it looks”) — ?

value(“The pie is not as bad as it looks”) = F

Discrete Mathematics I – p. 22/292

Page 61: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

False and true are Boolean values: B = {F, T}(After G. Boole, 1815–1864)

value(5 < 10) = T

value(“Pigs can fly”) = F

value(“It’s not as bad as it looks”) — ?

value(“The pie is not as bad as it looks”) = F

Discrete Mathematics I – p. 22/292

Page 62: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Often need compound statements:

(5 < 10) AND (Pigs can fly)

. . . i.e. T AND F = F — similar e.g. to 3 + 4 = 7

Discrete Mathematics I – p. 23/292

Page 63: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Often need compound statements:

(5 < 10) AND (Pigs can fly)

. . . i.e. T AND F = F — similar e.g. to 3 + 4 = 7

Discrete Mathematics I – p. 23/292

Page 64: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Boolean operators on B:

¬A NOT A negationA ∧B A AND B conjunctionA ∨B A OR B disjunctionA ⇒ B IF A THEN B implicationA ⇔ B A ⇒ B AND B ⇒ A equivalence

Definition: by truth tables

Discrete Mathematics I – p. 24/292

Page 65: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Boolean operators on B:

¬A NOT A negation

A ∧B A AND B conjunctionA ∨B A OR B disjunctionA ⇒ B IF A THEN B implicationA ⇔ B A ⇒ B AND B ⇒ A equivalence

Definition: by truth tables

Discrete Mathematics I – p. 24/292

Page 66: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Boolean operators on B:

¬A NOT A negationA ∧B A AND B conjunction

A ∨B A OR B disjunctionA ⇒ B IF A THEN B implicationA ⇔ B A ⇒ B AND B ⇒ A equivalence

Definition: by truth tables

Discrete Mathematics I – p. 24/292

Page 67: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Boolean operators on B:

¬A NOT A negationA ∧B A AND B conjunctionA ∨B A OR B disjunction

A ⇒ B IF A THEN B implicationA ⇔ B A ⇒ B AND B ⇒ A equivalence

Definition: by truth tables

Discrete Mathematics I – p. 24/292

Page 68: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Boolean operators on B:

¬A NOT A negationA ∧B A AND B conjunctionA ∨B A OR B disjunctionA ⇒ B IF A THEN B implication

A ⇔ B A ⇒ B AND B ⇒ A equivalence

Definition: by truth tables

Discrete Mathematics I – p. 24/292

Page 69: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Boolean operators on B:

¬A NOT A negationA ∧B A AND B conjunctionA ∨B A OR B disjunctionA ⇒ B IF A THEN B implicationA ⇔ B A ⇒ B AND B ⇒ A equivalence

Definition: by truth tables

Discrete Mathematics I – p. 24/292

Page 70: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Boolean operators on B:

¬A NOT A negationA ∧B A AND B conjunctionA ∨B A OR B disjunctionA ⇒ B IF A THEN B implicationA ⇔ B A ⇒ B AND B ⇒ A equivalence

Definition: by truth tables

Discrete Mathematics I – p. 24/292

Page 71: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Negation (NOT A): ¬A

True if A false, false if A true

A ¬A

F T

T F

Discrete Mathematics I – p. 25/292

Page 72: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Negation (NOT A): ¬A

True if A false, false if A true

A ¬A

F T

T F

Discrete Mathematics I – p. 25/292

Page 73: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

¬[5 < 10]

⇐⇒ ¬T ⇐⇒ F

¬[Pigs can fly] ⇐⇒ ¬F ⇐⇒ T

Discrete Mathematics I – p. 26/292

Page 74: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

¬[5 < 10] ⇐⇒ ¬T

⇐⇒ F

¬[Pigs can fly] ⇐⇒ ¬F ⇐⇒ T

Discrete Mathematics I – p. 26/292

Page 75: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

¬[5 < 10] ⇐⇒ ¬T ⇐⇒ F

¬[Pigs can fly] ⇐⇒ ¬F ⇐⇒ T

Discrete Mathematics I – p. 26/292

Page 76: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

¬[5 < 10] ⇐⇒ ¬T ⇐⇒ F

¬[Pigs can fly]

⇐⇒ ¬F ⇐⇒ T

Discrete Mathematics I – p. 26/292

Page 77: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

¬[5 < 10] ⇐⇒ ¬T ⇐⇒ F

¬[Pigs can fly] ⇐⇒ ¬F

⇐⇒ T

Discrete Mathematics I – p. 26/292

Page 78: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

¬[5 < 10] ⇐⇒ ¬T ⇐⇒ F

¬[Pigs can fly] ⇐⇒ ¬F ⇐⇒ T

Discrete Mathematics I – p. 26/292

Page 79: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Conjunction (A AND B): A ∧B

True if both A and B true

A B A ∧B

F F F

F T F

T F F

T T T

Discrete Mathematics I – p. 27/292

Page 80: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Conjunction (A AND B): A ∧B

True if both A and B true

A B A ∧B

F F F

F T F

T F F

T T T

Discrete Mathematics I – p. 27/292

Page 81: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example:

[5 < 10] ∧ [Pigs can fly]

⇐⇒ T ∧ F ⇐⇒ F

Discrete Mathematics I – p. 28/292

Page 82: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example:

[5 < 10] ∧ [Pigs can fly] ⇐⇒ T ∧ F

⇐⇒ F

Discrete Mathematics I – p. 28/292

Page 83: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example:

[5 < 10] ∧ [Pigs can fly] ⇐⇒ T ∧ F ⇐⇒ F

Discrete Mathematics I – p. 28/292

Page 84: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Disjunction (A OR B): A ∨B

True if either A or B true (or both)

A B A ∨B

F F F

F T T

T F T

T T T

Discrete Mathematics I – p. 29/292

Page 85: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Disjunction (A OR B): A ∨B

True if either A or B true (or both)

A B A ∨B

F F F

F T T

T F T

T T T

Discrete Mathematics I – p. 29/292

Page 86: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example:

[5 < 10] ∨ [Pigs can fly]

⇐⇒ T ∨ F ⇐⇒ T

Discrete Mathematics I – p. 30/292

Page 87: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example:

[5 < 10] ∨ [Pigs can fly] ⇐⇒ T ∨ F

⇐⇒ T

Discrete Mathematics I – p. 30/292

Page 88: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example:

[5 < 10] ∨ [Pigs can fly] ⇐⇒ T ∨ F ⇐⇒ T

Discrete Mathematics I – p. 30/292

Page 89: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication (IF A THEN B)

In everyday life, often ambiguous:

If the bird is happy, then it sings loud

Happy — definitely singsUnhappy — may or may not sing

Discrete Mathematics I – p. 31/292

Page 90: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication (IF A THEN B)

In everyday life, often ambiguous:

If the bird is happy, then it sings loud

Happy — definitely singsUnhappy — may or may not sing

Discrete Mathematics I – p. 31/292

Page 91: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication (IF A THEN B)

In everyday life, often ambiguous:

If the bird is happy, then it sings loud

Happy — definitely singsUnhappy — ?

may or may not sing

Discrete Mathematics I – p. 31/292

Page 92: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication (IF A THEN B)

In everyday life, often ambiguous:

If the bird is happy, then it sings loud

Happy — definitely singsUnhappy — may or may not sing

Discrete Mathematics I – p. 31/292

Page 93: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication (IF A THEN B): A ⇒ B

True if A false; true if B true; false otherwise

A B A ⇒ B

F F T

F T T

T F F

T T T

Everything implies truth; false implies anything

Discrete Mathematics I – p. 32/292

Page 94: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication (IF A THEN B): A ⇒ B

True if A false; true if B true; false otherwise

A B A ⇒ B

F F T

F T T

T F F

T T T

Everything implies truth; false implies anything

Discrete Mathematics I – p. 32/292

Page 95: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication (IF A THEN B): A ⇒ B

True if A false; true if B true; false otherwise

A B A ⇒ B

F F T

F T T

T F F

T T T

Everything implies truth; false implies anything

Discrete Mathematics I – p. 32/292

Page 96: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇒ [Pigs fly]]

⇐⇒ [T ⇒ F ] ⇐⇒ F[

[Pigs fly] ⇒ [5 < 10]]

⇐⇒ [F ⇒ T ] ⇐⇒ T[

[Pigs fly] ⇒ [5 > 10]]

⇐⇒ [F ⇒ F ] ⇐⇒ T

Discrete Mathematics I – p. 33/292

Page 97: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇒ [Pigs fly]]

⇐⇒ [T ⇒ F ]

⇐⇒ F[

[Pigs fly] ⇒ [5 < 10]]

⇐⇒ [F ⇒ T ] ⇐⇒ T[

[Pigs fly] ⇒ [5 > 10]]

⇐⇒ [F ⇒ F ] ⇐⇒ T

Discrete Mathematics I – p. 33/292

Page 98: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇒ [Pigs fly]]

⇐⇒ [T ⇒ F ] ⇐⇒ F

[

[Pigs fly] ⇒ [5 < 10]]

⇐⇒ [F ⇒ T ] ⇐⇒ T[

[Pigs fly] ⇒ [5 > 10]]

⇐⇒ [F ⇒ F ] ⇐⇒ T

Discrete Mathematics I – p. 33/292

Page 99: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇒ [Pigs fly]]

⇐⇒ [T ⇒ F ] ⇐⇒ F[

[Pigs fly] ⇒ [5 < 10]]

⇐⇒ [F ⇒ T ] ⇐⇒ T[

[Pigs fly] ⇒ [5 > 10]]

⇐⇒ [F ⇒ F ] ⇐⇒ T

Discrete Mathematics I – p. 33/292

Page 100: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇒ [Pigs fly]]

⇐⇒ [T ⇒ F ] ⇐⇒ F[

[Pigs fly] ⇒ [5 < 10]]

⇐⇒ [F ⇒ T ]

⇐⇒ T[

[Pigs fly] ⇒ [5 > 10]]

⇐⇒ [F ⇒ F ] ⇐⇒ T

Discrete Mathematics I – p. 33/292

Page 101: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇒ [Pigs fly]]

⇐⇒ [T ⇒ F ] ⇐⇒ F[

[Pigs fly] ⇒ [5 < 10]]

⇐⇒ [F ⇒ T ] ⇐⇒ T

[

[Pigs fly] ⇒ [5 > 10]]

⇐⇒ [F ⇒ F ] ⇐⇒ T

Discrete Mathematics I – p. 33/292

Page 102: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇒ [Pigs fly]]

⇐⇒ [T ⇒ F ] ⇐⇒ F[

[Pigs fly] ⇒ [5 < 10]]

⇐⇒ [F ⇒ T ] ⇐⇒ T[

[Pigs fly] ⇒ [5 > 10]]

⇐⇒ [F ⇒ F ] ⇐⇒ T

Discrete Mathematics I – p. 33/292

Page 103: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇒ [Pigs fly]]

⇐⇒ [T ⇒ F ] ⇐⇒ F[

[Pigs fly] ⇒ [5 < 10]]

⇐⇒ [F ⇒ T ] ⇐⇒ T[

[Pigs fly] ⇒ [5 > 10]]

⇐⇒ [F ⇒ F ]

⇐⇒ T

Discrete Mathematics I – p. 33/292

Page 104: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇒ [Pigs fly]]

⇐⇒ [T ⇒ F ] ⇐⇒ F[

[Pigs fly] ⇒ [5 < 10]]

⇐⇒ [F ⇒ T ] ⇐⇒ T[

[Pigs fly] ⇒ [5 > 10]]

⇐⇒ [F ⇒ F ] ⇐⇒ T

Discrete Mathematics I – p. 33/292

Page 105: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example (by G. Hardy):2 + 2 = 5 =⇒ I am Count Dracula

“Proof”:2 + 2 = 5 =⇒ 4 = 5 =⇒ 5 = 4 =⇒ 2 = 1

Dracula and I are two =⇒Dracula and I are one

Discrete Mathematics I – p. 34/292

Page 106: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example (by G. Hardy):2 + 2 = 5 =⇒ I am Count Dracula

“Proof”:2 + 2 = 5 =⇒ 4 = 5 =⇒ 5 = 4 =⇒ 2 = 1

Dracula and I are two =⇒Dracula and I are one

Discrete Mathematics I – p. 34/292

Page 107: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example (by G. Hardy):2 + 2 = 5 =⇒ I am Count Dracula

“Proof”:2 + 2 = 5 =⇒ 4 = 5 =⇒ 5 = 4 =⇒ 2 = 1

Dracula and I are two =⇒Dracula and I are one

Discrete Mathematics I – p. 34/292

Page 108: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example: 2 + 2 = 5 =⇒ Grass is green

Proof:2 + 2 = 5 =⇒ 4 = 5 =⇒ 5 = 4 =⇒

4 + 5 = 5 + 4 =⇒ T

T =⇒ Grass is green

Discrete Mathematics I – p. 35/292

Page 109: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example: 2 + 2 = 5 =⇒ Grass is green

Proof:2 + 2 = 5 =⇒ 4 = 5 =⇒ 5 = 4 =⇒

4 + 5 = 5 + 4 =⇒ T

T =⇒ Grass is green

Discrete Mathematics I – p. 35/292

Page 110: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Example: 2 + 2 = 5 =⇒ Grass is green

Proof:2 + 2 = 5 =⇒ 4 = 5 =⇒ 5 = 4 =⇒

4 + 5 = 5 + 4 =⇒ T

T =⇒ Grass is green

Discrete Mathematics I – p. 35/292

Page 111: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication A ⇒ B can have many disguises:

A implies B B is implied by A

A leads to B B follows from A

A is stronger than B B is weaker than A

A is sufficient for B B is necessary for A

Discrete Mathematics I – p. 36/292

Page 112: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication A ⇒ B can have many disguises:

A implies B

B is implied by A

A leads to B B follows from A

A is stronger than B B is weaker than A

A is sufficient for B B is necessary for A

Discrete Mathematics I – p. 36/292

Page 113: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication A ⇒ B can have many disguises:

A implies B B is implied by A

A leads to B B follows from A

A is stronger than B B is weaker than A

A is sufficient for B B is necessary for A

Discrete Mathematics I – p. 36/292

Page 114: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication A ⇒ B can have many disguises:

A implies B B is implied by A

A leads to B

B follows from A

A is stronger than B B is weaker than A

A is sufficient for B B is necessary for A

Discrete Mathematics I – p. 36/292

Page 115: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication A ⇒ B can have many disguises:

A implies B B is implied by A

A leads to B B follows from A

A is stronger than B B is weaker than A

A is sufficient for B B is necessary for A

Discrete Mathematics I – p. 36/292

Page 116: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication A ⇒ B can have many disguises:

A implies B B is implied by A

A leads to B B follows from A

A is stronger than B

B is weaker than A

A is sufficient for B B is necessary for A

Discrete Mathematics I – p. 36/292

Page 117: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication A ⇒ B can have many disguises:

A implies B B is implied by A

A leads to B B follows from A

A is stronger than B B is weaker than A

A is sufficient for B B is necessary for A

Discrete Mathematics I – p. 36/292

Page 118: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication A ⇒ B can have many disguises:

A implies B B is implied by A

A leads to B B follows from A

A is stronger than B B is weaker than A

A is sufficient for B

B is necessary for A

Discrete Mathematics I – p. 36/292

Page 119: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication A ⇒ B can have many disguises:

A implies B B is implied by A

A leads to B B follows from A

A is stronger than B B is weaker than A

A is sufficient for B B is necessary for A

Discrete Mathematics I – p. 36/292

Page 120: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

For a number to be divisible by 4, it is

necessary

thatit is even

For a triangle to be isosceles, it is sufficient that it isequilateral

Discrete Mathematics I – p. 37/292

Page 121: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

For a number to be divisible by 4, it is necessary thatit is even

For a triangle to be isosceles, it is sufficient that it isequilateral

Discrete Mathematics I – p. 37/292

Page 122: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

For a number to be divisible by 4, it is necessary thatit is even

For a triangle to be isosceles, it is

sufficient

that it isequilateral

Discrete Mathematics I – p. 37/292

Page 123: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

For a number to be divisible by 4, it is necessary thatit is even

For a triangle to be isosceles, it is sufficient that it isequilateral

Discrete Mathematics I – p. 37/292

Page 124: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Equivalence (A IF AND ONLY IF B): A ⇔ B

True if A and B agree; false otherwise

A B A ⇔ B

F F T

F T F

T F F

T T T

IF AND ONLY IF often contracted to IFF

Discrete Mathematics I – p. 38/292

Page 125: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Equivalence (A IF AND ONLY IF B): A ⇔ B

True if A and B agree; false otherwise

A B A ⇔ B

F F T

F T F

T F F

T T T

IF AND ONLY IF often contracted to IFF

Discrete Mathematics I – p. 38/292

Page 126: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Equivalence (A IF AND ONLY IF B): A ⇔ B

True if A and B agree; false otherwise

A B A ⇔ B

F F T

F T F

T F F

T T T

IF AND ONLY IF often contracted to IFF

Discrete Mathematics I – p. 38/292

Page 127: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇔ [Pigs fly]]

⇐⇒ [T ⇔ F ] ⇐⇒ F[

[Pigs fly] ⇔ [5 < 10]]

⇐⇒ [F ⇔ T ] ⇐⇒ F[

[Pigs fly] ⇔ [5 > 10]]

⇐⇒ [F ⇔ F ] ⇐⇒ T

Discrete Mathematics I – p. 39/292

Page 128: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇔ [Pigs fly]]

⇐⇒ [T ⇔ F ]

⇐⇒ F[

[Pigs fly] ⇔ [5 < 10]]

⇐⇒ [F ⇔ T ] ⇐⇒ F[

[Pigs fly] ⇔ [5 > 10]]

⇐⇒ [F ⇔ F ] ⇐⇒ T

Discrete Mathematics I – p. 39/292

Page 129: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇔ [Pigs fly]]

⇐⇒ [T ⇔ F ] ⇐⇒ F

[

[Pigs fly] ⇔ [5 < 10]]

⇐⇒ [F ⇔ T ] ⇐⇒ F[

[Pigs fly] ⇔ [5 > 10]]

⇐⇒ [F ⇔ F ] ⇐⇒ T

Discrete Mathematics I – p. 39/292

Page 130: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇔ [Pigs fly]]

⇐⇒ [T ⇔ F ] ⇐⇒ F[

[Pigs fly] ⇔ [5 < 10]]

⇐⇒ [F ⇔ T ] ⇐⇒ F[

[Pigs fly] ⇔ [5 > 10]]

⇐⇒ [F ⇔ F ] ⇐⇒ T

Discrete Mathematics I – p. 39/292

Page 131: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇔ [Pigs fly]]

⇐⇒ [T ⇔ F ] ⇐⇒ F[

[Pigs fly] ⇔ [5 < 10]]

⇐⇒ [F ⇔ T ]

⇐⇒ F[

[Pigs fly] ⇔ [5 > 10]]

⇐⇒ [F ⇔ F ] ⇐⇒ T

Discrete Mathematics I – p. 39/292

Page 132: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇔ [Pigs fly]]

⇐⇒ [T ⇔ F ] ⇐⇒ F[

[Pigs fly] ⇔ [5 < 10]]

⇐⇒ [F ⇔ T ] ⇐⇒ F

[

[Pigs fly] ⇔ [5 > 10]]

⇐⇒ [F ⇔ F ] ⇐⇒ T

Discrete Mathematics I – p. 39/292

Page 133: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇔ [Pigs fly]]

⇐⇒ [T ⇔ F ] ⇐⇒ F[

[Pigs fly] ⇔ [5 < 10]]

⇐⇒ [F ⇔ T ] ⇐⇒ F[

[Pigs fly] ⇔ [5 > 10]]

⇐⇒ [F ⇔ F ] ⇐⇒ T

Discrete Mathematics I – p. 39/292

Page 134: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇔ [Pigs fly]]

⇐⇒ [T ⇔ F ] ⇐⇒ F[

[Pigs fly] ⇔ [5 < 10]]

⇐⇒ [F ⇔ T ] ⇐⇒ F[

[Pigs fly] ⇔ [5 > 10]]

⇐⇒ [F ⇔ F ]

⇐⇒ T

Discrete Mathematics I – p. 39/292

Page 135: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:[

[5 < 10] ⇔ [Pigs fly]]

⇐⇒ [T ⇔ F ] ⇐⇒ F[

[Pigs fly] ⇔ [5 < 10]]

⇐⇒ [F ⇔ T ] ⇐⇒ F[

[Pigs fly] ⇔ [5 > 10]]

⇐⇒ [F ⇔ F ] ⇐⇒ T

Discrete Mathematics I – p. 39/292

Page 136: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication and equivalence are often used to statetheorems

Examples:

Axiom. If n is in N, then n + 1 is in N.That is, for all n, [n in N] =⇒ [n + 1 in N]

Theorem. Number n is even iff n + 1 is odd.That is, for all n in N, [n even] ⇐⇒ [n + 1 odd]

Discrete Mathematics I – p. 40/292

Page 137: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication and equivalence are often used to statetheorems

Examples:

Axiom. If n is in N, then n + 1 is in N.

That is, for all n, [n in N] =⇒ [n + 1 in N]

Theorem. Number n is even iff n + 1 is odd.That is, for all n in N, [n even] ⇐⇒ [n + 1 odd]

Discrete Mathematics I – p. 40/292

Page 138: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication and equivalence are often used to statetheorems

Examples:

Axiom. If n is in N, then n + 1 is in N.That is, for all n, [n in N] =⇒ [n + 1 in N]

Theorem. Number n is even iff n + 1 is odd.That is, for all n in N, [n even] ⇐⇒ [n + 1 odd]

Discrete Mathematics I – p. 40/292

Page 139: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication and equivalence are often used to statetheorems

Examples:

Axiom. If n is in N, then n + 1 is in N.That is, for all n, [n in N] =⇒ [n + 1 in N]

Theorem. Number n is even iff n + 1 is odd.

That is, for all n in N, [n even] ⇐⇒ [n + 1 odd]

Discrete Mathematics I – p. 40/292

Page 140: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication and equivalence are often used to statetheorems

Examples:

Axiom. If n is in N, then n + 1 is in N.That is, for all n, [n in N] =⇒ [n + 1 in N]

Theorem. Number n is even iff n + 1 is odd.That is, for all n in N, [n even] ⇐⇒ [n + 1 odd]

Discrete Mathematics I – p. 40/292

Page 141: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

More examples (from geometry):

Axiom. If two points are distinct, then there is exactlyone line connecting them.

Theorem. A triangle has two equal sides, if and onlyif it has two equal angles.

Discrete Mathematics I – p. 41/292

Page 142: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

More examples (from geometry):

Axiom. If two points are distinct, then there is exactlyone line connecting them.

Theorem. A triangle has two equal sides, if and onlyif it has two equal angles.

Discrete Mathematics I – p. 41/292

Page 143: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication and equivalence are used in proofs

Example:

Theorem. If number n is even, then n + 2 is even.

Proof.[n even] ⇒ [n + 1 odd] ⇒ [(n + 1) + 1 even]

Discrete Mathematics I – p. 42/292

Page 144: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication and equivalence are used in proofs

Example:

Theorem. If number n is even, then n + 2 is even.

Proof.[n even] ⇒ [n + 1 odd] ⇒ [(n + 1) + 1 even]

Discrete Mathematics I – p. 42/292

Page 145: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Implication and equivalence are used in proofs

Example:

Theorem. If number n is even, then n + 2 is even.

Proof.[n even] ⇒ [n + 1 odd] ⇒ [(n + 1) + 1 even]

Discrete Mathematics I – p. 42/292

Page 146: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

When proving “⇔”, must prove both “⇒” and “⇐”!

Example (a stronger theorem):

Theorem. Number n is even, iff n + 2 is even.

Proof.

“⇒” as before

“⇐”: [n + 2 = (n + 1) + 1 even] ⇒ [n + 1 odd] ⇒[n even]

Discrete Mathematics I – p. 43/292

Page 147: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

When proving “⇔”, must prove both “⇒” and “⇐”!

Example (a stronger theorem):

Theorem. Number n is even, iff n + 2 is even.

Proof.

“⇒” as before

“⇐”: [n + 2 = (n + 1) + 1 even] ⇒ [n + 1 odd] ⇒[n even]

Discrete Mathematics I – p. 43/292

Page 148: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

When proving “⇔”, must prove both “⇒” and “⇐”!

Example (a stronger theorem):

Theorem. Number n is even, iff n + 2 is even.

Proof.

“⇒” as before

“⇐”: [n + 2 = (n + 1) + 1 even] ⇒ [n + 1 odd] ⇒[n even]

Discrete Mathematics I – p. 43/292

Page 149: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

To cut down on brackets, we use priorities

Highest priority: ¬, then ∧, ∨, then ⇒, ⇔

Example:

¬(A ∧B) ⇔ ¬A ∨ ¬B means¬(A ∧B) ⇔ ((¬A) ∨ (¬B))

Discrete Mathematics I – p. 44/292

Page 150: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

To cut down on brackets, we use priorities

Highest priority: ¬, then ∧, ∨, then ⇒, ⇔Example:

¬(A ∧B) ⇔ ¬A ∨ ¬B means¬(A ∧B) ⇔ ((¬A) ∨ (¬B))

Discrete Mathematics I – p. 44/292

Page 151: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Truth table completely define logical operators.

Not always convenient:

(¬(T ∧ F ) ∨ ¬(F ⇒ T )) ⇔ (¬¬(F ∨ T ) ∨ F )

— true or false?

((A ∨B) ∧ C) ∨ ((¬A ∧ ¬B) ∨ ¬C)

— true for all A, B, C?

To simplify expressions, will use laws of logic

Discrete Mathematics I – p. 45/292

Page 152: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Truth table completely define logical operators.

Not always convenient:

(¬(T ∧ F ) ∨ ¬(F ⇒ T )) ⇔ (¬¬(F ∨ T ) ∨ F )

— true or false?

((A ∨B) ∧ C) ∨ ((¬A ∧ ¬B) ∨ ¬C)

— true for all A, B, C?

To simplify expressions, will use laws of logic

Discrete Mathematics I – p. 45/292

Page 153: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Truth table completely define logical operators.

Not always convenient:

(¬(T ∧ F ) ∨ ¬(F ⇒ T )) ⇔ (¬¬(F ∨ T ) ∨ F )

— true or false?

((A ∨B) ∧ C) ∨ ((¬A ∧ ¬B) ∨ ¬C)

— true for all A, B, C?

To simplify expressions, will use laws of logic

Discrete Mathematics I – p. 45/292

Page 154: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Truth table completely define logical operators.

Not always convenient:

(¬(T ∧ F ) ∨ ¬(F ⇒ T )) ⇔ (¬¬(F ∨ T ) ∨ F )

— true or false?

((A ∨B) ∧ C) ∨ ((¬A ∧ ¬B) ∨ ¬C)

— true for all A, B, C?

To simplify expressions, will use laws of logic

Discrete Mathematics I – p. 45/292

Page 155: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Laws of Boolean logic (hold for any A, B, C):

¬¬A ⇐⇒ A double negation

A ∧ A ⇐⇒ A ∧ idempotentA ∨ A ⇐⇒ A ∨ idempotent

A ∧B ⇐⇒ B ∧ A ∧ commutativeA ∨B ⇐⇒ B ∨ A ∨ commutative

Discrete Mathematics I – p. 46/292

Page 156: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Laws of Boolean logic (hold for any A, B, C):

¬¬A ⇐⇒ A double negation

A ∧ A ⇐⇒ A ∧ idempotentA ∨ A ⇐⇒ A ∨ idempotent

A ∧B ⇐⇒ B ∧ A ∧ commutativeA ∨B ⇐⇒ B ∨ A ∨ commutative

Discrete Mathematics I – p. 46/292

Page 157: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Laws of Boolean logic (hold for any A, B, C):

¬¬A ⇐⇒ A double negation

A ∧ A ⇐⇒ A ∧ idempotentA ∨ A ⇐⇒ A ∨ idempotent

A ∧B ⇐⇒ B ∧ A ∧ commutativeA ∨B ⇐⇒ B ∨ A ∨ commutative

Discrete Mathematics I – p. 46/292

Page 158: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

More laws of Boolean logic:

(A ∧B) ∧ C ⇐⇒ A ∧ (B ∧ C) ∧ associative(A ∨B) ∨ C ⇐⇒ A ∨ (B ∨ C) ∨ associative

A ∧ (B ∨ C) ⇐⇒ (A ∧B) ∨ (A ∧ C)∧ distributes over ∨

A ∨ (B ∧ C) ⇐⇒ (A ∨B) ∧ (A ∨ C)∨ distributes over ∧

Compare a · (b + c) = a · b + a · c,but a + b · c 6= (a + b) · (a + c)

Discrete Mathematics I – p. 47/292

Page 159: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

More laws of Boolean logic:

(A ∧B) ∧ C ⇐⇒ A ∧ (B ∧ C) ∧ associative(A ∨B) ∨ C ⇐⇒ A ∨ (B ∨ C) ∨ associative

A ∧ (B ∨ C) ⇐⇒ (A ∧B) ∨ (A ∧ C)∧ distributes over ∨

A ∨ (B ∧ C) ⇐⇒ (A ∨B) ∧ (A ∨ C)∨ distributes over ∧

Compare a · (b + c) = a · b + a · c,but a + b · c 6= (a + b) · (a + c)

Discrete Mathematics I – p. 47/292

Page 160: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

More laws of Boolean logic:

(A ∧B) ∧ C ⇐⇒ A ∧ (B ∧ C) ∧ associative(A ∨B) ∨ C ⇐⇒ A ∨ (B ∨ C) ∨ associative

A ∧ (B ∨ C) ⇐⇒ (A ∧B) ∨ (A ∧ C)∧ distributes over ∨

A ∨ (B ∧ C) ⇐⇒ (A ∨B) ∧ (A ∨ C)∨ distributes over ∧

Compare a · (b + c) = a · b + a · c,but a + b · c 6= (a + b) · (a + c)

Discrete Mathematics I – p. 47/292

Page 161: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

More laws of Boolean logic:

(A ∧B) ∧ C ⇐⇒ A ∧ (B ∧ C) ∧ associative(A ∨B) ∨ C ⇐⇒ A ∨ (B ∨ C) ∨ associative

A ∧ (B ∨ C) ⇐⇒ (A ∧B) ∨ (A ∧ C)∧ distributes over ∨

A ∨ (B ∧ C) ⇐⇒ (A ∨B) ∧ (A ∨ C)∨ distributes over ∧

Compare a · (b + c) = a · b + a · c,but a + b · c 6= (a + b) · (a + c)

Discrete Mathematics I – p. 47/292

Page 162: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

De Morgan’s laws:

¬(A ∧B) ⇐⇒ ¬A ∨ ¬B¬(A ∨B) ⇐⇒ ¬A ∧ ¬B

Thus, A ∧B ⇐⇒ ¬(¬A ∨ ¬B),so ∧ can be expressed via ¬, ∨Alternatively, A ∨B ⇐⇒ ¬(¬A ∧ ¬B),so ∨ can be expressed via ¬, ∧(Cannot remove both ∧, ∨ at the same time!)

Discrete Mathematics I – p. 48/292

Page 163: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

De Morgan’s laws:

¬(A ∧B) ⇐⇒ ¬A ∨ ¬B¬(A ∨B) ⇐⇒ ¬A ∧ ¬B

Thus, A ∧B ⇐⇒ ¬(¬A ∨ ¬B),so ∧ can be expressed via ¬, ∨

Alternatively, A ∨B ⇐⇒ ¬(¬A ∧ ¬B),so ∨ can be expressed via ¬, ∧(Cannot remove both ∧, ∨ at the same time!)

Discrete Mathematics I – p. 48/292

Page 164: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

De Morgan’s laws:

¬(A ∧B) ⇐⇒ ¬A ∨ ¬B¬(A ∨B) ⇐⇒ ¬A ∧ ¬B

Thus, A ∧B ⇐⇒ ¬(¬A ∨ ¬B),so ∧ can be expressed via ¬, ∨Alternatively, A ∨B ⇐⇒ ¬(¬A ∧ ¬B),so ∨ can be expressed via ¬, ∧

(Cannot remove both ∧, ∨ at the same time!)

Discrete Mathematics I – p. 48/292

Page 165: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

De Morgan’s laws:

¬(A ∧B) ⇐⇒ ¬A ∨ ¬B¬(A ∨B) ⇐⇒ ¬A ∧ ¬B

Thus, A ∧B ⇐⇒ ¬(¬A ∨ ¬B),so ∧ can be expressed via ¬, ∨Alternatively, A ∨B ⇐⇒ ¬(¬A ∧ ¬B),so ∨ can be expressed via ¬, ∧(Cannot remove both ∧, ∨ at the same time!)

Discrete Mathematics I – p. 48/292

Page 166: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Still more laws of Boolean logic:

A ∧ T ⇐⇒ A A ∨ F ⇐⇒ A identity laws

A ∧ F ⇐⇒ F A ∨ T ⇐⇒ Tannihilation laws

A ∧ ¬A ⇐⇒ F A ∨ ¬A ⇐⇒ Tlaws of excluded middle

A ∧ (A ∨B) ⇐⇒ A ⇐⇒ A ∨ (A ∧B)absorption laws

Discrete Mathematics I – p. 49/292

Page 167: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Still more laws of Boolean logic:

A ∧ T ⇐⇒ A A ∨ F ⇐⇒ A identity laws

A ∧ F ⇐⇒ F A ∨ T ⇐⇒ Tannihilation laws

A ∧ ¬A ⇐⇒ F A ∨ ¬A ⇐⇒ Tlaws of excluded middle

A ∧ (A ∨B) ⇐⇒ A ⇐⇒ A ∨ (A ∧B)absorption laws

Discrete Mathematics I – p. 49/292

Page 168: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Still more laws of Boolean logic:

A ∧ T ⇐⇒ A A ∨ F ⇐⇒ A identity laws

A ∧ F ⇐⇒ F A ∨ T ⇐⇒ Tannihilation laws

A ∧ ¬A ⇐⇒ F A ∨ ¬A ⇐⇒ Tlaws of excluded middle

A ∧ (A ∨B) ⇐⇒ A ⇐⇒ A ∨ (A ∧B)absorption laws

Discrete Mathematics I – p. 49/292

Page 169: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Still more laws of Boolean logic:

A ∧ T ⇐⇒ A A ∨ F ⇐⇒ A identity laws

A ∧ F ⇐⇒ F A ∨ T ⇐⇒ Tannihilation laws

A ∧ ¬A ⇐⇒ F A ∨ ¬A ⇐⇒ Tlaws of excluded middle

A ∧ (A ∨B) ⇐⇒ A ⇐⇒ A ∨ (A ∧B)absorption laws

Discrete Mathematics I – p. 49/292

Page 170: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Finally,

(A ⇒ B) ⇐⇒ (¬A ∨B) ⇐⇒ ¬(A ∧ ¬B)

(A ⇔ B) ⇐⇒ (A ⇒ B) ∧ (B ⇒ A) ⇐⇒(A ∧B) ∨ (¬A ∧ ¬B)

So, ⇒ and ⇔ are redundant (but convenient)

Discrete Mathematics I – p. 50/292

Page 171: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Finally,

(A ⇒ B) ⇐⇒ (¬A ∨B) ⇐⇒ ¬(A ∧ ¬B)

(A ⇔ B) ⇐⇒ (A ⇒ B) ∧ (B ⇒ A) ⇐⇒(A ∧B) ∨ (¬A ∧ ¬B)

So, ⇒ and ⇔ are redundant (but convenient)

Discrete Mathematics I – p. 50/292

Page 172: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Finally,

(A ⇒ B) ⇐⇒ (¬A ∨B) ⇐⇒ ¬(A ∧ ¬B)

(A ⇔ B) ⇐⇒ (A ⇒ B) ∧ (B ⇒ A) ⇐⇒(A ∧B) ∨ (¬A ∧ ¬B)

So, ⇒ and ⇔ are redundant (but convenient)

Discrete Mathematics I – p. 50/292

Page 173: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

All these laws can be verified by truth tables

Example: ¬(A ∧B) ⇐⇒ (¬A ∨ ¬B)

A B A ∧B ¬(A ∧B) ¬A ¬B (¬A ∨ ¬B)

T T T F F F F

T F F T F T T

F T F T T F T

F F F T T T T

? ?

Discrete Mathematics I – p. 51/292

Page 174: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

All these laws can be verified by truth tables

Example: ¬(A ∧B) ⇐⇒ (¬A ∨ ¬B)

A B A ∧B ¬(A ∧B) ¬A ¬B (¬A ∨ ¬B)

T T T F F F F

T F F T F T T

F T F T T F T

F F F T T T T

? ?

Discrete Mathematics I – p. 51/292

Page 175: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

All these laws can be verified by truth tables

Example: ¬(A ∧B) ⇐⇒ (¬A ∨ ¬B)

A B A ∧B ¬(A ∧B) ¬A ¬B (¬A ∨ ¬B)

T T

T F F F F

T F

F T F T T

F T

F T T F T

F F

F T T T T

? ?

Discrete Mathematics I – p. 51/292

Page 176: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

All these laws can be verified by truth tables

Example: ¬(A ∧B) ⇐⇒ (¬A ∨ ¬B)

A B A ∧B ¬(A ∧B) ¬A ¬B (¬A ∨ ¬B)

T T T

F F F F

T F F

T F T T

F T F

T T F T

F F F

T T T T

? ?

Discrete Mathematics I – p. 51/292

Page 177: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

All these laws can be verified by truth tables

Example: ¬(A ∧B) ⇐⇒ (¬A ∨ ¬B)

A B A ∧B ¬(A ∧B) ¬A ¬B (¬A ∨ ¬B)

T T T F

F F F

T F F T

F T T

F T F T

T F T

F F F T

T T T

? ?

Discrete Mathematics I – p. 51/292

Page 178: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

All these laws can be verified by truth tables

Example: ¬(A ∧B) ⇐⇒ (¬A ∨ ¬B)

A B A ∧B ¬(A ∧B) ¬A ¬B (¬A ∨ ¬B)

T T T F F F

F

T F F T F T

T

F T F T T F

T

F F F T T T

T

? ?

Discrete Mathematics I – p. 51/292

Page 179: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

All these laws can be verified by truth tables

Example: ¬(A ∧B) ⇐⇒ (¬A ∨ ¬B)

A B A ∧B ¬(A ∧B) ¬A ¬B (¬A ∨ ¬B)

T T T F F F F

T F F T F T T

F T F T T F T

F F F T T T T

? ?

Discrete Mathematics I – p. 51/292

Page 180: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

All these laws can be verified by truth tables

Example: ¬(A ∧B) ⇐⇒ (¬A ∨ ¬B)

A B A ∧B ¬(A ∧B) ¬A ¬B (¬A ∨ ¬B)

T T T F F F F

T F F T F T T

F T F T T F T

F F F T T T T

? ?

Discrete Mathematics I – p. 51/292

Page 181: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using laws of logic

Prove: (A ⇒ B) ⇐⇒ (¬B ⇒ ¬A).

Proof.

(¬B ⇒ ¬A) ⇐⇒ (¬¬B ∨ ¬A) ⇐⇒(B ∨ ¬A) ⇐⇒ (¬A ∨B) ⇐⇒ (A ⇒ B)

¬B ⇒ ¬A is the contapositive of A ⇒ B

B ⇒ A is the converse of A ⇒ B

Statement A ⇒ B is equivalent to its contrapositive,but not to its converse

Equivalence with contrapositive allows proof bycontradiction

Discrete Mathematics I – p. 52/292

Page 182: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using laws of logic

Prove: (A ⇒ B) ⇐⇒ (¬B ⇒ ¬A).

Proof.

(¬B ⇒ ¬A)

⇐⇒ (¬¬B ∨ ¬A) ⇐⇒(B ∨ ¬A) ⇐⇒ (¬A ∨B) ⇐⇒ (A ⇒ B)

¬B ⇒ ¬A is the contapositive of A ⇒ B

B ⇒ A is the converse of A ⇒ B

Statement A ⇒ B is equivalent to its contrapositive,but not to its converse

Equivalence with contrapositive allows proof bycontradiction

Discrete Mathematics I – p. 52/292

Page 183: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using laws of logic

Prove: (A ⇒ B) ⇐⇒ (¬B ⇒ ¬A).

Proof.

(¬B ⇒ ¬A) ⇐⇒ (¬¬B ∨ ¬A)

⇐⇒(B ∨ ¬A) ⇐⇒ (¬A ∨B) ⇐⇒ (A ⇒ B)

¬B ⇒ ¬A is the contapositive of A ⇒ B

B ⇒ A is the converse of A ⇒ B

Statement A ⇒ B is equivalent to its contrapositive,but not to its converse

Equivalence with contrapositive allows proof bycontradiction

Discrete Mathematics I – p. 52/292

Page 184: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using laws of logic

Prove: (A ⇒ B) ⇐⇒ (¬B ⇒ ¬A).

Proof.

(¬B ⇒ ¬A) ⇐⇒ (¬¬B ∨ ¬A) ⇐⇒(B ∨ ¬A)

⇐⇒ (¬A ∨B) ⇐⇒ (A ⇒ B)

¬B ⇒ ¬A is the contapositive of A ⇒ B

B ⇒ A is the converse of A ⇒ B

Statement A ⇒ B is equivalent to its contrapositive,but not to its converse

Equivalence with contrapositive allows proof bycontradiction

Discrete Mathematics I – p. 52/292

Page 185: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using laws of logic

Prove: (A ⇒ B) ⇐⇒ (¬B ⇒ ¬A).

Proof.

(¬B ⇒ ¬A) ⇐⇒ (¬¬B ∨ ¬A) ⇐⇒(B ∨ ¬A) ⇐⇒ (¬A ∨B)

⇐⇒ (A ⇒ B)

¬B ⇒ ¬A is the contapositive of A ⇒ B

B ⇒ A is the converse of A ⇒ B

Statement A ⇒ B is equivalent to its contrapositive,but not to its converse

Equivalence with contrapositive allows proof bycontradiction

Discrete Mathematics I – p. 52/292

Page 186: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using laws of logic

Prove: (A ⇒ B) ⇐⇒ (¬B ⇒ ¬A).

Proof.

(¬B ⇒ ¬A) ⇐⇒ (¬¬B ∨ ¬A) ⇐⇒(B ∨ ¬A) ⇐⇒ (¬A ∨B) ⇐⇒ (A ⇒ B)

¬B ⇒ ¬A is the contapositive of A ⇒ B

B ⇒ A is the converse of A ⇒ B

Statement A ⇒ B is equivalent to its contrapositive,but not to its converse

Equivalence with contrapositive allows proof bycontradiction

Discrete Mathematics I – p. 52/292

Page 187: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using laws of logic

Prove: (A ⇒ B) ⇐⇒ (¬B ⇒ ¬A).

Proof.

(¬B ⇒ ¬A) ⇐⇒ (¬¬B ∨ ¬A) ⇐⇒(B ∨ ¬A) ⇐⇒ (¬A ∨B) ⇐⇒ (A ⇒ B)

¬B ⇒ ¬A is the contapositive of A ⇒ B

B ⇒ A is the converse of A ⇒ B

Statement A ⇒ B is equivalent to its contrapositive,but not to its converse

Equivalence with contrapositive allows proof bycontradiction

Discrete Mathematics I – p. 52/292

Page 188: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using laws of logic

Prove: (A ⇒ B) ⇐⇒ (¬B ⇒ ¬A).

Proof.

(¬B ⇒ ¬A) ⇐⇒ (¬¬B ∨ ¬A) ⇐⇒(B ∨ ¬A) ⇐⇒ (¬A ∨B) ⇐⇒ (A ⇒ B)

¬B ⇒ ¬A is the contapositive of A ⇒ B

B ⇒ A is the converse of A ⇒ B

Statement A ⇒ B is equivalent to its contrapositive,but not to its converse

Equivalence with contrapositive allows proof bycontradiction

Discrete Mathematics I – p. 52/292

Page 189: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Holmes: I see our visitor was absent-minded. . .

Watson: But why!??

Holmes: Elementary, my dear Watson! Alert peoplenever leave things behind. But he left his walkingstick. Therefore, he must be absent-minded.

A = “person is alert”B = “person does not leave things behind”

Holmes’ argument: (A ⇒ B) =⇒ (¬B ⇒ ¬A)

Discrete Mathematics I – p. 53/292

Page 190: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Holmes: I see our visitor was absent-minded. . .

Watson: But why!??

Holmes: Elementary, my dear Watson! Alert peoplenever leave things behind. But he left his walkingstick. Therefore, he must be absent-minded.

A = “person is alert”B = “person does not leave things behind”

Holmes’ argument: (A ⇒ B) =⇒ (¬B ⇒ ¬A)

Discrete Mathematics I – p. 53/292

Page 191: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Holmes: I see our visitor was absent-minded. . .

Watson: But why!??

Holmes: Elementary, my dear Watson! Alert peoplenever leave things behind. But he left his walkingstick. Therefore, he must be absent-minded.

A = “person is alert”B = “person does not leave things behind”

Holmes’ argument: (A ⇒ B) =⇒ (¬B ⇒ ¬A)

Discrete Mathematics I – p. 53/292

Page 192: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Holmes: I see our visitor was absent-minded. . .

Watson: But why!??

Holmes: Elementary, my dear Watson! Alert peoplenever leave things behind. But he left his walkingstick. Therefore, he must be absent-minded.

A = “person is alert”B = “person does not leave things behind”

Holmes’ argument: (A ⇒ B) =⇒ (¬B ⇒ ¬A)

Discrete Mathematics I – p. 53/292

Page 193: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Sign in a restaurant:

Good food is not cheap.

Cheap food is not good.Is it repeating the same thing twice?

Yes! The statements are contrapositive to each other.

Discrete Mathematics I – p. 54/292

Page 194: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Sign in a restaurant:

Good food is not cheap.

Cheap food is not good.Is it repeating the same thing twice?

Yes! The statements are contrapositive to each other.

Discrete Mathematics I – p. 54/292

Page 195: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Somebody walks into a pub and says:

If I drink, everybody drinks!

Can this statement be true?

Discrete Mathematics I – p. 55/292

Page 196: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Answer: yes, it can!

Proof. We know the world is nonempty.

Case 1: Suppose everybody in the world drinks. Thenevery person can say that.

Case 2: Suppose Joe does not drink. Then Joe can saythat.

Discrete Mathematics I – p. 56/292

Page 197: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Answer: yes, it can!

Proof. We know the world is nonempty.

Case 1: Suppose everybody in the world drinks. Thenevery person can say that.

Case 2: Suppose Joe does not drink. Then Joe can saythat.

Discrete Mathematics I – p. 56/292

Page 198: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Answer: yes, it can!

Proof. We know the world is nonempty.

Case 1: Suppose everybody in the world drinks. Thenevery person can say that.

Case 2: Suppose Joe does not drink. Then Joe can saythat.

Discrete Mathematics I – p. 56/292

Page 199: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Somebody walks into a pub and says:

If anybody drinks, I drink!

Can this statement be true?

Discrete Mathematics I – p. 57/292

Page 200: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Answer: yes, it can!

Proof. We know the world is nonempty.

Case 1: Suppose nobody in the world drinks. Thenevery person can say that.

Case 2: Suppose Jack drinks. Then Jack can saythat.

Discrete Mathematics I – p. 58/292

Page 201: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Answer: yes, it can!

Proof. We know the world is nonempty.

Case 1: Suppose nobody in the world drinks. Thenevery person can say that.

Case 2: Suppose Jack drinks. Then Jack can saythat.

Discrete Mathematics I – p. 58/292

Page 202: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Answer: yes, it can!

Proof. We know the world is nonempty.

Case 1: Suppose nobody in the world drinks. Thenevery person can say that.

Case 2: Suppose Jack drinks. Then Jack can saythat.

Discrete Mathematics I – p. 58/292

Page 203: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

So far — statements about individual objects:

Five is less than tenThe pie is not as bad as it looks

Often need to say more:

Some natural numbers are less than tenAll pies are not as bad as they look

Discrete Mathematics I – p. 59/292

Page 204: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

So far — statements about individual objects:

Five is less than tenThe pie is not as bad as it looks

Often need to say more:

Some natural numbers are less than tenAll pies are not as bad as they look

Discrete Mathematics I – p. 59/292

Page 205: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Some natural numbers are less than ten

Could try to specify an instance:

Five is less than ten

What if we do not have an instance?

Discrete Mathematics I – p. 60/292

Page 206: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Some natural numbers are less than ten

Could try to specify an instance:

Five is less than ten

What if we do not have an instance?

Discrete Mathematics I – p. 60/292

Page 207: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Some natural numbers are less than ten

Could try to specify an instance:

Five is less than ten

What if we do not have an instance?

Discrete Mathematics I – p. 60/292

Page 208: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Could try to use Boolean operators:

Some natural numbers are less than ten

(0 < 10) ∨ (1 < 10) ∨ (2 < 10) ∨ (3 < 10) ∨ · · ·All pies are not as bad as they look

(Chicken pie. . . ) ∧ (Mushroom pie. . . ) ∧(Cabbage pie. . . ) ∧ · · ·Cannot have infinite conjunction/disjunction!

Discrete Mathematics I – p. 61/292

Page 209: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Could try to use Boolean operators:

Some natural numbers are less than ten

(0 < 10) ∨ (1 < 10) ∨ (2 < 10) ∨ (3 < 10) ∨ · · ·All pies are not as bad as they look

(Chicken pie. . . ) ∧ (Mushroom pie. . . ) ∧(Cabbage pie. . . ) ∧ · · ·Cannot have infinite conjunction/disjunction!

Discrete Mathematics I – p. 61/292

Page 210: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Could try to use Boolean operators:

Some natural numbers are less than ten

(0 < 10) ∨ (1 < 10) ∨ (2 < 10) ∨ (3 < 10) ∨ · · ·

All pies are not as bad as they look

(Chicken pie. . . ) ∧ (Mushroom pie. . . ) ∧(Cabbage pie. . . ) ∧ · · ·Cannot have infinite conjunction/disjunction!

Discrete Mathematics I – p. 61/292

Page 211: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Could try to use Boolean operators:

Some natural numbers are less than ten

(0 < 10) ∨ (1 < 10) ∨ (2 < 10) ∨ (3 < 10) ∨ · · ·All pies are not as bad as they look

(Chicken pie. . . ) ∧ (Mushroom pie. . . ) ∧(Cabbage pie. . . ) ∧ · · ·Cannot have infinite conjunction/disjunction!

Discrete Mathematics I – p. 61/292

Page 212: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Could try to use Boolean operators:

Some natural numbers are less than ten

(0 < 10) ∨ (1 < 10) ∨ (2 < 10) ∨ (3 < 10) ∨ · · ·All pies are not as bad as they look

(Chicken pie. . . ) ∧ (Mushroom pie. . . ) ∧(Cabbage pie. . . ) ∧ · · ·

Cannot have infinite conjunction/disjunction!

Discrete Mathematics I – p. 61/292

Page 213: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Could try to use Boolean operators:

Some natural numbers are less than ten

(0 < 10) ∨ (1 < 10) ∨ (2 < 10) ∨ (3 < 10) ∨ · · ·All pies are not as bad as they look

(Chicken pie. . . ) ∧ (Mushroom pie. . . ) ∧(Cabbage pie. . . ) ∧ · · ·Cannot have infinite conjunction/disjunction!

Discrete Mathematics I – p. 61/292

Page 214: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

A predicate is a sentence with variables

Becomes true or false when values are substituted forvariables

Values are taken from a particular set (the range)

Always assume range is nonempty

Discrete Mathematics I – p. 62/292

Page 215: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

A predicate is a sentence with variables

Becomes true or false when values are substituted forvariables

Values are taken from a particular set (the range)

Always assume range is nonempty

Discrete Mathematics I – p. 62/292

Page 216: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

x < 10 (x in N)

“Pie p is not as bad as it looks” (p in Pies)

Can be true or false, depending on x, p

Discrete Mathematics I – p. 63/292

Page 217: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

x < 10 (x in N)

“Pie p is not as bad as it looks” (p in Pies)

Can be true or false, depending on x, p

Discrete Mathematics I – p. 63/292

Page 218: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Examples:

x < 10 (x in N)

“Pie p is not as bad as it looks” (p in Pies)

Can be true or false, depending on x, p

Discrete Mathematics I – p. 63/292

Page 219: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

A predicate can have more than one variable

Examples:

x < y (x, y in N)

“Pie p is better than pie q” (p, q in Pies)

Discrete Mathematics I – p. 64/292

Page 220: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

A predicate can have more than one variable

Examples:

x < y (x, y in N)

“Pie p is better than pie q” (p, q in Pies)

Discrete Mathematics I – p. 64/292

Page 221: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

A predicate can have more than one variable

Examples:

x < y (x, y in N)

“Pie p is better than pie q” (p, q in Pies)

Discrete Mathematics I – p. 64/292

Page 222: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Predicate with no variables: ordinary statement

Examples:

5 < 10

“My pie is better than your pie”

Discrete Mathematics I – p. 65/292

Page 223: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Predicate with no variables: ordinary statement

Examples:

5 < 10

“My pie is better than your pie”

Discrete Mathematics I – p. 65/292

Page 224: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Predicate with no variables: ordinary statement

Examples:

5 < 10

“My pie is better than your pie”

Discrete Mathematics I – p. 65/292

Page 225: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Let P (x) be a predicate with variable x

Can make statements by quantifiers

Existential (FOR SOME x, P (x)): ∃x : P (x)

Universal (FOR ALL x, P (x)): ∀x : P (x)

A particular range of x always assumed

Discrete Mathematics I – p. 66/292

Page 226: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Let P (x) be a predicate with variable x

Can make statements by quantifiers

Existential (FOR SOME x, P (x)): ∃x : P (x)

Universal (FOR ALL x, P (x)): ∀x : P (x)

A particular range of x always assumed

Discrete Mathematics I – p. 66/292

Page 227: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Let P (x) be a predicate with variable x

Can make statements by quantifiers

Existential (FOR SOME x, P (x)): ∃x : P (x)

Universal (FOR ALL x, P (x)): ∀x : P (x)

A particular range of x always assumed

Discrete Mathematics I – p. 66/292

Page 228: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Let P (x) be a predicate with variable x

Can make statements by quantifiers

Existential (FOR SOME x, P (x)): ∃x : P (x)

Universal (FOR ALL x, P (x)): ∀x : P (x)

A particular range of x always assumed

Discrete Mathematics I – p. 66/292

Page 229: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Range often made explicit

Examples:

∃x ∈ N : x < 10

∀p ∈ Pies : “p is not as bad as it looks”

∀x ∈ N : ∃y ∈ N : x < y

∃y ∈ N : ∀x ∈ N : x < y — note the difference!

Discrete Mathematics I – p. 67/292

Page 230: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Range often made explicit

Examples:

∃x ∈ N : x < 10

∀p ∈ Pies : “p is not as bad as it looks”

∀x ∈ N : ∃y ∈ N : x < y

∃y ∈ N : ∀x ∈ N : x < y — note the difference!

Discrete Mathematics I – p. 67/292

Page 231: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Range often made explicit

Examples:

∃x ∈ N : x < 10

∀p ∈ Pies : “p is not as bad as it looks”

∀x ∈ N : ∃y ∈ N : x < y

∃y ∈ N : ∀x ∈ N : x < y — note the difference!

Discrete Mathematics I – p. 67/292

Page 232: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Range often made explicit

Examples:

∃x ∈ N : x < 10

∀p ∈ Pies : “p is not as bad as it looks”

∀x ∈ N : ∃y ∈ N : x < y

∃y ∈ N : ∀x ∈ N : x < y — note the difference!

Discrete Mathematics I – p. 67/292

Page 233: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Range often made explicit

Examples:

∃x ∈ N : x < 10

∀p ∈ Pies : “p is not as bad as it looks”

∀x ∈ N : ∃y ∈ N : x < y

∃y ∈ N : ∀x ∈ N : x < y — note the difference!

Discrete Mathematics I – p. 67/292

Page 234: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifier variable can be changed

∀p ∈ Pies : “p is not as bad as it looks” ⇐⇒∀π ∈ Pies : “π is not as bad as it looks”

Variable under a quantifier bound, otherwise free

Example:

∃y ∈ N : x > y x free, y bound

Truth value depends on x, but not on y

Discrete Mathematics I – p. 68/292

Page 235: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifier variable can be changed

∀p ∈ Pies : “p is not as bad as it looks” ⇐⇒

∀π ∈ Pies : “π is not as bad as it looks”

Variable under a quantifier bound, otherwise free

Example:

∃y ∈ N : x > y x free, y bound

Truth value depends on x, but not on y

Discrete Mathematics I – p. 68/292

Page 236: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifier variable can be changed

∀p ∈ Pies : “p is not as bad as it looks” ⇐⇒∀π ∈ Pies : “π is not as bad as it looks”

Variable under a quantifier bound, otherwise free

Example:

∃y ∈ N : x > y x free, y bound

Truth value depends on x, but not on y

Discrete Mathematics I – p. 68/292

Page 237: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifier variable can be changed

∀p ∈ Pies : “p is not as bad as it looks” ⇐⇒∀π ∈ Pies : “π is not as bad as it looks”

Variable under a quantifier bound, otherwise free

Example:

∃y ∈ N : x > y x free, y bound

Truth value depends on x, but not on y

Discrete Mathematics I – p. 68/292

Page 238: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifier variable can be changed

∀p ∈ Pies : “p is not as bad as it looks” ⇐⇒∀π ∈ Pies : “π is not as bad as it looks”

Variable under a quantifier bound, otherwise free

Example:

∃y ∈ N : x > y x free, y bound

Truth value depends on x, but not on y

Discrete Mathematics I – p. 68/292

Page 239: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifier variable can be changed

∀p ∈ Pies : “p is not as bad as it looks” ⇐⇒∀π ∈ Pies : “π is not as bad as it looks”

Variable under a quantifier bound, otherwise free

Example:

∃y ∈ N : x > y x free, y bound

Truth value depends on x, but not on y

Discrete Mathematics I – p. 68/292

Page 240: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

P (u, v) ⇐⇒ u > v u, v free

Q1(x) ⇐⇒ P (x, 5) ⇐⇒ x > 5 x free

Q2(z) ⇐⇒ P (3, z) ⇐⇒ 3 > z z free

Q3(y) ⇐⇒ ∀x : P (x, y) ⇐⇒ ∀u : P (u, y)⇐⇒ ∀u : u > y y free x, u bound

Q4(v) ⇐⇒ ∃y : P (v, y) ⇐⇒ ∃w : P (v, w)⇐⇒ ∃w : v > w v free y, w bound

Discrete Mathematics I – p. 69/292

Page 241: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

P (u, v) ⇐⇒ u > v u, v free

Q1(x) ⇐⇒ P (x, 5) ⇐⇒ x > 5 x free

Q2(z) ⇐⇒ P (3, z) ⇐⇒ 3 > z z free

Q3(y) ⇐⇒ ∀x : P (x, y) ⇐⇒ ∀u : P (u, y)⇐⇒ ∀u : u > y y free x, u bound

Q4(v) ⇐⇒ ∃y : P (v, y) ⇐⇒ ∃w : P (v, w)⇐⇒ ∃w : v > w v free y, w bound

Discrete Mathematics I – p. 69/292

Page 242: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

P (u, v) ⇐⇒ u > v u, v free

Q1(x) ⇐⇒ P (x, 5) ⇐⇒ x > 5 x free

Q2(z) ⇐⇒ P (3, z) ⇐⇒ 3 > z z free

Q3(y) ⇐⇒ ∀x : P (x, y) ⇐⇒ ∀u : P (u, y)⇐⇒ ∀u : u > y y free x, u bound

Q4(v) ⇐⇒ ∃y : P (v, y) ⇐⇒ ∃w : P (v, w)⇐⇒ ∃w : v > w v free y, w bound

Discrete Mathematics I – p. 69/292

Page 243: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

P (u, v) ⇐⇒ u > v u, v free

Q1(x) ⇐⇒ P (x, 5) ⇐⇒ x > 5 x free

Q2(z) ⇐⇒ P (3, z) ⇐⇒ 3 > z z free

Q3(y) ⇐⇒ ∀x : P (x, y) ⇐⇒ ∀u : P (u, y)⇐⇒ ∀u : u > y y free x, u bound

Q4(v) ⇐⇒ ∃y : P (v, y) ⇐⇒ ∃w : P (v, w)⇐⇒ ∃w : v > w v free y, w bound

Discrete Mathematics I – p. 69/292

Page 244: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

P (u, v) ⇐⇒ u > v u, v free

Q1(x) ⇐⇒ P (x, 5) ⇐⇒ x > 5 x free

Q2(z) ⇐⇒ P (3, z) ⇐⇒ 3 > z z free

Q3(y) ⇐⇒ ∀x : P (x, y) ⇐⇒ ∀u : P (u, y)⇐⇒ ∀u : u > y y free x, u bound

Q4(v) ⇐⇒ ∃y : P (v, y) ⇐⇒ ∃w : P (v, w)⇐⇒ ∃w : v > w v free y, w bound

Discrete Mathematics I – p. 69/292

Page 245: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

P (u, v) ⇐⇒ u > v u, v free

Q1(x) ⇐⇒ P (x, 5) ⇐⇒ x > 5 x free

Q2(z) ⇐⇒ P (3, z) ⇐⇒ 3 > z z free

Q3(y) ⇐⇒ ∀x : P (x, y) ⇐⇒ ∀u : P (u, y)⇐⇒ ∀u : u > y y free x, u bound

Q4(v) ⇐⇒ ∃y : P (v, y) ⇐⇒ ∃w : P (v, w)⇐⇒ ∃w : v > w v free y, w bound

Discrete Mathematics I – p. 69/292

Page 246: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

Q5 ⇐⇒ ∃z : P (0, z)⇐⇒ ∃z : 0 > z ⇐⇒ F z bound

Q6 ⇐⇒ ∀y : ∃x : P (x, y)⇐⇒ ∀y : ∃x : x > y ⇐⇒ T x, y bound

Q7 ⇐⇒ P (3, 5) ⇐⇒ 3 > 5 ⇐⇒ F

Discrete Mathematics I – p. 70/292

Page 247: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

Q5 ⇐⇒ ∃z : P (0, z)⇐⇒ ∃z : 0 > z ⇐⇒ F z bound

Q6 ⇐⇒ ∀y : ∃x : P (x, y)⇐⇒ ∀y : ∃x : x > y ⇐⇒ T x, y bound

Q7 ⇐⇒ P (3, 5) ⇐⇒ 3 > 5 ⇐⇒ F

Discrete Mathematics I – p. 70/292

Page 248: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

Q5 ⇐⇒ ∃z : P (0, z)⇐⇒ ∃z : 0 > z ⇐⇒ F z bound

Q6 ⇐⇒ ∀y : ∃x : P (x, y)⇐⇒ ∀y : ∃x : x > y ⇐⇒ T x, y bound

Q7 ⇐⇒ P (3, 5) ⇐⇒ 3 > 5 ⇐⇒ F

Discrete Mathematics I – p. 70/292

Page 249: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

P (x, y) ⇐⇒ x > y x, y free

Q5 ⇐⇒ ∃z : P (0, z)⇐⇒ ∃z : 0 > z ⇐⇒ F z bound

Q6 ⇐⇒ ∀y : ∃x : P (x, y)⇐⇒ ∀y : ∃x : x > y ⇐⇒ T x, y bound

Q7 ⇐⇒ P (3, 5) ⇐⇒ 3 > 5 ⇐⇒ F

Discrete Mathematics I – p. 70/292

Page 250: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Suppose set S finite: S = {a1, . . . , an}

∀x ∈ S : P (x) ⇐⇒ P (a1) ∧ · · · ∧ P (an)

∃x ∈ S : P (x) ⇐⇒ P (a1) ∨ · · · ∨ P (an)

On a finite range, quantifiers can be expressed byBoolean operators

Not so on an infinite range

Discrete Mathematics I – p. 71/292

Page 251: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Suppose set S finite: S = {a1, . . . , an}∀x ∈ S : P (x) ⇐⇒ P (a1) ∧ · · · ∧ P (an)

∃x ∈ S : P (x) ⇐⇒ P (a1) ∨ · · · ∨ P (an)

On a finite range, quantifiers can be expressed byBoolean operators

Not so on an infinite range

Discrete Mathematics I – p. 71/292

Page 252: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Suppose set S finite: S = {a1, . . . , an}∀x ∈ S : P (x) ⇐⇒ P (a1) ∧ · · · ∧ P (an)

∃x ∈ S : P (x) ⇐⇒ P (a1) ∨ · · · ∨ P (an)

On a finite range, quantifiers can be expressed byBoolean operators

Not so on an infinite range

Discrete Mathematics I – p. 71/292

Page 253: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Suppose set S finite: S = {a1, . . . , an}∀x ∈ S : P (x) ⇐⇒ P (a1) ∧ · · · ∧ P (an)

∃x ∈ S : P (x) ⇐⇒ P (a1) ∨ · · · ∨ P (an)

On a finite range, quantifiers can be expressed byBoolean operators

Not so on an infinite range

Discrete Mathematics I – p. 71/292

Page 254: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Laws of predicate logic:

(∀x : T ) ⇐⇒ T (∀x : F ) ⇐⇒ F

(∃x : T ) ⇐⇒ T (∃x : F ) ⇐⇒ F

∀x : (P (x) ∧Q) ⇐⇒ (∀x : P (x)) ∧Q

(if Q does not contain free x)

Holds for ∀, ∃, and for each of ¬, ∧, ∨, ⇒, ⇔

Discrete Mathematics I – p. 72/292

Page 255: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Laws of predicate logic:

(∀x : T ) ⇐⇒ T (∀x : F ) ⇐⇒ F

(∃x : T ) ⇐⇒ T (∃x : F ) ⇐⇒ F

∀x : (P (x) ∧Q) ⇐⇒ (∀x : P (x)) ∧Q

(if Q does not contain free x)

Holds for ∀, ∃, and for each of ¬, ∧, ∨, ⇒, ⇔

Discrete Mathematics I – p. 72/292

Page 256: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Laws of predicate logic:

(∀x : T ) ⇐⇒ T (∀x : F ) ⇐⇒ F

(∃x : T ) ⇐⇒ T (∃x : F ) ⇐⇒ F

∀x : (P (x) ∧Q) ⇐⇒ (∀x : P (x)) ∧Q

(if Q does not contain free x)

Holds for ∀, ∃, and for each of ¬, ∧, ∨, ⇒, ⇔

Discrete Mathematics I – p. 72/292

Page 257: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Laws of predicate logic:

(∀x : T ) ⇐⇒ T (∀x : F ) ⇐⇒ F

(∃x : T ) ⇐⇒ T (∃x : F ) ⇐⇒ F

∀x : (P (x) ∧Q) ⇐⇒ (∀x : P (x)) ∧Q

(if Q does not contain free x)

Holds for ∀, ∃, and for each of ¬, ∧, ∨, ⇒, ⇔

Discrete Mathematics I – p. 72/292

Page 258: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Laws of predicate logic:

(∀x : T ) ⇐⇒ T (∀x : F ) ⇐⇒ F

(∃x : T ) ⇐⇒ T (∃x : F ) ⇐⇒ F

∀x : (P (x) ∧Q) ⇐⇒ (∀x : P (x)) ∧Q

(if Q does not contain free x)

Holds for ∀, ∃, and for each of ¬, ∧, ∨, ⇒, ⇔

Discrete Mathematics I – p. 72/292

Page 259: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Laws of predicate logic:

(∀x : T ) ⇐⇒ T (∀x : F ) ⇐⇒ F

(∃x : T ) ⇐⇒ T (∃x : F ) ⇐⇒ F

∀x : (P (x) ∧Q) ⇐⇒ (∀x : P (x)) ∧Q

(if Q does not contain free x)

Holds for ∀, ∃, and for each of ¬, ∧, ∨, ⇒, ⇔

Discrete Mathematics I – p. 72/292

Page 260: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

De Morgan’s laws for predicates:

¬∀x : P (x) ⇐⇒ ∃x : ¬P (x)

¬∃x : P (x) ⇐⇒ ∀x : ¬P (x)

Discrete Mathematics I – p. 73/292

Page 261: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifiers — handle with care!

∀x : (P (x) ∧Q(x)) ⇐⇒ (∀x : P (x)) ∧ (∀x : Q(x))

∃x : (P (x) ∨Q(x)) ⇐⇒ (∃x : P (x)) ∨ (∃x : Q(x))

But:

∀x : (P (x) ∨Q(x)) 6⇒ (∀x : P (x)) ∨ (∀x : Q(x))(“⇐” still holds)

∃x : (P (x) ∧Q(x)) 6⇐ (∃x : P (x)) ∧ (∃x : Q(x))(“⇒” still holds)

Discrete Mathematics I – p. 74/292

Page 262: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifiers — handle with care!

∀x : (P (x) ∧Q(x)) ⇐⇒ (∀x : P (x)) ∧ (∀x : Q(x))

∃x : (P (x) ∨Q(x)) ⇐⇒ (∃x : P (x)) ∨ (∃x : Q(x))

But:

∀x : (P (x) ∨Q(x)) 6⇒ (∀x : P (x)) ∨ (∀x : Q(x))

(“⇐” still holds)

∃x : (P (x) ∧Q(x)) 6⇐ (∃x : P (x)) ∧ (∃x : Q(x))(“⇒” still holds)

Discrete Mathematics I – p. 74/292

Page 263: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifiers — handle with care!

∀x : (P (x) ∧Q(x)) ⇐⇒ (∀x : P (x)) ∧ (∀x : Q(x))

∃x : (P (x) ∨Q(x)) ⇐⇒ (∃x : P (x)) ∨ (∃x : Q(x))

But:

∀x : (P (x) ∨Q(x)) 6⇒ (∀x : P (x)) ∨ (∀x : Q(x))(“⇐” still holds)

∃x : (P (x) ∧Q(x)) 6⇐ (∃x : P (x)) ∧ (∃x : Q(x))(“⇒” still holds)

Discrete Mathematics I – p. 74/292

Page 264: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifiers — handle with care!

∀x : (P (x) ∧Q(x)) ⇐⇒ (∀x : P (x)) ∧ (∀x : Q(x))

∃x : (P (x) ∨Q(x)) ⇐⇒ (∃x : P (x)) ∨ (∃x : Q(x))

But:

∀x : (P (x) ∨Q(x)) 6⇒ (∀x : P (x)) ∨ (∀x : Q(x))(“⇐” still holds)

∃x : (P (x) ∧Q(x)) 6⇐ (∃x : P (x)) ∧ (∃x : Q(x))

(“⇒” still holds)

Discrete Mathematics I – p. 74/292

Page 265: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Quantifiers — handle with care!

∀x : (P (x) ∧Q(x)) ⇐⇒ (∀x : P (x)) ∧ (∀x : Q(x))

∃x : (P (x) ∨Q(x)) ⇐⇒ (∃x : P (x)) ∨ (∃x : Q(x))

But:

∀x : (P (x) ∨Q(x)) 6⇒ (∀x : P (x)) ∨ (∀x : Q(x))(“⇐” still holds)

∃x : (P (x) ∧Q(x)) 6⇐ (∃x : P (x)) ∧ (∃x : Q(x))(“⇒” still holds)

Discrete Mathematics I – p. 74/292

Page 266: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using quantifiers — an example

P (x) true for at least one x in S: ∃x ∈ S : P (x)

P (x) true for exactly one x in S:

∃x ∈ S : (P (x) ∧ ∀y ∈ S : P (y) ⇒ (x = y)) ⇐⇒∃x ∈ S : (P (x)∧∀y ∈ S : (x 6= y) ⇒ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ∀y ∈ S : (x = y) ∨ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ¬∃y ∈ S : (x 6= y) ∧ P (y))

Notation: ∃!x ∈ S : P (x)

Exercise: P (x) true for all but one x in S

Discrete Mathematics I – p. 75/292

Page 267: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using quantifiers — an example

P (x) true for at least one x in S: ∃x ∈ S : P (x)

P (x) true for exactly one x in S:

∃x ∈ S : (P (x) ∧ ∀y ∈ S : P (y) ⇒ (x = y)) ⇐⇒∃x ∈ S : (P (x)∧∀y ∈ S : (x 6= y) ⇒ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ∀y ∈ S : (x = y) ∨ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ¬∃y ∈ S : (x 6= y) ∧ P (y))

Notation: ∃!x ∈ S : P (x)

Exercise: P (x) true for all but one x in S

Discrete Mathematics I – p. 75/292

Page 268: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using quantifiers — an example

P (x) true for at least one x in S: ∃x ∈ S : P (x)

P (x) true for exactly one x in S:

∃x ∈ S : (P (x) ∧

∀y ∈ S : P (y) ⇒ (x = y)) ⇐⇒∃x ∈ S : (P (x)∧∀y ∈ S : (x 6= y) ⇒ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ∀y ∈ S : (x = y) ∨ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ¬∃y ∈ S : (x 6= y) ∧ P (y))

Notation: ∃!x ∈ S : P (x)

Exercise: P (x) true for all but one x in S

Discrete Mathematics I – p. 75/292

Page 269: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using quantifiers — an example

P (x) true for at least one x in S: ∃x ∈ S : P (x)

P (x) true for exactly one x in S:

∃x ∈ S : (P (x) ∧ ∀y ∈ S : P (y) ⇒ (x = y))

⇐⇒∃x ∈ S : (P (x)∧∀y ∈ S : (x 6= y) ⇒ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ∀y ∈ S : (x = y) ∨ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ¬∃y ∈ S : (x 6= y) ∧ P (y))

Notation: ∃!x ∈ S : P (x)

Exercise: P (x) true for all but one x in S

Discrete Mathematics I – p. 75/292

Page 270: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using quantifiers — an example

P (x) true for at least one x in S: ∃x ∈ S : P (x)

P (x) true for exactly one x in S:

∃x ∈ S : (P (x) ∧ ∀y ∈ S : P (y) ⇒ (x = y)) ⇐⇒∃x ∈ S : (P (x)∧∀y ∈ S : (x 6= y) ⇒ ¬P (y))

⇐⇒∃x ∈ S : (P (x) ∧ ∀y ∈ S : (x = y) ∨ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ¬∃y ∈ S : (x 6= y) ∧ P (y))

Notation: ∃!x ∈ S : P (x)

Exercise: P (x) true for all but one x in S

Discrete Mathematics I – p. 75/292

Page 271: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using quantifiers — an example

P (x) true for at least one x in S: ∃x ∈ S : P (x)

P (x) true for exactly one x in S:

∃x ∈ S : (P (x) ∧ ∀y ∈ S : P (y) ⇒ (x = y)) ⇐⇒∃x ∈ S : (P (x)∧∀y ∈ S : (x 6= y) ⇒ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ∀y ∈ S : (x = y) ∨ ¬P (y))

⇐⇒∃x ∈ S : (P (x) ∧ ¬∃y ∈ S : (x 6= y) ∧ P (y))

Notation: ∃!x ∈ S : P (x)

Exercise: P (x) true for all but one x in S

Discrete Mathematics I – p. 75/292

Page 272: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using quantifiers — an example

P (x) true for at least one x in S: ∃x ∈ S : P (x)

P (x) true for exactly one x in S:

∃x ∈ S : (P (x) ∧ ∀y ∈ S : P (y) ⇒ (x = y)) ⇐⇒∃x ∈ S : (P (x)∧∀y ∈ S : (x 6= y) ⇒ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ∀y ∈ S : (x = y) ∨ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ¬∃y ∈ S : (x 6= y) ∧ P (y))

Notation: ∃!x ∈ S : P (x)

Exercise: P (x) true for all but one x in S

Discrete Mathematics I – p. 75/292

Page 273: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using quantifiers — an example

P (x) true for at least one x in S: ∃x ∈ S : P (x)

P (x) true for exactly one x in S:

∃x ∈ S : (P (x) ∧ ∀y ∈ S : P (y) ⇒ (x = y)) ⇐⇒∃x ∈ S : (P (x)∧∀y ∈ S : (x 6= y) ⇒ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ∀y ∈ S : (x = y) ∨ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ¬∃y ∈ S : (x 6= y) ∧ P (y))

Notation: ∃!x ∈ S : P (x)

Exercise: P (x) true for all but one x in S

Discrete Mathematics I – p. 75/292

Page 274: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Logic

Using quantifiers — an example

P (x) true for at least one x in S: ∃x ∈ S : P (x)

P (x) true for exactly one x in S:

∃x ∈ S : (P (x) ∧ ∀y ∈ S : P (y) ⇒ (x = y)) ⇐⇒∃x ∈ S : (P (x)∧∀y ∈ S : (x 6= y) ⇒ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ∀y ∈ S : (x = y) ∨ ¬P (y)) ⇐⇒∃x ∈ S : (P (x) ∧ ¬∃y ∈ S : (x 6= y) ∧ P (y))

Notation: ∃!x ∈ S : P (x)

Exercise: P (x) true for all but one x in S

Discrete Mathematics I – p. 75/292

Page 275: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Discrete Mathematics I – p. 76/292

Page 276: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsSet: a basic (undefined) concept

By a set we shall understand any collectioninto a whole M of definite, distinct objects ofour intuition or of our thought. These objectsare called the elements of M .

G. Cantor (1845–1918)

Discrete Mathematics I – p. 77/292

Page 277: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsSet: a basic (undefined) concept

By a set we shall understand any collectioninto a whole M of definite, distinct objects ofour intuition or of our thought. These objectsare called the elements of M .

G. Cantor (1845–1918)

Discrete Mathematics I – p. 77/292

Page 278: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnything can be an element of a set

Planets = {Mercury, Venus, . . . , Pluto}Neven = {0, 2, 4, 6, 8, 10, . . .}Junk = {239, banana, ace of spades}A set can be an element of another set

SuperJunk = {239, Junk , ∅} ={239, {banana, ace of spades, 239}, ∅}

Discrete Mathematics I – p. 78/292

Page 279: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnything can be an element of a set

Planets = {Mercury, Venus, . . . , Pluto}

Neven = {0, 2, 4, 6, 8, 10, . . .}Junk = {239, banana, ace of spades}A set can be an element of another set

SuperJunk = {239, Junk , ∅} ={239, {banana, ace of spades, 239}, ∅}

Discrete Mathematics I – p. 78/292

Page 280: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnything can be an element of a set

Planets = {Mercury, Venus, . . . , Pluto}Neven = {0, 2, 4, 6, 8, 10, . . .}

Junk = {239, banana, ace of spades}A set can be an element of another set

SuperJunk = {239, Junk , ∅} ={239, {banana, ace of spades, 239}, ∅}

Discrete Mathematics I – p. 78/292

Page 281: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnything can be an element of a set

Planets = {Mercury, Venus, . . . , Pluto}Neven = {0, 2, 4, 6, 8, 10, . . .}Junk = {239, banana, ace of spades}

A set can be an element of another set

SuperJunk = {239, Junk , ∅} ={239, {banana, ace of spades, 239}, ∅}

Discrete Mathematics I – p. 78/292

Page 282: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnything can be an element of a set

Planets = {Mercury, Venus, . . . , Pluto}Neven = {0, 2, 4, 6, 8, 10, . . .}Junk = {239, banana, ace of spades}A set can be an element of another set

SuperJunk = {239, Junk , ∅} ={239, {banana, ace of spades, 239}, ∅}

Discrete Mathematics I – p. 78/292

Page 283: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnything can be an element of a set

Planets = {Mercury, Venus, . . . , Pluto}Neven = {0, 2, 4, 6, 8, 10, . . .}Junk = {239, banana, ace of spades}A set can be an element of another set

SuperJunk = {239, Junk , ∅} ={239, {banana, ace of spades, 239}, ∅}

Discrete Mathematics I – p. 78/292

Page 284: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsOrder of elements does not matter

Junk = {banana, ace of spades, 239}

Repetition of elements does not matter

Junk ={banana, banana, ace of spades, 239, 239, 239}

Discrete Mathematics I – p. 79/292

Page 285: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsOrder of elements does not matter

Junk = {banana, ace of spades, 239}Repetition of elements does not matter

Junk ={banana, banana, ace of spades, 239, 239, 239}

Discrete Mathematics I – p. 79/292

Page 286: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe empty set: ∅ = {}

A singleton: any one-element set

MorningStars = {Venus}NonpositiveNaturals = {0}EmptySets = {∅} 6= ∅

Discrete Mathematics I – p. 80/292

Page 287: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe empty set: ∅ = {}A singleton: any one-element set

MorningStars = {Venus}NonpositiveNaturals = {0}EmptySets = {∅} 6= ∅

Discrete Mathematics I – p. 80/292

Page 288: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe empty set: ∅ = {}A singleton: any one-element set

MorningStars = {Venus}

NonpositiveNaturals = {0}EmptySets = {∅} 6= ∅

Discrete Mathematics I – p. 80/292

Page 289: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe empty set: ∅ = {}A singleton: any one-element set

MorningStars = {Venus}NonpositiveNaturals = {0}

EmptySets = {∅} 6= ∅

Discrete Mathematics I – p. 80/292

Page 290: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe empty set: ∅ = {}A singleton: any one-element set

MorningStars = {Venus}NonpositiveNaturals = {0}EmptySets = {∅} 6= ∅

Discrete Mathematics I – p. 80/292

Page 291: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsElement x is in set A: x ∈ A

Jupiter ∈ Planets , orange 6∈ Junk

Set A is a subset of set B, if all elements of A are alsoelements of B (but not necessarily the other wayround)

A ⊆ B ⇐⇒ ∀x : x ∈ A ⇒ x ∈ B

Discrete Mathematics I – p. 81/292

Page 292: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsElement x is in set A: x ∈ A

Jupiter ∈ Planets , orange 6∈ Junk

Set A is a subset of set B, if all elements of A are alsoelements of B (but not necessarily the other wayround)

A ⊆ B ⇐⇒ ∀x : x ∈ A ⇒ x ∈ B

Discrete Mathematics I – p. 81/292

Page 293: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsElement x is in set A: x ∈ A

Jupiter ∈ Planets , orange 6∈ Junk

Set A is a subset of set B, if all elements of A are alsoelements of B (but not necessarily the other wayround)

A ⊆ B ⇐⇒ ∀x : x ∈ A ⇒ x ∈ B

Discrete Mathematics I – p. 81/292

Page 294: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsElement x is in set A: x ∈ A

Jupiter ∈ Planets , orange 6∈ Junk

Set A is a subset of set B, if all elements of A are alsoelements of B (but not necessarily the other wayround)

A ⊆ B ⇐⇒ ∀x : x ∈ A ⇒ x ∈ B

Discrete Mathematics I – p. 81/292

Page 295: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIn particular, for any set A: A ⊆ A ∅ ⊆ A

∅ ⊆ ∅Neven ⊆ N

∅ ⊆ {banana} ⊆ {banana, 239} ⊆ Junk

Discrete Mathematics I – p. 82/292

Page 296: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIn particular, for any set A: A ⊆ A ∅ ⊆ A

∅ ⊆ ∅

Neven ⊆ N

∅ ⊆ {banana} ⊆ {banana, 239} ⊆ Junk

Discrete Mathematics I – p. 82/292

Page 297: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIn particular, for any set A: A ⊆ A ∅ ⊆ A

∅ ⊆ ∅Neven ⊆ N

∅ ⊆ {banana} ⊆ {banana, 239} ⊆ Junk

Discrete Mathematics I – p. 82/292

Page 298: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIn particular, for any set A: A ⊆ A ∅ ⊆ A

∅ ⊆ ∅Neven ⊆ N

∅ ⊆ {banana} ⊆ {banana, 239} ⊆ Junk

Discrete Mathematics I – p. 82/292

Page 299: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsWhat are the axioms of set theory?

The Law of Extensionality:

Two sets with all the same elements are equal

For any sets A, B: (A ⊆ B) ∧ (B ⊆ A) ⇒ A = B

In particular, there is only one empty set

Discrete Mathematics I – p. 83/292

Page 300: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsWhat are the axioms of set theory?

The Law of Extensionality:

Two sets with all the same elements are equal

For any sets A, B: (A ⊆ B) ∧ (B ⊆ A) ⇒ A = B

In particular, there is only one empty set

Discrete Mathematics I – p. 83/292

Page 301: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsWhat are the axioms of set theory?

The Law of Extensionality:

Two sets with all the same elements are equal

For any sets A, B: (A ⊆ B) ∧ (B ⊆ A) ⇒ A = B

In particular, there is only one empty set

Discrete Mathematics I – p. 83/292

Page 302: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsWhat are the axioms of set theory?

The Law of Extensionality:

Two sets with all the same elements are equal

For any sets A, B: (A ⊆ B) ∧ (B ⊆ A) ⇒ A = B

In particular, there is only one empty set

Discrete Mathematics I – p. 83/292

Page 303: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet P (x) be a predicate

{x | P (x)}: the set of all x, such that P (x) is true

Range often made explicit: {x ∈ S | P (x)}In particular: {x ∈ S | T} = S {x ∈ S | F} = ∅

Discrete Mathematics I – p. 84/292

Page 304: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet P (x) be a predicate

{x | P (x)}: the set of all x, such that P (x) is true

Range often made explicit: {x ∈ S | P (x)}In particular: {x ∈ S | T} = S {x ∈ S | F} = ∅

Discrete Mathematics I – p. 84/292

Page 305: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet P (x) be a predicate

{x | P (x)}: the set of all x, such that P (x) is true

Range often made explicit: {x ∈ S | P (x)}

In particular: {x ∈ S | T} = S {x ∈ S | F} = ∅

Discrete Mathematics I – p. 84/292

Page 306: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet P (x) be a predicate

{x | P (x)}: the set of all x, such that P (x) is true

Range often made explicit: {x ∈ S | P (x)}In particular: {x ∈ S | T} =

S {x ∈ S | F} = ∅

Discrete Mathematics I – p. 84/292

Page 307: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet P (x) be a predicate

{x | P (x)}: the set of all x, such that P (x) is true

Range often made explicit: {x ∈ S | P (x)}In particular: {x ∈ S | T} = S

{x ∈ S | F} = ∅

Discrete Mathematics I – p. 84/292

Page 308: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet P (x) be a predicate

{x | P (x)}: the set of all x, such that P (x) is true

Range often made explicit: {x ∈ S | P (x)}In particular: {x ∈ S | T} = S {x ∈ S | F} =

Discrete Mathematics I – p. 84/292

Page 309: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet P (x) be a predicate

{x | P (x)}: the set of all x, such that P (x) is true

Range often made explicit: {x ∈ S | P (x)}In particular: {x ∈ S | T} = S {x ∈ S | F} = ∅

Discrete Mathematics I – p. 84/292

Page 310: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

{x ∈ N | x > 0} = {1, 2, 3, 4, 5, 6, . . .}

{x ∈ Planets | x is red} = {Mars}{x ∈ N | x ≥ 0} = N

{x ∈ Planets | x is a banana} = ∅

Discrete Mathematics I – p. 85/292

Page 311: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

{x ∈ N | x > 0} = {1, 2, 3, 4, 5, 6, . . .}{x ∈ Planets | x is red} = {Mars}

{x ∈ N | x ≥ 0} = N

{x ∈ Planets | x is a banana} = ∅

Discrete Mathematics I – p. 85/292

Page 312: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

{x ∈ N | x > 0} = {1, 2, 3, 4, 5, 6, . . .}{x ∈ Planets | x is red} = {Mars}{x ∈ N | x ≥ 0} = N

{x ∈ Planets | x is a banana} = ∅

Discrete Mathematics I – p. 85/292

Page 313: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

{x ∈ N | x > 0} = {1, 2, 3, 4, 5, 6, . . .}{x ∈ Planets | x is red} = {Mars}{x ∈ N | x ≥ 0} = N

{x ∈ Planets | x is a banana} = ∅

Discrete Mathematics I – p. 85/292

Page 314: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnother axiom of set theory

The Law of Abstraction:

For any predicate P (x), there is a set {x | P (x)}

Discrete Mathematics I – p. 86/292

Page 315: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnother axiom of set theory

The Law of Abstraction:

For any predicate P (x), there is a set {x | P (x)}

Discrete Mathematics I – p. 86/292

Page 316: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnother axiom of set theory

The Law of Abstraction:

For any predicate P (x), there is a set {x | P (x)}Extensionality + Abstraction = Set Theory

Discrete Mathematics I – p. 86/292

Page 317: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsAnother axiom of set theory

The Law of Abstraction:

For any predicate P (x), there is a set {x | P (x)}Extensionality + Abstraction = CONTRADICTION

Discrete Mathematics I – p. 86/292

Page 318: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox

A barber shaves everyone who does not shavehimself. Who shaves the barber?

Let P (x) = x 6∈ x

Let B = {x | P (x)} = {x | x 6∈ x}B ∈ B — true or false?

B ∈ B =⇒ B 6∈ B B 6∈ B =⇒ B ∈ B

Contradiction!

Discrete Mathematics I – p. 87/292

Page 319: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox

A barber shaves everyone who does not shavehimself. Who shaves the barber?

Let P (x) = x 6∈ x

Let B = {x | P (x)} = {x | x 6∈ x}B ∈ B — true or false?

B ∈ B =⇒ B 6∈ B B 6∈ B =⇒ B ∈ B

Contradiction!

Discrete Mathematics I – p. 87/292

Page 320: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox

A barber shaves everyone who does not shavehimself. Who shaves the barber?

Let P (x) = x 6∈ x

Let B = {x | P (x)} = {x | x 6∈ x}B ∈ B — true or false?

B ∈ B =⇒ B 6∈ B B 6∈ B =⇒ B ∈ B

Contradiction!

Discrete Mathematics I – p. 87/292

Page 321: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox

A barber shaves everyone who does not shavehimself. Who shaves the barber?

Let P (x) = x 6∈ x

Let B = {x | P (x)} = {x | x 6∈ x}

B ∈ B — true or false?

B ∈ B =⇒ B 6∈ B B 6∈ B =⇒ B ∈ B

Contradiction!

Discrete Mathematics I – p. 87/292

Page 322: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox

A barber shaves everyone who does not shavehimself. Who shaves the barber?

Let P (x) = x 6∈ x

Let B = {x | P (x)} = {x | x 6∈ x}B ∈ B — true or false?

B ∈ B =⇒ B 6∈ B B 6∈ B =⇒ B ∈ B

Contradiction!

Discrete Mathematics I – p. 87/292

Page 323: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox

A barber shaves everyone who does not shavehimself. Who shaves the barber?

Let P (x) = x 6∈ x

Let B = {x | P (x)} = {x | x 6∈ x}B ∈ B — true or false?

B ∈ B =⇒ B 6∈ B

B 6∈ B =⇒ B ∈ B

Contradiction!

Discrete Mathematics I – p. 87/292

Page 324: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox

A barber shaves everyone who does not shavehimself. Who shaves the barber?

Let P (x) = x 6∈ x

Let B = {x | P (x)} = {x | x 6∈ x}B ∈ B — true or false?

B ∈ B =⇒ B 6∈ B B 6∈ B =⇒ B ∈ B

Contradiction!

Discrete Mathematics I – p. 87/292

Page 325: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox

A barber shaves everyone who does not shavehimself. Who shaves the barber?

Let P (x) = x 6∈ x

Let B = {x | P (x)} = {x | x 6∈ x}B ∈ B — true or false?

B ∈ B =⇒ B 6∈ B B 6∈ B =⇒ B ∈ B

Contradiction!

Discrete Mathematics I – p. 87/292

Page 326: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox can only be explained byinconsistency of axioms

Set theory can be fixed — no details here

Extensionality + Abstraction =Naive set theory

Discrete Mathematics I – p. 88/292

Page 327: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox can only be explained byinconsistency of axioms

Set theory can be fixed — no details here

Extensionality + Abstraction =Naive set theory

Discrete Mathematics I – p. 88/292

Page 328: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox can only be explained byinconsistency of axioms

Set theory can be fixed — no details here

Extensionality + Abstraction =

Naive set theory

Discrete Mathematics I – p. 88/292

Page 329: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsRussell’s paradox can only be explained byinconsistency of axioms

Set theory can be fixed — no details here

Extensionality + Abstraction = Naive set theory

Discrete Mathematics I – p. 88/292

Page 330: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsOperations on sets:

Intersection: A ∩B = {x | (x ∈ A) ∧ (x ∈ B)}Union: A ∪B = {x | (x ∈ A) ∨ (x ∈ B)}Venn diagrams (illustration only!):

A B A ∩B A ∪B

Sets A, B are called disjoint, if A ∩B = ∅

Discrete Mathematics I – p. 89/292

Page 331: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsOperations on sets:

Intersection: A ∩B = {x | (x ∈ A) ∧ (x ∈ B)}

Union: A ∪B = {x | (x ∈ A) ∨ (x ∈ B)}Venn diagrams (illustration only!):

A B A ∩B A ∪B

Sets A, B are called disjoint, if A ∩B = ∅

Discrete Mathematics I – p. 89/292

Page 332: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsOperations on sets:

Intersection: A ∩B = {x | (x ∈ A) ∧ (x ∈ B)}Union: A ∪B = {x | (x ∈ A) ∨ (x ∈ B)}

Venn diagrams (illustration only!):

A B A ∩B A ∪B

Sets A, B are called disjoint, if A ∩B = ∅

Discrete Mathematics I – p. 89/292

Page 333: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsOperations on sets:

Intersection: A ∩B = {x | (x ∈ A) ∧ (x ∈ B)}Union: A ∪B = {x | (x ∈ A) ∨ (x ∈ B)}Venn diagrams (illustration only!):

A B

A ∩B A ∪B

Sets A, B are called disjoint, if A ∩B = ∅

Discrete Mathematics I – p. 89/292

Page 334: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsOperations on sets:

Intersection: A ∩B = {x | (x ∈ A) ∧ (x ∈ B)}Union: A ∪B = {x | (x ∈ A) ∨ (x ∈ B)}Venn diagrams (illustration only!):

A B A ∩B

A ∪B

Sets A, B are called disjoint, if A ∩B = ∅

Discrete Mathematics I – p. 89/292

Page 335: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsOperations on sets:

Intersection: A ∩B = {x | (x ∈ A) ∧ (x ∈ B)}Union: A ∪B = {x | (x ∈ A) ∨ (x ∈ B)}Venn diagrams (illustration only!):

A B A ∩B A ∪B

Sets A, B are called disjoint, if A ∩B = ∅

Discrete Mathematics I – p. 89/292

Page 336: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsOperations on sets:

Intersection: A ∩B = {x | (x ∈ A) ∧ (x ∈ B)}Union: A ∪B = {x | (x ∈ A) ∨ (x ∈ B)}Venn diagrams (illustration only!):

A B A ∩B A ∪B

Sets A, B are called disjoint, if A ∩B = ∅

Discrete Mathematics I – p. 89/292

Page 337: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore operations on sets:

Difference: A \B = {x | (x ∈ A) ∧ (x 6∈ B)}

A B A \B B \ A

If A, B disjoint, then A \B = A, B \ A = B

Discrete Mathematics I – p. 90/292

Page 338: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore operations on sets:

Difference: A \B = {x | (x ∈ A) ∧ (x 6∈ B)}

A B

A \B B \ A

If A, B disjoint, then A \B = A, B \ A = B

Discrete Mathematics I – p. 90/292

Page 339: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore operations on sets:

Difference: A \B = {x | (x ∈ A) ∧ (x 6∈ B)}

A B A \B

B \ A

If A, B disjoint, then A \B = A, B \ A = B

Discrete Mathematics I – p. 90/292

Page 340: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore operations on sets:

Difference: A \B = {x | (x ∈ A) ∧ (x 6∈ B)}

A B A \B B \ A

If A, B disjoint, then A \B = A, B \ A = B

Discrete Mathematics I – p. 90/292

Page 341: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore operations on sets:

Difference: A \B = {x | (x ∈ A) ∧ (x 6∈ B)}

A B A \B B \ A

If A, B disjoint, then A \B = A, B \ A = B

Discrete Mathematics I – p. 90/292

Page 342: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet S be a fixed (universal) set, A ⊆ S

Complement of A (with respect to S): A = S \ A

S

A

A

Discrete Mathematics I – p. 91/292

Page 343: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet S be a fixed (universal) set, A ⊆ S

Complement of A (with respect to S): A = S \ A

S

A

A

Discrete Mathematics I – p. 91/292

Page 344: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet S be a fixed (universal) set, A ⊆ S

Complement of A (with respect to S): A = S \ A

S

A

A

Discrete Mathematics I – p. 91/292

Page 345: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}

A ∪B = {a, b, c, f, g} A ∩B = {a, c}A \B = {b} B \ A = {f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 346: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B =

{a, b, c, f, g} A ∩B = {a, c}A \B = {b} B \ A = {f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 347: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B = {a, b, c, f, g}

A ∩B = {a, c}A \B = {b} B \ A = {f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 348: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B = {a, b, c, f, g} A ∩B =

{a, c}A \B = {b} B \ A = {f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 349: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B = {a, b, c, f, g} A ∩B = {a, c}

A \B = {b} B \ A = {f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 350: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B = {a, b, c, f, g} A ∩B = {a, c}A \B =

{b} B \ A = {f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 351: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B = {a, b, c, f, g} A ∩B = {a, c}A \B = {b}

B \ A = {f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 352: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B = {a, b, c, f, g} A ∩B = {a, c}A \B = {b} B \ A =

{f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 353: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B = {a, b, c, f, g} A ∩B = {a, c}A \B = {b} B \ A = {f, g}

Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 354: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B = {a, b, c, f, g} A ∩B = {a, c}A \B = {b} B \ A = {f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 355: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

A = {a, b, c}, B = {c, a, f, g}A ∪B = {a, b, c, f, g} A ∩B = {a, c}A \B = {b} B \ A = {f, g}Note: A ∪B = (A ∩B) ∪ (A \B) ∪ (B \ A)

Also: (A ∪B) \ (A ∩B) = (A \B) ∪ (B \ A)

Discrete Mathematics I – p. 92/292

Page 356: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLaws of set operations (hold for any A, B, C):

¯A = A double complement

A ∩ A = A ∩ idempotentA ∪ A = A ∪ idempotent

A ∩B = B ∩ A ∩ commutativeA ∪B = B ∪ A ∪ commutative

Discrete Mathematics I – p. 93/292

Page 357: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLaws of set operations (hold for any A, B, C):

¯A = A double complement

A ∩ A = A ∩ idempotentA ∪ A = A ∪ idempotent

A ∩B = B ∩ A ∩ commutativeA ∪B = B ∪ A ∪ commutative

Discrete Mathematics I – p. 93/292

Page 358: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLaws of set operations (hold for any A, B, C):

¯A = A double complement

A ∩ A = A ∩ idempotentA ∪ A = A ∪ idempotent

A ∩B = B ∩ A ∩ commutativeA ∪B = B ∪ A ∪ commutative

Discrete Mathematics I – p. 93/292

Page 359: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore laws of set operations:

(A ∩B) ∩ C = A ∩ (B ∩ C) ∩ associative(A ∪B) ∪ C = A ∪ (B ∪ C) ∪ associative

A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)∩ distributes over ∪

A ∪ (B ∩ C) = (A ∪B) ∩ (A ∪ C)∪ distributes over ∩

Compare with arithmetic and Boolean logic

Discrete Mathematics I – p. 94/292

Page 360: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore laws of set operations:

(A ∩B) ∩ C = A ∩ (B ∩ C) ∩ associative(A ∪B) ∪ C = A ∪ (B ∪ C) ∪ associative

A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)∩ distributes over ∪

A ∪ (B ∩ C) = (A ∪B) ∩ (A ∪ C)∪ distributes over ∩

Compare with arithmetic and Boolean logic

Discrete Mathematics I – p. 94/292

Page 361: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore laws of set operations:

(A ∩B) ∩ C = A ∩ (B ∩ C) ∩ associative(A ∪B) ∪ C = A ∪ (B ∪ C) ∪ associative

A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)∩ distributes over ∪

A ∪ (B ∩ C) = (A ∪B) ∩ (A ∪ C)∪ distributes over ∩

Compare with arithmetic and Boolean logic

Discrete Mathematics I – p. 94/292

Page 362: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore laws of set operations:

(A ∩B) ∩ C = A ∩ (B ∩ C) ∩ associative(A ∪B) ∪ C = A ∪ (B ∪ C) ∪ associative

A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)∩ distributes over ∪

A ∪ (B ∩ C) = (A ∪B) ∩ (A ∪ C)∪ distributes over ∩

Compare with arithmetic and Boolean logic

Discrete Mathematics I – p. 94/292

Page 363: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

A B

C B ∪ C A ∩ (B ∪ C)

A ∩B A ∩ C (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 95/292

Page 364: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

A B

C

B ∪ C A ∩ (B ∪ C)

A ∩B A ∩ C (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 95/292

Page 365: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

A B

C B ∪ C

A ∩ (B ∪ C)

A ∩B A ∩ C (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 95/292

Page 366: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

A B

C B ∪ C A ∩ (B ∪ C)

A ∩B A ∩ C (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 95/292

Page 367: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

A B

C B ∪ C A ∩ (B ∪ C)

A ∩B

A ∩ C (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 95/292

Page 368: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

A B

C B ∪ C A ∩ (B ∪ C)

A ∩B A ∩ C

(A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 95/292

Page 369: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

A B

C B ∪ C A ∩ (B ∪ C)

A ∩B A ∩ C (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 95/292

Page 370: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Proof. Consider any x.

x ∈ A∩(B∪C) ⇐⇒ (x ∈ A)∧(x ∈ (B∪C)) ⇐⇒(x ∈ A) ∧ (x ∈ B ∨ x ∈ C) ⇐⇒(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C) ⇐⇒(x ∈ A∩B)∨(x ∈ A∩C) ⇐⇒ x ∈ (A∩B)∪(A∩C)

Hence A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 96/292

Page 371: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Proof. Consider any x.

x ∈ A∩(B∪C) ⇐⇒ (x ∈ A)∧(x ∈ (B∪C)) ⇐⇒(x ∈ A) ∧ (x ∈ B ∨ x ∈ C) ⇐⇒(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C) ⇐⇒(x ∈ A∩B)∨(x ∈ A∩C) ⇐⇒ x ∈ (A∩B)∪(A∩C)

Hence A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 96/292

Page 372: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Proof. Consider any x.

x ∈ A∩(B∪C) ⇐⇒

(x ∈ A)∧(x ∈ (B∪C)) ⇐⇒(x ∈ A) ∧ (x ∈ B ∨ x ∈ C) ⇐⇒(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C) ⇐⇒(x ∈ A∩B)∨(x ∈ A∩C) ⇐⇒ x ∈ (A∩B)∪(A∩C)

Hence A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 96/292

Page 373: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Proof. Consider any x.

x ∈ A∩(B∪C) ⇐⇒ (x ∈ A)∧(x ∈ (B∪C)) ⇐⇒

(x ∈ A) ∧ (x ∈ B ∨ x ∈ C) ⇐⇒(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C) ⇐⇒(x ∈ A∩B)∨(x ∈ A∩C) ⇐⇒ x ∈ (A∩B)∪(A∩C)

Hence A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 96/292

Page 374: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Proof. Consider any x.

x ∈ A∩(B∪C) ⇐⇒ (x ∈ A)∧(x ∈ (B∪C)) ⇐⇒(x ∈ A) ∧ (x ∈ B ∨ x ∈ C) ⇐⇒

(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C) ⇐⇒(x ∈ A∩B)∨(x ∈ A∩C) ⇐⇒ x ∈ (A∩B)∪(A∩C)

Hence A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 96/292

Page 375: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Proof. Consider any x.

x ∈ A∩(B∪C) ⇐⇒ (x ∈ A)∧(x ∈ (B∪C)) ⇐⇒(x ∈ A) ∧ (x ∈ B ∨ x ∈ C) ⇐⇒(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C) ⇐⇒

(x ∈ A∩B)∨(x ∈ A∩C) ⇐⇒ x ∈ (A∩B)∪(A∩C)

Hence A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 96/292

Page 376: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Proof. Consider any x.

x ∈ A∩(B∪C) ⇐⇒ (x ∈ A)∧(x ∈ (B∪C)) ⇐⇒(x ∈ A) ∧ (x ∈ B ∨ x ∈ C) ⇐⇒(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C) ⇐⇒(x ∈ A∩B)∨(x ∈ A∩C) ⇐⇒

x ∈ (A∩B)∪(A∩C)

Hence A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 96/292

Page 377: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Proof. Consider any x.

x ∈ A∩(B∪C) ⇐⇒ (x ∈ A)∧(x ∈ (B∪C)) ⇐⇒(x ∈ A) ∧ (x ∈ B ∨ x ∈ C) ⇐⇒(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C) ⇐⇒(x ∈ A∩B)∨(x ∈ A∩C) ⇐⇒ x ∈ (A∩B)∪(A∩C)

Hence A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 96/292

Page 378: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Proof. Consider any x.

x ∈ A∩(B∪C) ⇐⇒ (x ∈ A)∧(x ∈ (B∪C)) ⇐⇒(x ∈ A) ∧ (x ∈ B ∨ x ∈ C) ⇐⇒(x ∈ A ∧ x ∈ B) ∨ (x ∈ A ∧ x ∈ C) ⇐⇒(x ∈ A∩B)∨(x ∈ A∩C) ⇐⇒ x ∈ (A∩B)∪(A∩C)

Hence A ∩ (B ∪ C) = (A ∩B) ∪ (A ∩ C)

Discrete Mathematics I – p. 96/292

Page 379: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsDe Morgan’s laws:

A ∩B = A ∪ B A ∪B = A ∩ B

Thus, A ∩B = A ∪ B,so ∩ can be expressed via , ∪Alternatively, A ∪B = A ∩ B,so ∪ can be expressed via , ∩(Cannot remove both ∩, ∪ at the same time!)

Discrete Mathematics I – p. 97/292

Page 380: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsDe Morgan’s laws:

A ∩B = A ∪ B A ∪B = A ∩ B

Thus, A ∩B = A ∪ B,so ∩ can be expressed via , ∪

Alternatively, A ∪B = A ∩ B,so ∪ can be expressed via , ∩(Cannot remove both ∩, ∪ at the same time!)

Discrete Mathematics I – p. 97/292

Page 381: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsDe Morgan’s laws:

A ∩B = A ∪ B A ∪B = A ∩ B

Thus, A ∩B = A ∪ B,so ∩ can be expressed via , ∪Alternatively, A ∪B = A ∩ B,so ∪ can be expressed via , ∩

(Cannot remove both ∩, ∪ at the same time!)

Discrete Mathematics I – p. 97/292

Page 382: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsDe Morgan’s laws:

A ∩B = A ∪ B A ∪B = A ∩ B

Thus, A ∩B = A ∪ B,so ∩ can be expressed via , ∪Alternatively, A ∪B = A ∩ B,so ∪ can be expressed via , ∩(Cannot remove both ∩, ∪ at the same time!)

Discrete Mathematics I – p. 97/292

Page 383: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

A ∩B = A ∪ B

S

A B

A ∩B A ∩B

A B A ∪ B

Discrete Mathematics I – p. 98/292

Page 384: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

A ∩B = A ∪ B

S

A B

A ∩B A ∩B

A B A ∪ B

Discrete Mathematics I – p. 98/292

Page 385: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

A ∩B = A ∪ B

S

A B

A ∩B

A ∩B

A B A ∪ B

Discrete Mathematics I – p. 98/292

Page 386: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

A ∩B = A ∪ B

S

A B

A ∩B A ∩B

A B A ∪ B

Discrete Mathematics I – p. 98/292

Page 387: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

A ∩B = A ∪ B

S

A B

A ∩B A ∩B

A

B A ∪ B

Discrete Mathematics I – p. 98/292

Page 388: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

A ∩B = A ∪ B

S

A B

A ∩B A ∩B

A B

A ∪ B

Discrete Mathematics I – p. 98/292

Page 389: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

A ∩B = A ∪ B

S

A B

A ∩B A ∩B

A B A ∪ B

Discrete Mathematics I – p. 98/292

Page 390: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Prove A ∩B = A ∪ B

Proof. Consider any x ∈ S.

x ∈ A ∩B ⇐⇒ x 6∈ A ∩B ⇐⇒¬(x ∈ A ∧ x ∈ B) ⇐⇒ (x 6∈ A) ∨ (x 6∈ B) ⇐⇒(x ∈ A) ∨ (x ∈ B) ⇐⇒ x ∈ (A ∪ B)

Hence A ∩B = A ∪ B

Discrete Mathematics I – p. 99/292

Page 391: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Prove A ∩B = A ∪ B

Proof. Consider any x ∈ S.

x ∈ A ∩B ⇐⇒ x 6∈ A ∩B ⇐⇒¬(x ∈ A ∧ x ∈ B) ⇐⇒ (x 6∈ A) ∨ (x 6∈ B) ⇐⇒(x ∈ A) ∨ (x ∈ B) ⇐⇒ x ∈ (A ∪ B)

Hence A ∩B = A ∪ B

Discrete Mathematics I – p. 99/292

Page 392: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Prove A ∩B = A ∪ B

Proof. Consider any x ∈ S.

x ∈ A ∩B ⇐⇒

x 6∈ A ∩B ⇐⇒¬(x ∈ A ∧ x ∈ B) ⇐⇒ (x 6∈ A) ∨ (x 6∈ B) ⇐⇒(x ∈ A) ∨ (x ∈ B) ⇐⇒ x ∈ (A ∪ B)

Hence A ∩B = A ∪ B

Discrete Mathematics I – p. 99/292

Page 393: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Prove A ∩B = A ∪ B

Proof. Consider any x ∈ S.

x ∈ A ∩B ⇐⇒ x 6∈ A ∩B ⇐⇒

¬(x ∈ A ∧ x ∈ B) ⇐⇒ (x 6∈ A) ∨ (x 6∈ B) ⇐⇒(x ∈ A) ∨ (x ∈ B) ⇐⇒ x ∈ (A ∪ B)

Hence A ∩B = A ∪ B

Discrete Mathematics I – p. 99/292

Page 394: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Prove A ∩B = A ∪ B

Proof. Consider any x ∈ S.

x ∈ A ∩B ⇐⇒ x 6∈ A ∩B ⇐⇒¬(x ∈ A ∧ x ∈ B) ⇐⇒

(x 6∈ A) ∨ (x 6∈ B) ⇐⇒(x ∈ A) ∨ (x ∈ B) ⇐⇒ x ∈ (A ∪ B)

Hence A ∩B = A ∪ B

Discrete Mathematics I – p. 99/292

Page 395: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Prove A ∩B = A ∪ B

Proof. Consider any x ∈ S.

x ∈ A ∩B ⇐⇒ x 6∈ A ∩B ⇐⇒¬(x ∈ A ∧ x ∈ B) ⇐⇒ (x 6∈ A) ∨ (x 6∈ B) ⇐⇒

(x ∈ A) ∨ (x ∈ B) ⇐⇒ x ∈ (A ∪ B)

Hence A ∩B = A ∪ B

Discrete Mathematics I – p. 99/292

Page 396: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Prove A ∩B = A ∪ B

Proof. Consider any x ∈ S.

x ∈ A ∩B ⇐⇒ x 6∈ A ∩B ⇐⇒¬(x ∈ A ∧ x ∈ B) ⇐⇒ (x 6∈ A) ∨ (x 6∈ B) ⇐⇒(x ∈ A) ∨ (x ∈ B) ⇐⇒

x ∈ (A ∪ B)

Hence A ∩B = A ∪ B

Discrete Mathematics I – p. 99/292

Page 397: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Prove A ∩B = A ∪ B

Proof. Consider any x ∈ S.

x ∈ A ∩B ⇐⇒ x 6∈ A ∩B ⇐⇒¬(x ∈ A ∧ x ∈ B) ⇐⇒ (x 6∈ A) ∨ (x 6∈ B) ⇐⇒(x ∈ A) ∨ (x ∈ B) ⇐⇒ x ∈ (A ∪ B)

Hence A ∩B = A ∪ B

Discrete Mathematics I – p. 99/292

Page 398: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Sets

Prove A ∩B = A ∪ B

Proof. Consider any x ∈ S.

x ∈ A ∩B ⇐⇒ x 6∈ A ∩B ⇐⇒¬(x ∈ A ∧ x ∈ B) ⇐⇒ (x 6∈ A) ∨ (x 6∈ B) ⇐⇒(x ∈ A) ∨ (x ∈ B) ⇐⇒ x ∈ (A ∪ B)

Hence A ∩B = A ∪ B

Discrete Mathematics I – p. 99/292

Page 399: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsStill more laws:

Let A ⊆ S

A ∩ S = A A ∪ ∅ = A identity laws

A ∩ ∅ = ∅ A ∪ S = S annihilation laws

A ∩ A = ∅ A ∪ A = Slaws of excluded middle

A ∩ (A ∪B) = A = A ∪ (A ∩B)absorption laws

Discrete Mathematics I – p. 100/292

Page 400: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsStill more laws:

Let A ⊆ S

A ∩ S = A A ∪ ∅ = A identity laws

A ∩ ∅ = ∅ A ∪ S = S annihilation laws

A ∩ A = ∅ A ∪ A = Slaws of excluded middle

A ∩ (A ∪B) = A = A ∪ (A ∩B)absorption laws

Discrete Mathematics I – p. 100/292

Page 401: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsStill more laws:

Let A ⊆ S

A ∩ S = A A ∪ ∅ = A identity laws

A ∩ ∅ = ∅ A ∪ S = S annihilation laws

A ∩ A = ∅ A ∪ A = Slaws of excluded middle

A ∩ (A ∪B) = A = A ∪ (A ∩B)absorption laws

Discrete Mathematics I – p. 100/292

Page 402: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsStill more laws:

Let A ⊆ S

A ∩ S = A A ∪ ∅ = A identity laws

A ∩ ∅ = ∅ A ∪ S = S annihilation laws

A ∩ A = ∅ A ∪ A = Slaws of excluded middle

A ∩ (A ∪B) = A = A ∪ (A ∩B)absorption laws

Discrete Mathematics I – p. 100/292

Page 403: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA structure with such properties is called a Booleanalgebra

Examples:

B = {F, T}operations ∧, ∨, ¬ identities F , T

Set of all subsets of fixed S

operations ∩, ∪,¯ identities ∅, S

Discrete Mathematics I – p. 101/292

Page 404: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA structure with such properties is called a Booleanalgebra

Examples:

B = {F, T}operations ∧, ∨, ¬ identities F , T

Set of all subsets of fixed S

operations ∩, ∪,¯ identities ∅, S

Discrete Mathematics I – p. 101/292

Page 405: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA structure with such properties is called a Booleanalgebra

Examples:

B = {F, T}operations ∧, ∨, ¬ identities F , T

Set of all subsets of fixed S

operations ∩, ∪,¯ identities ∅, S

Discrete Mathematics I – p. 101/292

Page 406: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe powerset of S is the set of all subsets of S

P(S) = {A | A ⊆ S}A ∈ P(S) ⇐⇒ A ⊆ S

Discrete Mathematics I – p. 102/292

Page 407: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

P(∅) =

{∅} (note: P(∅) 6= ∅!)

P({Bunty}) = {∅, {Bunty}}P({a, b, c}) =

{∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}

Discrete Mathematics I – p. 103/292

Page 408: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

P(∅) = {∅}

(note: P(∅) 6= ∅!)

P({Bunty}) = {∅, {Bunty}}P({a, b, c}) =

{∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}

Discrete Mathematics I – p. 103/292

Page 409: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

P(∅) = {∅} (note: P(∅) 6= ∅!)

P({Bunty}) = {∅, {Bunty}}P({a, b, c}) =

{∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}

Discrete Mathematics I – p. 103/292

Page 410: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

P(∅) = {∅} (note: P(∅) 6= ∅!)

P({Bunty}) =

{∅, {Bunty}}P({a, b, c}) =

{∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}

Discrete Mathematics I – p. 103/292

Page 411: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

P(∅) = {∅} (note: P(∅) 6= ∅!)

P({Bunty}) = {∅, {Bunty}}

P({a, b, c}) ={∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}

Discrete Mathematics I – p. 103/292

Page 412: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

P(∅) = {∅} (note: P(∅) 6= ∅!)

P({Bunty}) = {∅, {Bunty}}P({a, b, c}) =

{∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}

Discrete Mathematics I – p. 103/292

Page 413: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

P(∅) = {∅} (note: P(∅) 6= ∅!)

P({Bunty}) = {∅, {Bunty}}P({a, b, c}) =

{∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}

Discrete Mathematics I – p. 103/292

Page 414: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf S finite, P(S) finite

If S has n elements, P(S) has 2n elements

If S infinite, P(S) infinite

(Sometimes P(S) denoted 2S , even if S infinite)

Discrete Mathematics I – p. 104/292

Page 415: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf S finite, P(S) finite

If S has n elements, P(S) has 2n elements

If S infinite, P(S) infinite

(Sometimes P(S) denoted 2S , even if S infinite)

Discrete Mathematics I – p. 104/292

Page 416: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf S finite, P(S) finite

If S has n elements, P(S) has 2n elements

If S infinite, P(S) infinite

(Sometimes P(S) denoted 2S , even if S infinite)

Discrete Mathematics I – p. 104/292

Page 417: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf S finite, P(S) finite

If S has n elements, P(S) has 2n elements

If S infinite, P(S) infinite

(Sometimes P(S) denoted 2S , even if S infinite)

Discrete Mathematics I – p. 104/292

Page 418: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProperties of P:

P(A ∩B) = P(A) ∩ P(B)

In general, P(A ∪B) 6= P(A) ∪ P(B)(but ⊇ holds)

In general, P(A \B) 6= P(A) \ P(B)(but ⊆ holds)

Discrete Mathematics I – p. 105/292

Page 419: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProperties of P:

P(A ∩B) = P(A) ∩ P(B)

In general, P(A ∪B) 6= P(A) ∪ P(B)(but ⊇ holds)

In general, P(A \B) 6= P(A) \ P(B)(but ⊆ holds)

Discrete Mathematics I – p. 105/292

Page 420: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProperties of P:

P(A ∩B) = P(A) ∩ P(B)

In general, P(A ∪B) 6= P(A) ∪ P(B)(but ⊇ holds)

In general, P(A \B) 6= P(A) \ P(B)(but ⊆ holds)

Discrete Mathematics I – p. 105/292

Page 421: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B).

True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 422: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 423: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 424: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒

(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 425: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒

(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 426: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒

(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 427: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒

∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 428: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒

∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 429: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒

X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 430: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒

X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 431: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A) ∪ P(B) ⊆ P(A ∪B). True

Proof. Consider any X .

X ∈ P(A) ∪ P(B) ⇐⇒(X ∈ P(A)) ∨ (X ∈ P(B)) ⇐⇒(X ⊆ A) ∨ (X ⊆ B) ⇐⇒(∀x ∈ X : x ∈ A) ∨ (∀x ∈ X : x ∈ B) =⇒∀x ∈ X : (x ∈ A) ∨ (x ∈ B) ⇐⇒∀x ∈ X : (x ∈ A ∪B) ⇐⇒X ⊆ A ∪B ⇐⇒ X ∈ P(A ∪B)

Discrete Mathematics I – p. 106/292

Page 432: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A ∪B) ⊆ P(A) ∪ P(B).

False

Proof. Need to find A, B, X such thatX ∈ P(A ∪B), X 6∈ P(A) ∪ P(B).

Let A = {0}, B = {1}. Let X = {0, 1}.

X ⊆ A ∪B = {0, 1} =⇒ X ∈ P(A ∪B)

X 6∈ P(A) = {∅, {0}} X 6∈ P(B) = {∅, {1}}=⇒ X 6∈ P(A) ∪ P(B)

Discrete Mathematics I – p. 107/292

Page 433: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A ∪B) ⊆ P(A) ∪ P(B). False

Proof. Need to find A, B, X such thatX ∈ P(A ∪B), X 6∈ P(A) ∪ P(B).

Let A = {0}, B = {1}. Let X = {0, 1}.

X ⊆ A ∪B = {0, 1} =⇒ X ∈ P(A ∪B)

X 6∈ P(A) = {∅, {0}} X 6∈ P(B) = {∅, {1}}=⇒ X 6∈ P(A) ∪ P(B)

Discrete Mathematics I – p. 107/292

Page 434: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A ∪B) ⊆ P(A) ∪ P(B). False

Proof. Need to find A, B, X such thatX ∈ P(A ∪B), X 6∈ P(A) ∪ P(B).

Let A = {0}, B = {1}. Let X = {0, 1}.

X ⊆ A ∪B = {0, 1} =⇒ X ∈ P(A ∪B)

X 6∈ P(A) = {∅, {0}} X 6∈ P(B) = {∅, {1}}=⇒ X 6∈ P(A) ∪ P(B)

Discrete Mathematics I – p. 107/292

Page 435: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A ∪B) ⊆ P(A) ∪ P(B). False

Proof. Need to find A, B, X such thatX ∈ P(A ∪B), X 6∈ P(A) ∪ P(B).

Let A = {0}, B = {1}.

Let X = {0, 1}.

X ⊆ A ∪B = {0, 1} =⇒ X ∈ P(A ∪B)

X 6∈ P(A) = {∅, {0}} X 6∈ P(B) = {∅, {1}}=⇒ X 6∈ P(A) ∪ P(B)

Discrete Mathematics I – p. 107/292

Page 436: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A ∪B) ⊆ P(A) ∪ P(B). False

Proof. Need to find A, B, X such thatX ∈ P(A ∪B), X 6∈ P(A) ∪ P(B).

Let A = {0}, B = {1}. Let X = {0, 1}.

X ⊆ A ∪B = {0, 1} =⇒ X ∈ P(A ∪B)

X 6∈ P(A) = {∅, {0}} X 6∈ P(B) = {∅, {1}}=⇒ X 6∈ P(A) ∪ P(B)

Discrete Mathematics I – p. 107/292

Page 437: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A ∪B) ⊆ P(A) ∪ P(B). False

Proof. Need to find A, B, X such thatX ∈ P(A ∪B), X 6∈ P(A) ∪ P(B).

Let A = {0}, B = {1}. Let X = {0, 1}.

X ⊆ A ∪B = {0, 1} =⇒ X ∈ P(A ∪B)

X 6∈ P(A) = {∅, {0}} X 6∈ P(B) = {∅, {1}}=⇒ X 6∈ P(A) ∪ P(B)

Discrete Mathematics I – p. 107/292

Page 438: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A ∪B) ⊆ P(A) ∪ P(B). False

Proof. Need to find A, B, X such thatX ∈ P(A ∪B), X 6∈ P(A) ∪ P(B).

Let A = {0}, B = {1}. Let X = {0, 1}.

X ⊆ A ∪B = {0, 1} =⇒ X ∈ P(A ∪B)

X 6∈ P(A) = {∅, {0}}

X 6∈ P(B) = {∅, {1}}=⇒ X 6∈ P(A) ∪ P(B)

Discrete Mathematics I – p. 107/292

Page 439: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A ∪B) ⊆ P(A) ∪ P(B). False

Proof. Need to find A, B, X such thatX ∈ P(A ∪B), X 6∈ P(A) ∪ P(B).

Let A = {0}, B = {1}. Let X = {0, 1}.

X ⊆ A ∪B = {0, 1} =⇒ X ∈ P(A ∪B)

X 6∈ P(A) = {∅, {0}} X 6∈ P(B) = {∅, {1}}

=⇒ X 6∈ P(A) ∪ P(B)

Discrete Mathematics I – p. 107/292

Page 440: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve or disprove: For all A, B,P(A ∪B) ⊆ P(A) ∪ P(B). False

Proof. Need to find A, B, X such thatX ∈ P(A ∪B), X 6∈ P(A) ∪ P(B).

Let A = {0}, B = {1}. Let X = {0, 1}.

X ⊆ A ∪B = {0, 1} =⇒ X ∈ P(A ∪B)

X 6∈ P(A) = {∅, {0}} X 6∈ P(B) = {∅, {1}}=⇒ X 6∈ P(A) ∪ P(B)

Discrete Mathematics I – p. 107/292

Page 441: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet x1, x2, . . . , xn be any elements (n ∈ N)

A (finite) sequence: (x1, x2, . . . , xn)

JunkSeq1 = (239, banana, ace of spades)

JunkSeq2 = (banana, 239, ace of spades, 239)

JunkSeq1 6= JunkSeq2

A sequence is not a set!

(. . . and not a basic concept, will be defined later)

Discrete Mathematics I – p. 108/292

Page 442: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet x1, x2, . . . , xn be any elements (n ∈ N)

A (finite) sequence: (x1, x2, . . . , xn)

JunkSeq1 = (239, banana, ace of spades)

JunkSeq2 = (banana, 239, ace of spades, 239)

JunkSeq1 6= JunkSeq2

A sequence is not a set!

(. . . and not a basic concept, will be defined later)

Discrete Mathematics I – p. 108/292

Page 443: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet x1, x2, . . . , xn be any elements (n ∈ N)

A (finite) sequence: (x1, x2, . . . , xn)

JunkSeq1 = (239, banana, ace of spades)

JunkSeq2 = (banana, 239, ace of spades, 239)

JunkSeq1 6= JunkSeq2

A sequence is not a set!

(. . . and not a basic concept, will be defined later)

Discrete Mathematics I – p. 108/292

Page 444: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet x1, x2, . . . , xn be any elements (n ∈ N)

A (finite) sequence: (x1, x2, . . . , xn)

JunkSeq1 = (239, banana, ace of spades)

JunkSeq2 = (banana, 239, ace of spades, 239)

JunkSeq1 6= JunkSeq2

A sequence is not a set!

(. . . and not a basic concept, will be defined later)

Discrete Mathematics I – p. 108/292

Page 445: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet x1, x2, . . . , xn be any elements (n ∈ N)

A (finite) sequence: (x1, x2, . . . , xn)

JunkSeq1 = (239, banana, ace of spades)

JunkSeq2 = (banana, 239, ace of spades, 239)

JunkSeq1 6= JunkSeq2

A sequence is not a set!

(. . . and not a basic concept, will be defined later)

Discrete Mathematics I – p. 108/292

Page 446: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet x1, x2, . . . , xn be any elements (n ∈ N)

A (finite) sequence: (x1, x2, . . . , xn)

JunkSeq1 = (239, banana, ace of spades)

JunkSeq2 = (banana, 239, ace of spades, 239)

JunkSeq1 6= JunkSeq2

A sequence is not a set!

(. . . and not a basic concept, will be defined later)

Discrete Mathematics I – p. 108/292

Page 447: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsLet x1, x2, . . . , xn be any elements (n ∈ N)

A (finite) sequence: (x1, x2, . . . , xn)

JunkSeq1 = (239, banana, ace of spades)

JunkSeq2 = (banana, 239, ace of spades, 239)

JunkSeq1 6= JunkSeq2

A sequence is not a set!

(. . . and not a basic concept, will be defined later)

Discrete Mathematics I – p. 108/292

Page 448: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsFor sequences, repetitions and order matter

(x, y) 6= (y, x) 6= (y, x, x)

Number n is sequence length

length(JunkSeq1 ) = 3 length((x, y)) = 2

Sequence of length 2 is called an ordered pair

A direct definition: (x, y) means {{x, y}, x}

Discrete Mathematics I – p. 109/292

Page 449: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsFor sequences, repetitions and order matter

(x, y) 6= (y, x) 6= (y, x, x)

Number n is sequence length

length(JunkSeq1 ) = 3 length((x, y)) = 2

Sequence of length 2 is called an ordered pair

A direct definition: (x, y) means {{x, y}, x}

Discrete Mathematics I – p. 109/292

Page 450: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsFor sequences, repetitions and order matter

(x, y) 6= (y, x) 6= (y, x, x)

Number n is sequence length

length(JunkSeq1 ) = 3 length((x, y)) = 2

Sequence of length 2 is called an ordered pair

A direct definition: (x, y) means {{x, y}, x}

Discrete Mathematics I – p. 109/292

Page 451: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsFor sequences, repetitions and order matter

(x, y) 6= (y, x) 6= (y, x, x)

Number n is sequence length

length(JunkSeq1 ) = 3 length((x, y)) = 2

Sequence of length 2 is called an ordered pair

A direct definition: (x, y) means {{x, y}, x}

Discrete Mathematics I – p. 109/292

Page 452: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsFor sequences, repetitions and order matter

(x, y) 6= (y, x) 6= (y, x, x)

Number n is sequence length

length(JunkSeq1 ) = 3 length((x, y)) = 2

Sequence of length 2 is called an ordered pair

A direct definition: (x, y) means {{x, y}, x}

Discrete Mathematics I – p. 109/292

Page 453: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsFor sequences, repetitions and order matter

(x, y) 6= (y, x) 6= (y, x, x)

Number n is sequence length

length(JunkSeq1 ) = 3 length((x, y)) = 2

Sequence of length 2 is called an ordered pair

A direct definition: (x, y) means {{x, y}, x}

Discrete Mathematics I – p. 109/292

Page 454: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe Cartesian product of sets A, B is the set of allordered pairs (a, b), where a ∈ A, b ∈ B

(After R. Descartes, 1596–1650)

A×B = {(a, b) | (a ∈ A) ∧ (b ∈ B)}A2 = A× A the Cartesian square of A

Discrete Mathematics I – p. 110/292

Page 455: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe Cartesian product of sets A, B is the set of allordered pairs (a, b), where a ∈ A, b ∈ B

(After R. Descartes, 1596–1650)

A×B = {(a, b) | (a ∈ A) ∧ (b ∈ B)}A2 = A× A the Cartesian square of A

Discrete Mathematics I – p. 110/292

Page 456: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe Cartesian product of sets A, B is the set of allordered pairs (a, b), where a ∈ A, b ∈ B

(After R. Descartes, 1596–1650)

A×B = {(a, b) | (a ∈ A) ∧ (b ∈ B)}

A2 = A× A the Cartesian square of A

Discrete Mathematics I – p. 110/292

Page 457: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe Cartesian product of sets A, B is the set of allordered pairs (a, b), where a ∈ A, b ∈ B

(After R. Descartes, 1596–1650)

A×B = {(a, b) | (a ∈ A) ∧ (b ∈ B)}A2 = A× A the Cartesian square of A

Discrete Mathematics I – p. 110/292

Page 458: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

∅ × A =

A× ∅ = ∅ for any set A

{Bunty} × {Fowler} = {(Bunty, Fowler)}{Fowler} × {Bunty} = {(Fowler, Bunty)}

Discrete Mathematics I – p. 111/292

Page 459: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

∅ × A = A× ∅ =

∅ for any set A

{Bunty} × {Fowler} = {(Bunty, Fowler)}{Fowler} × {Bunty} = {(Fowler, Bunty)}

Discrete Mathematics I – p. 111/292

Page 460: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

∅ × A = A× ∅ = ∅ for any set A

{Bunty} × {Fowler} = {(Bunty, Fowler)}{Fowler} × {Bunty} = {(Fowler, Bunty)}

Discrete Mathematics I – p. 111/292

Page 461: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

∅ × A = A× ∅ = ∅ for any set A

{Bunty} × {Fowler} =

{(Bunty, Fowler)}{Fowler} × {Bunty} = {(Fowler, Bunty)}

Discrete Mathematics I – p. 111/292

Page 462: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

∅ × A = A× ∅ = ∅ for any set A

{Bunty} × {Fowler} = {(Bunty, Fowler)}

{Fowler} × {Bunty} = {(Fowler, Bunty)}

Discrete Mathematics I – p. 111/292

Page 463: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

∅ × A = A× ∅ = ∅ for any set A

{Bunty} × {Fowler} = {(Bunty, Fowler)}{Fowler} × {Bunty} =

{(Fowler, Bunty)}

Discrete Mathematics I – p. 111/292

Page 464: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsExamples:

∅ × A = A× ∅ = ∅ for any set A

{Bunty} × {Fowler} = {(Bunty, Fowler)}{Fowler} × {Bunty} = {(Fowler, Bunty)}

Discrete Mathematics I – p. 111/292

Page 465: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore examples:

{a, b, c} × {d, e} =

{(a, d), (a, e), (b, d), (b, e), (c, d), (c, e)}N×Planets = {(n, x) | (n ∈ N)∧ (x ∈ Planets)} ={(5, Saturn), (239, Earth), . . .}N2 = N× N = {(m, n) | m, n ∈ N}

Discrete Mathematics I – p. 112/292

Page 466: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore examples:

{a, b, c} × {d, e} ={(a, d), (a, e), (b, d), (b, e), (c, d), (c, e)}

N×Planets = {(n, x) | (n ∈ N)∧ (x ∈ Planets)} ={(5, Saturn), (239, Earth), . . .}N2 = N× N = {(m, n) | m, n ∈ N}

Discrete Mathematics I – p. 112/292

Page 467: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore examples:

{a, b, c} × {d, e} ={(a, d), (a, e), (b, d), (b, e), (c, d), (c, e)}N×Planets =

{(n, x) | (n ∈ N)∧ (x ∈ Planets)} ={(5, Saturn), (239, Earth), . . .}N2 = N× N = {(m, n) | m, n ∈ N}

Discrete Mathematics I – p. 112/292

Page 468: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore examples:

{a, b, c} × {d, e} ={(a, d), (a, e), (b, d), (b, e), (c, d), (c, e)}N×Planets = {(n, x) | (n ∈ N)∧ (x ∈ Planets)} =

{(5, Saturn), (239, Earth), . . .}N2 = N× N = {(m, n) | m, n ∈ N}

Discrete Mathematics I – p. 112/292

Page 469: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore examples:

{a, b, c} × {d, e} ={(a, d), (a, e), (b, d), (b, e), (c, d), (c, e)}N×Planets = {(n, x) | (n ∈ N)∧ (x ∈ Planets)} ={(5, Saturn), (239, Earth), . . .}

N2 = N× N = {(m, n) | m, n ∈ N}

Discrete Mathematics I – p. 112/292

Page 470: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsMore examples:

{a, b, c} × {d, e} ={(a, d), (a, e), (b, d), (b, e), (c, d), (c, e)}N×Planets = {(n, x) | (n ∈ N)∧ (x ∈ Planets)} ={(5, Saturn), (239, Earth), . . .}N2 = N× N = {(m, n) | m, n ∈ N}

Discrete Mathematics I – p. 112/292

Page 471: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf A, B finite, A×B finite

If A has m elements, B has n elements, then A×Bhas m · n elements

(. . . hence the “×” sign)

If A infinite, B nonempty, then A×B, B ×A infinite

Discrete Mathematics I – p. 113/292

Page 472: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf A, B finite, A×B finite

If A has m elements, B has n elements, then A×Bhas m · n elements

(. . . hence the “×” sign)

If A infinite, B nonempty, then A×B, B ×A infinite

Discrete Mathematics I – p. 113/292

Page 473: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf A, B finite, A×B finite

If A has m elements, B has n elements, then A×Bhas m · n elements

(. . . hence the “×” sign)

If A infinite, B nonempty, then A×B, B ×A infinite

Discrete Mathematics I – p. 113/292

Page 474: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf A, B finite, A×B finite

If A has m elements, B has n elements, then A×Bhas m · n elements

(. . . hence the “×” sign)

If A infinite, B nonempty, then A×B, B ×A infinite

Discrete Mathematics I – p. 113/292

Page 475: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProperties of ×:

In general, A×B 6= B × A

In general, (A×B)× C 6= A× (B × C)

. . . but = holds if we identify ((a, b), c) and (a, (b, c))

Discrete Mathematics I – p. 114/292

Page 476: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProperties of ×:

In general, A×B 6= B × A

In general, (A×B)× C 6= A× (B × C)

. . . but = holds if we identify ((a, b), c) and (a, (b, c))

Discrete Mathematics I – p. 114/292

Page 477: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProperties of ×:

In general, A×B 6= B × A

In general, (A×B)× C 6= A× (B × C)

. . . but = holds if we identify ((a, b), c) and (a, (b, c))

Discrete Mathematics I – p. 114/292

Page 478: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProperties of ×:

In general, A×B 6= B × A

In general, (A×B)× C 6= A× (B × C)

. . . but = holds if we identify ((a, b), c) and (a, (b, c))

Discrete Mathematics I – p. 114/292

Page 479: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA× (B ∩ C) = (A×B) ∩ (A× C)(A ∩B)× C = (A× C) ∩ (B × C)

A× (B ∪ C) = (A×B) ∪ (A× C)(A ∪B)× C = (A× C) ∪ (B × C)

A× (B \ C) = (A×B) \ (A× C)(A \B)× C = (A× C) \ (B × C)

× distributes over ∩,∪, \

Discrete Mathematics I – p. 115/292

Page 480: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA× (B ∩ C) = (A×B) ∩ (A× C)(A ∩B)× C = (A× C) ∩ (B × C)

A× (B ∪ C) = (A×B) ∪ (A× C)(A ∪B)× C = (A× C) ∪ (B × C)

A× (B \ C) = (A×B) \ (A× C)(A \B)× C = (A× C) \ (B × C)

× distributes over ∩,∪, \

Discrete Mathematics I – p. 115/292

Page 481: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA× (B ∩ C) = (A×B) ∩ (A× C)(A ∩B)× C = (A× C) ∩ (B × C)

A× (B ∪ C) = (A×B) ∪ (A× C)(A ∪B)× C = (A× C) ∪ (B × C)

A× (B \ C) = (A×B) \ (A× C)(A \B)× C = (A× C) \ (B × C)

× distributes over ∩,∪, \

Discrete Mathematics I – p. 115/292

Page 482: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsA× (B ∩ C) = (A×B) ∩ (A× C)(A ∩B)× C = (A× C) ∩ (B × C)

A× (B ∪ C) = (A×B) ∪ (A× C)(A ∪B)× C = (A× C) ∪ (B × C)

A× (B \ C) = (A×B) \ (A× C)(A \B)× C = (A× C) \ (B × C)

× distributes over ∩,∪, \

Discrete Mathematics I – p. 115/292

Page 483: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A× (B ∪ C) = (A×B) ∪ (A× C)

Proof. Consider any (x, y).(x, y) ∈ A× (B ∪ C) ⇐⇒(x ∈ A) ∧ (y ∈ (B ∪ C)) ⇐⇒(x ∈ A) ∧ (y ∈ B ∨ y ∈ C) ⇐⇒(x ∈ A ∧ y ∈ B) ∨ (x ∈ A ∧ y ∈ C) ⇐⇒((x, y) ∈ A×B) ∨ ((x, y) ∈ A× C) ⇐⇒(x, y) ∈ (A×B) ∪ (A× C)

Hence A× (B ∪ C) = (A×B) ∪ (A× C).

Discrete Mathematics I – p. 116/292

Page 484: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A× (B ∪ C) = (A×B) ∪ (A× C)

Proof. Consider any (x, y).

(x, y) ∈ A× (B ∪ C) ⇐⇒(x ∈ A) ∧ (y ∈ (B ∪ C)) ⇐⇒(x ∈ A) ∧ (y ∈ B ∨ y ∈ C) ⇐⇒(x ∈ A ∧ y ∈ B) ∨ (x ∈ A ∧ y ∈ C) ⇐⇒((x, y) ∈ A×B) ∨ ((x, y) ∈ A× C) ⇐⇒(x, y) ∈ (A×B) ∪ (A× C)

Hence A× (B ∪ C) = (A×B) ∪ (A× C).

Discrete Mathematics I – p. 116/292

Page 485: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A× (B ∪ C) = (A×B) ∪ (A× C)

Proof. Consider any (x, y).(x, y) ∈ A× (B ∪ C) ⇐⇒

(x ∈ A) ∧ (y ∈ (B ∪ C)) ⇐⇒(x ∈ A) ∧ (y ∈ B ∨ y ∈ C) ⇐⇒(x ∈ A ∧ y ∈ B) ∨ (x ∈ A ∧ y ∈ C) ⇐⇒((x, y) ∈ A×B) ∨ ((x, y) ∈ A× C) ⇐⇒(x, y) ∈ (A×B) ∪ (A× C)

Hence A× (B ∪ C) = (A×B) ∪ (A× C).

Discrete Mathematics I – p. 116/292

Page 486: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A× (B ∪ C) = (A×B) ∪ (A× C)

Proof. Consider any (x, y).(x, y) ∈ A× (B ∪ C) ⇐⇒(x ∈ A) ∧ (y ∈ (B ∪ C)) ⇐⇒

(x ∈ A) ∧ (y ∈ B ∨ y ∈ C) ⇐⇒(x ∈ A ∧ y ∈ B) ∨ (x ∈ A ∧ y ∈ C) ⇐⇒((x, y) ∈ A×B) ∨ ((x, y) ∈ A× C) ⇐⇒(x, y) ∈ (A×B) ∪ (A× C)

Hence A× (B ∪ C) = (A×B) ∪ (A× C).

Discrete Mathematics I – p. 116/292

Page 487: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A× (B ∪ C) = (A×B) ∪ (A× C)

Proof. Consider any (x, y).(x, y) ∈ A× (B ∪ C) ⇐⇒(x ∈ A) ∧ (y ∈ (B ∪ C)) ⇐⇒(x ∈ A) ∧ (y ∈ B ∨ y ∈ C) ⇐⇒

(x ∈ A ∧ y ∈ B) ∨ (x ∈ A ∧ y ∈ C) ⇐⇒((x, y) ∈ A×B) ∨ ((x, y) ∈ A× C) ⇐⇒(x, y) ∈ (A×B) ∪ (A× C)

Hence A× (B ∪ C) = (A×B) ∪ (A× C).

Discrete Mathematics I – p. 116/292

Page 488: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A× (B ∪ C) = (A×B) ∪ (A× C)

Proof. Consider any (x, y).(x, y) ∈ A× (B ∪ C) ⇐⇒(x ∈ A) ∧ (y ∈ (B ∪ C)) ⇐⇒(x ∈ A) ∧ (y ∈ B ∨ y ∈ C) ⇐⇒(x ∈ A ∧ y ∈ B) ∨ (x ∈ A ∧ y ∈ C) ⇐⇒

((x, y) ∈ A×B) ∨ ((x, y) ∈ A× C) ⇐⇒(x, y) ∈ (A×B) ∪ (A× C)

Hence A× (B ∪ C) = (A×B) ∪ (A× C).

Discrete Mathematics I – p. 116/292

Page 489: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A× (B ∪ C) = (A×B) ∪ (A× C)

Proof. Consider any (x, y).(x, y) ∈ A× (B ∪ C) ⇐⇒(x ∈ A) ∧ (y ∈ (B ∪ C)) ⇐⇒(x ∈ A) ∧ (y ∈ B ∨ y ∈ C) ⇐⇒(x ∈ A ∧ y ∈ B) ∨ (x ∈ A ∧ y ∈ C) ⇐⇒((x, y) ∈ A×B) ∨ ((x, y) ∈ A× C) ⇐⇒

(x, y) ∈ (A×B) ∪ (A× C)

Hence A× (B ∪ C) = (A×B) ∪ (A× C).

Discrete Mathematics I – p. 116/292

Page 490: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A× (B ∪ C) = (A×B) ∪ (A× C)

Proof. Consider any (x, y).(x, y) ∈ A× (B ∪ C) ⇐⇒(x ∈ A) ∧ (y ∈ (B ∪ C)) ⇐⇒(x ∈ A) ∧ (y ∈ B ∨ y ∈ C) ⇐⇒(x ∈ A ∧ y ∈ B) ∨ (x ∈ A ∧ y ∈ C) ⇐⇒((x, y) ∈ A×B) ∨ ((x, y) ∈ A× C) ⇐⇒(x, y) ∈ (A×B) ∪ (A× C)

Hence A× (B ∪ C) = (A×B) ∪ (A× C).

Discrete Mathematics I – p. 116/292

Page 491: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsProve A× (B ∪ C) = (A×B) ∪ (A× C)

Proof. Consider any (x, y).(x, y) ∈ A× (B ∪ C) ⇐⇒(x ∈ A) ∧ (y ∈ (B ∪ C)) ⇐⇒(x ∈ A) ∧ (y ∈ B ∨ y ∈ C) ⇐⇒(x ∈ A ∧ y ∈ B) ∨ (x ∈ A ∧ y ∈ C) ⇐⇒((x, y) ∈ A×B) ∨ ((x, y) ∈ A× C) ⇐⇒(x, y) ∈ (A×B) ∪ (A× C)

Hence A× (B ∪ C) = (A×B) ∪ (A× C).

Discrete Mathematics I – p. 116/292

Page 492: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe Cartesian product of sets A1, A2, . . . , An is theset of all ordered sequences (a1, a2, . . . , an), whereai ∈ Ai for all i ∈ {1, . . . , n}

A1 × · · · × An ={(a1, . . . , an) | ∀i ∈ {1, . . . , n} : ai ∈ Ai}

An = A× A× · · · × A (n times)the n-th Cartesian power of A

Discrete Mathematics I – p. 117/292

Page 493: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe Cartesian product of sets A1, A2, . . . , An is theset of all ordered sequences (a1, a2, . . . , an), whereai ∈ Ai for all i ∈ {1, . . . , n}A1 × · · · × An =

{(a1, . . . , an) | ∀i ∈ {1, . . . , n} : ai ∈ Ai}

An = A× A× · · · × A (n times)the n-th Cartesian power of A

Discrete Mathematics I – p. 117/292

Page 494: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsThe Cartesian product of sets A1, A2, . . . , An is theset of all ordered sequences (a1, a2, . . . , an), whereai ∈ Ai for all i ∈ {1, . . . , n}A1 × · · · × An =

{(a1, . . . , an) | ∀i ∈ {1, . . . , n} : ai ∈ Ai}An = A× A× · · · × A (n times)

the n-th Cartesian power of A

Discrete Mathematics I – p. 117/292

Page 495: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf A1, A2, . . . , An finite, A1 × A2 × · · · × An finite

If for all i, Ai has ni elements, A1 × · · · × Ak hasn1 · . . . · nk elements

If one of A1, A2, . . . , An infinite, A1 × A2 × · · · × An

infinite (unless one of them is empty)

Discrete Mathematics I – p. 118/292

Page 496: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf A1, A2, . . . , An finite, A1 × A2 × · · · × An finite

If for all i, Ai has ni elements, A1 × · · · × Ak hasn1 · . . . · nk elements

If one of A1, A2, . . . , An infinite, A1 × A2 × · · · × An

infinite (unless one of them is empty)

Discrete Mathematics I – p. 118/292

Page 497: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsIf A1, A2, . . . , An finite, A1 × A2 × · · · × An finite

If for all i, Ai has ni elements, A1 × · · · × Ak hasn1 · . . . · nk elements

If one of A1, A2, . . . , An infinite, A1 × A2 × · · · × An

infinite (unless one of them is empty)

Discrete Mathematics I – p. 118/292

Page 498: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

SetsTherefore:

If A finite, An finite

If A has k elements, An has kn elements

If A infinite, An infinite

Discrete Mathematics I – p. 119/292

Page 499: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relations

Discrete Mathematics I – p. 120/292

Page 500: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsConsider P (x, y) = x ≤ y x, y ∈ N

{(x, y) | x ≤ y} ⊆ N× N = N2

Discrete Mathematics I – p. 121/292

Page 501: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsConsider P (x, y) = x ≤ y x, y ∈ N

{(x, y) | x ≤ y} ⊆ N× N = N2

Discrete Mathematics I – p. 121/292

Page 502: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsA relation between sets A, B is a subset of A×B

Rp : A ↔ B ⇐⇒ Rp ⊆ A×B

Example:

R≤ = {(a, b) ∈ N× N | a ≤ b} ⊆ N× N = N2

Write a p b for (a, b) ∈ Rp

For example a ≤ b instead of (a, b) ∈ R≤

Discrete Mathematics I – p. 122/292

Page 503: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsA relation between sets A, B is a subset of A×B

Rp : A ↔ B ⇐⇒ Rp ⊆ A×B

Example:

R≤ = {(a, b) ∈ N× N | a ≤ b} ⊆ N× N = N2

Write a p b for (a, b) ∈ Rp

For example a ≤ b instead of (a, b) ∈ R≤

Discrete Mathematics I – p. 122/292

Page 504: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsA relation between sets A, B is a subset of A×B

Rp : A ↔ B ⇐⇒ Rp ⊆ A×B

Example:

R≤ = {(a, b) ∈ N× N | a ≤ b} ⊆ N× N = N2

Write a p b for (a, b) ∈ Rp

For example a ≤ b instead of (a, b) ∈ R≤

Discrete Mathematics I – p. 122/292

Page 505: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsA relation between sets A, B is a subset of A×B

Rp : A ↔ B ⇐⇒ Rp ⊆ A×B

Example:

R≤ = {(a, b) ∈ N× N | a ≤ b} ⊆ N× N = N2

Write a p b for (a, b) ∈ Rp

For example a ≤ b instead of (a, b) ∈ R≤

Discrete Mathematics I – p. 122/292

Page 506: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples of relations:

Equality relation R=A: A ↔ A

R=A= {(a, a) | a ∈ A}

Usually drop A: a = a

Empty relation ∅ : A ↔ A

Complete relation A2 : A ↔ A

Discrete Mathematics I – p. 123/292

Page 507: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples of relations:

Equality relation R=A: A ↔ A

R=A= {(a, a) | a ∈ A}

Usually drop A: a = a

Empty relation ∅ : A ↔ A

Complete relation A2 : A ↔ A

Discrete Mathematics I – p. 123/292

Page 508: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples of relations:

Equality relation R=A: A ↔ A

R=A= {(a, a) | a ∈ A}

Usually drop A: a = a

Empty relation ∅ : A ↔ A

Complete relation A2 : A ↔ A

Discrete Mathematics I – p. 123/292

Page 509: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples of relations:

Equality relation R=A: A ↔ A

R=A= {(a, a) | a ∈ A}

Usually drop A: a = a

Empty relation ∅ : A ↔ A

Complete relation A2 : A ↔ A

Discrete Mathematics I – p. 123/292

Page 510: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples of relations:

Equality relation R=A: A ↔ A

R=A= {(a, a) | a ∈ A}

Usually drop A: a = a

Empty relation ∅ : A ↔ A

Complete relation A2 : A ↔ A

Discrete Mathematics I – p. 123/292

Page 511: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsMore examples of relations:

R<, R≤, R>, R≥ N ↔ N

R| : N ↔ N m | n ⇐⇒ m divides n

m | n ⇐⇒ ∃k ∈ N : k ·m = n

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rt : People ↔ Animalsx t y ⇐⇒ x has y as a pet

Discrete Mathematics I – p. 124/292

Page 512: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsMore examples of relations:

R<, R≤, R>, R≥ N ↔ N

R| : N ↔ N m | n ⇐⇒ m divides n

m | n ⇐⇒ ∃k ∈ N : k ·m = n

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rt : People ↔ Animalsx t y ⇐⇒ x has y as a pet

Discrete Mathematics I – p. 124/292

Page 513: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsMore examples of relations:

R<, R≤, R>, R≥ N ↔ N

R| : N ↔ N m | n ⇐⇒ m divides n

m | n ⇐⇒ ∃k ∈ N : k ·m = n

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rt : People ↔ Animalsx t y ⇐⇒ x has y as a pet

Discrete Mathematics I – p. 124/292

Page 514: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsMore examples of relations:

R<, R≤, R>, R≥ N ↔ N

R| : N ↔ N m | n ⇐⇒ m divides n

m | n ⇐⇒ ∃k ∈ N : k ·m = n

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rt : People ↔ Animalsx t y ⇐⇒ x has y as a pet

Discrete Mathematics I – p. 124/292

Page 515: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsMore examples of relations:

R<, R≤, R>, R≥ N ↔ N

R| : N ↔ N m | n ⇐⇒ m divides n

m | n ⇐⇒ ∃k ∈ N : k ·m = n

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rt : People ↔ Animalsx t y ⇐⇒ x has y as a pet

Discrete Mathematics I – p. 124/292

Page 516: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsMore examples of relations:

Rs : N ↔ N m s n ⇐⇒ m2 = n

Rm : People ↔ Peoplex m y ⇐⇒ the mother of x is y

In these relations, for every x ∈ A, there is a uniquey ∈ B, such that x is related to y

Such relations are called functions

Discrete Mathematics I – p. 125/292

Page 517: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsMore examples of relations:

Rs : N ↔ N m s n ⇐⇒ m2 = n

Rm : People ↔ Peoplex m y ⇐⇒ the mother of x is y

In these relations, for every x ∈ A, there is a uniquey ∈ B, such that x is related to y

Such relations are called functions

Discrete Mathematics I – p. 125/292

Page 518: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsMore examples of relations:

Rs : N ↔ N m s n ⇐⇒ m2 = n

Rm : People ↔ Peoplex m y ⇐⇒ the mother of x is y

In these relations, for every x ∈ A, there is a uniquey ∈ B, such that x is related to y

Such relations are called functions

Discrete Mathematics I – p. 125/292

Page 519: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsMore examples of relations:

Rs : N ↔ N m s n ⇐⇒ m2 = n

Rm : People ↔ Peoplex m y ⇐⇒ the mother of x is y

In these relations, for every x ∈ A, there is a uniquey ∈ B, such that x is related to y

Such relations are called functions

Discrete Mathematics I – p. 125/292

Page 520: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp, Rq : A ↔ B

Rp ∩Rq, Rp ∪Rq, Rp \Rq : A ↔ B

Discrete Mathematics I – p. 126/292

Page 521: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp, Rq : A ↔ B

Rp ∩Rq, Rp ∪Rq, Rp \Rq : A ↔ B

Discrete Mathematics I – p. 126/292

Page 522: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

The composition of p and q Rp ◦ q : A ↔ C

∀(a, c) ∈ A×C : a(p ◦ q)c ⇔ ∃b ∈ B : (a p b)∧(b q c)

Discrete Mathematics I – p. 127/292

Page 523: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

The composition of p and q Rp ◦ q : A ↔ C

∀(a, c) ∈ A×C : a(p ◦ q)c ⇔ ∃b ∈ B : (a p b)∧(b q c)

Discrete Mathematics I – p. 127/292

Page 524: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

The composition of p and q Rp ◦ q : A ↔ C

∀(a, c) ∈ A×C : a(p ◦ q)c ⇔ ∃b ∈ B : (a p b)∧(b q c)

Discrete Mathematics I – p. 127/292

Page 525: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rt : People ↔ Animalsx t y ⇐⇒ x has y as a pet

Rq ◦ t : People ↔ Animals

x(q ◦ t)z ⇐⇒ x has a parent with pet z

Rq ◦ q : People ↔ People

x(q ◦ q)z ⇐⇒ x is a grandchild of z

Discrete Mathematics I – p. 128/292

Page 526: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rt : People ↔ Animalsx t y ⇐⇒ x has y as a pet

Rq ◦ t : People ↔ Animals

x(q ◦ t)z ⇐⇒ x has a parent with pet z

Rq ◦ q : People ↔ People

x(q ◦ q)z ⇐⇒ x is a grandchild of z

Discrete Mathematics I – p. 128/292

Page 527: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rt : People ↔ Animalsx t y ⇐⇒ x has y as a pet

Rq ◦ t : People ↔ Animals

x(q ◦ t)z ⇐⇒ x has a parent with pet z

Rq ◦ q : People ↔ People

x(q ◦ q)z ⇐⇒ x is a grandchild of z

Discrete Mathematics I – p. 128/292

Page 528: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

Prove: if Rp, Rq functions, then Rp ◦ q a function

Proof. Consider any x ∈ A.

Rp function =⇒ ∃!y ∈ B : x p y

Rq function =⇒ ∃!z ∈ C : y q z

Hence ∃!z ∈ C : x(p ◦ q)z

Therefore, Rp ◦ q is a function.

Discrete Mathematics I – p. 129/292

Page 529: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

Prove: if Rp, Rq functions, then Rp ◦ q a function

Proof. Consider any x ∈ A.

Rp function =⇒ ∃!y ∈ B : x p y

Rq function =⇒ ∃!z ∈ C : y q z

Hence ∃!z ∈ C : x(p ◦ q)z

Therefore, Rp ◦ q is a function.

Discrete Mathematics I – p. 129/292

Page 530: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

Prove: if Rp, Rq functions, then Rp ◦ q a function

Proof. Consider any x ∈ A.

Rp function =⇒ ∃!y ∈ B : x p y

Rq function =⇒ ∃!z ∈ C : y q z

Hence ∃!z ∈ C : x(p ◦ q)z

Therefore, Rp ◦ q is a function.

Discrete Mathematics I – p. 129/292

Page 531: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

Prove: if Rp, Rq functions, then Rp ◦ q a function

Proof. Consider any x ∈ A.

Rp function =⇒ ∃!y ∈ B : x p y

Rq function =⇒ ∃!z ∈ C : y q z

Hence ∃!z ∈ C : x(p ◦ q)z

Therefore, Rp ◦ q is a function.

Discrete Mathematics I – p. 129/292

Page 532: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

Prove: if Rp, Rq functions, then Rp ◦ q a function

Proof. Consider any x ∈ A.

Rp function =⇒ ∃!y ∈ B : x p y

Rq function =⇒ ∃!z ∈ C : y q z

Hence ∃!z ∈ C : x(p ◦ q)z

Therefore, Rp ◦ q is a function.

Discrete Mathematics I – p. 129/292

Page 533: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

Prove: if Rp, Rq functions, then Rp ◦ q a function

Proof. Consider any x ∈ A.

Rp function =⇒ ∃!y ∈ B : x p y

Rq function =⇒ ∃!z ∈ C : y q z

Hence ∃!z ∈ C : x(p ◦ q)z

Therefore, Rp ◦ q is a function.

Discrete Mathematics I – p. 129/292

Page 534: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B Rq : B ↔ C

Prove: if Rp, Rq functions, then Rp ◦ q a function

Proof. Consider any x ∈ A.

Rp function =⇒ ∃!y ∈ B : x p y

Rq function =⇒ ∃!z ∈ C : y q z

Hence ∃!z ∈ C : x(p ◦ q)z

Therefore, Rp ◦ q is a function.

Discrete Mathematics I – p. 129/292

Page 535: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B

The inverse of p Rp−1 : B ↔ A

∀(b, a) ∈ B × A : b(p−1)a ⇐⇒ a p b

Example:

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rq−1 : People ↔ People

x q−1 y ⇐⇒ x is a parent of y

Discrete Mathematics I – p. 130/292

Page 536: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B

The inverse of p Rp−1 : B ↔ A

∀(b, a) ∈ B × A : b(p−1)a ⇐⇒ a p b

Example:

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rq−1 : People ↔ People

x q−1 y ⇐⇒ x is a parent of y

Discrete Mathematics I – p. 130/292

Page 537: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B

The inverse of p Rp−1 : B ↔ A

∀(b, a) ∈ B × A : b(p−1)a ⇐⇒ a p b

Example:

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rq−1 : People ↔ People

x q−1 y ⇐⇒ x is a parent of y

Discrete Mathematics I – p. 130/292

Page 538: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B

The inverse of p Rp−1 : B ↔ A

∀(b, a) ∈ B × A : b(p−1)a ⇐⇒ a p b

Example:

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rq−1 : People ↔ People

x q−1 y ⇐⇒ x is a parent of y

Discrete Mathematics I – p. 130/292

Page 539: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRp : A ↔ B

The inverse of p Rp−1 : B ↔ A

∀(b, a) ∈ B × A : b(p−1)a ⇐⇒ a p b

Example:

Rq : People ↔ People x q y ⇐⇒ x is a child of y

Rq−1 : People ↔ People

x q−1 y ⇐⇒ x is a parent of y

Discrete Mathematics I – p. 130/292

Page 540: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is reflexive, if ∀a ∈ A : a p a

Examples: R= A2 R≤ R|

Rp reflexive iff R= ⊆ Rp

Discrete Mathematics I – p. 131/292

Page 541: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is reflexive, if ∀a ∈ A : a p a

Examples: R=

A2 R≤ R|

Rp reflexive iff R= ⊆ Rp

Discrete Mathematics I – p. 131/292

Page 542: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is reflexive, if ∀a ∈ A : a p a

Examples: R= A2

R≤ R|

Rp reflexive iff R= ⊆ Rp

Discrete Mathematics I – p. 131/292

Page 543: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is reflexive, if ∀a ∈ A : a p a

Examples: R= A2 R≤

R|

Rp reflexive iff R= ⊆ Rp

Discrete Mathematics I – p. 131/292

Page 544: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is reflexive, if ∀a ∈ A : a p a

Examples: R= A2 R≤ R|

Rp reflexive iff R= ⊆ Rp

Discrete Mathematics I – p. 131/292

Page 545: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is reflexive, if ∀a ∈ A : a p a

Examples: R= A2 R≤ R|

Rp reflexive iff R= ⊆ Rp

Discrete Mathematics I – p. 131/292

Page 546: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is symmetric, if

∀a, b ∈ A : a p b ⇒ b p a

Examples: R= A2 ∅R∗ : N ↔ N x ∗ y ⇔ (x + y = 10)

Rp symmetric iff Rp−1 = Rp

Discrete Mathematics I – p. 132/292

Page 547: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is symmetric, if

∀a, b ∈ A : a p b ⇒ b p a

Examples: R=

A2 ∅R∗ : N ↔ N x ∗ y ⇔ (x + y = 10)

Rp symmetric iff Rp−1 = Rp

Discrete Mathematics I – p. 132/292

Page 548: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is symmetric, if

∀a, b ∈ A : a p b ⇒ b p a

Examples: R= A2

∅R∗ : N ↔ N x ∗ y ⇔ (x + y = 10)

Rp symmetric iff Rp−1 = Rp

Discrete Mathematics I – p. 132/292

Page 549: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is symmetric, if

∀a, b ∈ A : a p b ⇒ b p a

Examples: R= A2 ∅

R∗ : N ↔ N x ∗ y ⇔ (x + y = 10)

Rp symmetric iff Rp−1 = Rp

Discrete Mathematics I – p. 132/292

Page 550: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is symmetric, if

∀a, b ∈ A : a p b ⇒ b p a

Examples: R= A2 ∅R∗ : N ↔ N x ∗ y ⇔ (x + y = 10)

Rp symmetric iff Rp−1 = Rp

Discrete Mathematics I – p. 132/292

Page 551: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is symmetric, if

∀a, b ∈ A : a p b ⇒ b p a

Examples: R= A2 ∅R∗ : N ↔ N x ∗ y ⇔ (x + y = 10)

Rp symmetric iff Rp−1 = Rp

Discrete Mathematics I – p. 132/292

Page 552: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is antisymmetric, if

∀a, b ∈ A : (a p b ∧ b p a) ⇒ a = b

Examples: R= ∅ R≤ R<

Rp antisymmetric iff Rp ∩Rp−1 ⊆ R=

Note non-symmetric 6⇔ antisymmetric (e.g. R=)

Discrete Mathematics I – p. 133/292

Page 553: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is antisymmetric, if

∀a, b ∈ A : (a p b ∧ b p a) ⇒ a = b

Examples: R=

∅ R≤ R<

Rp antisymmetric iff Rp ∩Rp−1 ⊆ R=

Note non-symmetric 6⇔ antisymmetric (e.g. R=)

Discrete Mathematics I – p. 133/292

Page 554: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is antisymmetric, if

∀a, b ∈ A : (a p b ∧ b p a) ⇒ a = b

Examples: R= ∅

R≤ R<

Rp antisymmetric iff Rp ∩Rp−1 ⊆ R=

Note non-symmetric 6⇔ antisymmetric (e.g. R=)

Discrete Mathematics I – p. 133/292

Page 555: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is antisymmetric, if

∀a, b ∈ A : (a p b ∧ b p a) ⇒ a = b

Examples: R= ∅ R≤

R<

Rp antisymmetric iff Rp ∩Rp−1 ⊆ R=

Note non-symmetric 6⇔ antisymmetric (e.g. R=)

Discrete Mathematics I – p. 133/292

Page 556: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is antisymmetric, if

∀a, b ∈ A : (a p b ∧ b p a) ⇒ a = b

Examples: R= ∅ R≤ R<

Rp antisymmetric iff Rp ∩Rp−1 ⊆ R=

Note non-symmetric 6⇔ antisymmetric (e.g. R=)

Discrete Mathematics I – p. 133/292

Page 557: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is antisymmetric, if

∀a, b ∈ A : (a p b ∧ b p a) ⇒ a = b

Examples: R= ∅ R≤ R<

Rp antisymmetric iff Rp ∩Rp−1 ⊆ R=

Note non-symmetric 6⇔ antisymmetric (e.g. R=)

Discrete Mathematics I – p. 133/292

Page 558: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is antisymmetric, if

∀a, b ∈ A : (a p b ∧ b p a) ⇒ a = b

Examples: R= ∅ R≤ R<

Rp antisymmetric iff Rp ∩Rp−1 ⊆ R=

Note non-symmetric 6⇔ antisymmetric (e.g. R=)

Discrete Mathematics I – p. 133/292

Page 559: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is transitive, if

∀a, b, c ∈ A : (a p b ∧ b p c) ⇒ a p c

Examples: R= A2 ∅ R≤ R<

Rp transitive iff Rp ◦ p ⊆ Rp

Discrete Mathematics I – p. 134/292

Page 560: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is transitive, if

∀a, b, c ∈ A : (a p b ∧ b p c) ⇒ a p c

Examples: R=

A2 ∅ R≤ R<

Rp transitive iff Rp ◦ p ⊆ Rp

Discrete Mathematics I – p. 134/292

Page 561: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is transitive, if

∀a, b, c ∈ A : (a p b ∧ b p c) ⇒ a p c

Examples: R= A2

∅ R≤ R<

Rp transitive iff Rp ◦ p ⊆ Rp

Discrete Mathematics I – p. 134/292

Page 562: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is transitive, if

∀a, b, c ∈ A : (a p b ∧ b p c) ⇒ a p c

Examples: R= A2 ∅

R≤ R<

Rp transitive iff Rp ◦ p ⊆ Rp

Discrete Mathematics I – p. 134/292

Page 563: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is transitive, if

∀a, b, c ∈ A : (a p b ∧ b p c) ⇒ a p c

Examples: R= A2 ∅ R≤

R<

Rp transitive iff Rp ◦ p ⊆ Rp

Discrete Mathematics I – p. 134/292

Page 564: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is transitive, if

∀a, b, c ∈ A : (a p b ∧ b p c) ⇒ a p c

Examples: R= A2 ∅ R≤ R<

Rp transitive iff Rp ◦ p ⊆ Rp

Discrete Mathematics I – p. 134/292

Page 565: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation Rp : A ↔ A is transitive, if

∀a, b, c ∈ A : (a p b ∧ b p c) ⇒ a p c

Examples: R= A2 ∅ R≤ R<

Rp transitive iff Rp ◦ p ⊆ Rp

Discrete Mathematics I – p. 134/292

Page 566: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation R∼ : A ↔ A is an equivalence relation,if it is reflexive, symmetric and transitive

Relation R� : A ↔ A is a partial order,if it is reflexive, antisymmetric and transitive

Discrete Mathematics I – p. 135/292

Page 567: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation R∼ : A ↔ A is an equivalence relation,if it is reflexive, symmetric and transitive

Relation R� : A ↔ A is a partial order,if it is reflexive, antisymmetric and transitive

Discrete Mathematics I – p. 135/292

Page 568: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples of equivalence relations:

R=

Rp : People ↔ People

a p b ⇐⇒ a and b share a birthday

Discrete Mathematics I – p. 136/292

Page 569: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples of equivalence relations:

R=

Rp : People ↔ People

a p b ⇐⇒ a and b share a birthday

Discrete Mathematics I – p. 136/292

Page 570: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relations{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

R| : N ↔ Z a divides b

a | b ⇐⇒ ∃k ∈ Z : k · a = b

R≡n: Z ↔ Z a ≡n b ⇐⇒ n|(a− b)

R≡nis called congruence modulo n

Discrete Mathematics I – p. 137/292

Page 571: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relations{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

R| : N ↔ Z a divides b

a | b ⇐⇒ ∃k ∈ Z : k · a = b

R≡n: Z ↔ Z a ≡n b ⇐⇒ n|(a− b)

R≡nis called congruence modulo n

Discrete Mathematics I – p. 137/292

Page 572: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relations{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

R| : N ↔ Z a divides b

a | b ⇐⇒ ∃k ∈ Z : k · a = b

R≡n: Z ↔ Z a ≡n b ⇐⇒ n|(a− b)

R≡nis called congruence modulo n

Discrete Mathematics I – p. 137/292

Page 573: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relations{. . . ,−3,−2,−1, 0, 1, 2, 3, . . . } = Z integers

R| : N ↔ Z a divides b

a | b ⇐⇒ ∃k ∈ Z : k · a = b

R≡n: Z ↔ Z a ≡n b ⇐⇒ n|(a− b)

R≡nis called congruence modulo n

Discrete Mathematics I – p. 137/292

Page 574: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R≡n

is an equivalence for all n ∈ N, n ≥ 1.

Proof. Let n ∈ N, n ≥ 1.

Let x ∈ Z.

x ≡n x ⇐⇒ n | (x− x) ⇐⇒ n | 0 ⇐⇒∃k : k · n = 0 ⇐⇒ T (since 0 · n = 0)

Hence R≡nreflexive.

Discrete Mathematics I – p. 138/292

Page 575: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R≡n

is an equivalence for all n ∈ N, n ≥ 1.

Proof. Let n ∈ N, n ≥ 1.

Let x ∈ Z.

x ≡n x ⇐⇒ n | (x− x) ⇐⇒ n | 0 ⇐⇒∃k : k · n = 0 ⇐⇒ T (since 0 · n = 0)

Hence R≡nreflexive.

Discrete Mathematics I – p. 138/292

Page 576: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R≡n

is an equivalence for all n ∈ N, n ≥ 1.

Proof. Let n ∈ N, n ≥ 1.

Let x ∈ Z.

x ≡n x ⇐⇒ n | (x− x) ⇐⇒ n | 0 ⇐⇒∃k : k · n = 0 ⇐⇒ T (since 0 · n = 0)

Hence R≡nreflexive.

Discrete Mathematics I – p. 138/292

Page 577: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R≡n

is an equivalence for all n ∈ N, n ≥ 1.

Proof. Let n ∈ N, n ≥ 1.

Let x ∈ Z.

x ≡n x ⇐⇒ n | (x− x) ⇐⇒ n | 0 ⇐⇒∃k : k · n = 0 ⇐⇒ T (since 0 · n = 0)

Hence R≡nreflexive.

Discrete Mathematics I – p. 138/292

Page 578: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R≡n

is an equivalence for all n ∈ N, n ≥ 1.

Proof. Let n ∈ N, n ≥ 1.

Let x ∈ Z.

x ≡n x ⇐⇒ n | (x− x) ⇐⇒ n | 0 ⇐⇒∃k : k · n = 0 ⇐⇒ T (since 0 · n = 0)

Hence R≡nreflexive.

Discrete Mathematics I – p. 138/292

Page 579: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

(−k) · n = −(x− y) = y − x =⇒n | (y − x) =⇒ y ≡n x

Hence R≡nsymmetric.

Discrete Mathematics I – p. 139/292

Page 580: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

(−k) · n = −(x− y) = y − x =⇒n | (y − x) =⇒ y ≡n x

Hence R≡nsymmetric.

Discrete Mathematics I – p. 139/292

Page 581: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

(−k) · n = −(x− y) = y − x =⇒n | (y − x) =⇒ y ≡n x

Hence R≡nsymmetric.

Discrete Mathematics I – p. 139/292

Page 582: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

(−k) · n = −(x− y) = y − x =⇒n | (y − x) =⇒ y ≡n x

Hence R≡nsymmetric.

Discrete Mathematics I – p. 139/292

Page 583: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

y ≡n z =⇒ n | (y − z) =⇒ ∃l : l · n = y − z

(k + l) · n = (x− y) + (y − z) = x− z =⇒n | (x− z) =⇒ x ≡n z

Hence R≡ntransitive.

R≡nreflexive, symmetric and transitive, therefore

R≡nis an equivalence relation.

Discrete Mathematics I – p. 140/292

Page 584: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

y ≡n z =⇒ n | (y − z) =⇒ ∃l : l · n = y − z

(k + l) · n = (x− y) + (y − z) = x− z =⇒n | (x− z) =⇒ x ≡n z

Hence R≡ntransitive.

R≡nreflexive, symmetric and transitive, therefore

R≡nis an equivalence relation.

Discrete Mathematics I – p. 140/292

Page 585: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

y ≡n z =⇒ n | (y − z) =⇒ ∃l : l · n = y − z

(k + l) · n = (x− y) + (y − z) = x− z =⇒n | (x− z) =⇒ x ≡n z

Hence R≡ntransitive.

R≡nreflexive, symmetric and transitive, therefore

R≡nis an equivalence relation.

Discrete Mathematics I – p. 140/292

Page 586: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

y ≡n z =⇒ n | (y − z) =⇒ ∃l : l · n = y − z

(k + l) · n = (x− y) + (y − z) = x− z =⇒n | (x− z) =⇒ x ≡n z

Hence R≡ntransitive.

R≡nreflexive, symmetric and transitive, therefore

R≡nis an equivalence relation.

Discrete Mathematics I – p. 140/292

Page 587: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

y ≡n z =⇒ n | (y − z) =⇒ ∃l : l · n = y − z

(k + l) · n = (x− y) + (y − z) = x− z =⇒n | (x− z) =⇒ x ≡n z

Hence R≡ntransitive.

R≡nreflexive, symmetric and transitive, therefore

R≡nis an equivalence relation.

Discrete Mathematics I – p. 140/292

Page 588: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ Z.

x ≡n y =⇒ n | (x− y) =⇒ ∃k : k · n = x− y

y ≡n z =⇒ n | (y − z) =⇒ ∃l : l · n = y − z

(k + l) · n = (x− y) + (y − z) = x− z =⇒n | (x− z) =⇒ x ≡n z

Hence R≡ntransitive.

R≡nreflexive, symmetric and transitive, therefore

R≡nis an equivalence relation.

Discrete Mathematics I – p. 140/292

Page 589: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

For any a ∈ A, the equivalence class of a is the set ofall elements related to a

[a]∼ = {x ∈ A | x ∼ a}By reflexivity, a ∈ [a]∼

Every a is a representative of [a]∼

The set of all equivalence classes of R∼ is the quotientset of A with respect to R∼

A/R∼ = {[a]∼ | a ∈ A}

Discrete Mathematics I – p. 141/292

Page 590: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

For any a ∈ A, the equivalence class of a is the set ofall elements related to a

[a]∼ = {x ∈ A | x ∼ a}By reflexivity, a ∈ [a]∼

Every a is a representative of [a]∼

The set of all equivalence classes of R∼ is the quotientset of A with respect to R∼

A/R∼ = {[a]∼ | a ∈ A}

Discrete Mathematics I – p. 141/292

Page 591: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

For any a ∈ A, the equivalence class of a is the set ofall elements related to a

[a]∼ = {x ∈ A | x ∼ a}

By reflexivity, a ∈ [a]∼

Every a is a representative of [a]∼

The set of all equivalence classes of R∼ is the quotientset of A with respect to R∼

A/R∼ = {[a]∼ | a ∈ A}

Discrete Mathematics I – p. 141/292

Page 592: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

For any a ∈ A, the equivalence class of a is the set ofall elements related to a

[a]∼ = {x ∈ A | x ∼ a}By reflexivity, a ∈ [a]∼

Every a is a representative of [a]∼

The set of all equivalence classes of R∼ is the quotientset of A with respect to R∼

A/R∼ = {[a]∼ | a ∈ A}

Discrete Mathematics I – p. 141/292

Page 593: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

For any a ∈ A, the equivalence class of a is the set ofall elements related to a

[a]∼ = {x ∈ A | x ∼ a}By reflexivity, a ∈ [a]∼

Every a is a representative of [a]∼

The set of all equivalence classes of R∼ is the quotientset of A with respect to R∼

A/R∼ = {[a]∼ | a ∈ A}

Discrete Mathematics I – p. 141/292

Page 594: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

For any a ∈ A, the equivalence class of a is the set ofall elements related to a

[a]∼ = {x ∈ A | x ∼ a}By reflexivity, a ∈ [a]∼

Every a is a representative of [a]∼

The set of all equivalence classes of R∼ is the quotientset of A with respect to R∼

A/R∼ = {[a]∼ | a ∈ A}

Discrete Mathematics I – p. 141/292

Page 595: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

For any a ∈ A, the equivalence class of a is the set ofall elements related to a

[a]∼ = {x ∈ A | x ∼ a}By reflexivity, a ∈ [a]∼

Every a is a representative of [a]∼

The set of all equivalence classes of R∼ is the quotientset of A with respect to R∼

A/R∼ = {[a]∼ | a ∈ A}

Discrete Mathematics I – p. 141/292

Page 596: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExample:

Rp : People ↔ People

x p y ⇐⇒ x and y share a birthday

Size ofPeople/Rp = 366

∀x, y ∈ People : ([x]p = [y]p) ∨ ([x]p ∩ [y]p = ∅)

Discrete Mathematics I – p. 142/292

Page 597: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExample:

Rp : People ↔ People

x p y ⇐⇒ x and y share a birthday

Size ofPeople/Rp =

366

∀x, y ∈ People : ([x]p = [y]p) ∨ ([x]p ∩ [y]p = ∅)

Discrete Mathematics I – p. 142/292

Page 598: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExample:

Rp : People ↔ People

x p y ⇐⇒ x and y share a birthday

Size ofPeople/Rp = 366

∀x, y ∈ People : ([x]p = [y]p) ∨ ([x]p ∩ [y]p = ∅)

Discrete Mathematics I – p. 142/292

Page 599: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExample:

Rp : People ↔ People

x p y ⇐⇒ x and y share a birthday

Size ofPeople/Rp = 366

∀x, y ∈ People : ([x]p = [y]p) ∨ ([x]p ∩ [y]p = ∅)

Discrete Mathematics I – p. 142/292

Page 600: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet Fred, George ∈ People

Suppose Fred was born on 1 November

[Fred]p = {x ∈ People | x born on 1 November}Size of [Fred]p ≈ 6bln/365.25 ≈ 16mln

Suppose George was born on 29 February

[George]p = {x ∈ People | x born on 29 February}Size of [George]p ≈ 6bln/(4 ∗ 365.25) ≈ 4mln

Discrete Mathematics I – p. 143/292

Page 601: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet Fred, George ∈ People

Suppose Fred was born on 1 November

[Fred]p = {x ∈ People | x born on 1 November}

Size of [Fred]p ≈ 6bln/365.25 ≈ 16mln

Suppose George was born on 29 February

[George]p = {x ∈ People | x born on 29 February}Size of [George]p ≈ 6bln/(4 ∗ 365.25) ≈ 4mln

Discrete Mathematics I – p. 143/292

Page 602: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet Fred, George ∈ People

Suppose Fred was born on 1 November

[Fred]p = {x ∈ People | x born on 1 November}Size of [Fred]p ≈ 6bln/365.25 ≈ 16mln

Suppose George was born on 29 February

[George]p = {x ∈ People | x born on 29 February}Size of [George]p ≈ 6bln/(4 ∗ 365.25) ≈ 4mln

Discrete Mathematics I – p. 143/292

Page 603: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet Fred, George ∈ People

Suppose Fred was born on 1 November

[Fred]p = {x ∈ People | x born on 1 November}Size of [Fred]p ≈ 6bln/365.25 ≈ 16mln

Suppose George was born on 29 February

[George]p = {x ∈ People | x born on 29 February}Size of [George]p ≈ 6bln/(4 ∗ 365.25) ≈ 4mln

Discrete Mathematics I – p. 143/292

Page 604: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet Fred, George ∈ People

Suppose Fred was born on 1 November

[Fred]p = {x ∈ People | x born on 1 November}Size of [Fred]p ≈ 6bln/365.25 ≈ 16mln

Suppose George was born on 29 February

[George]p = {x ∈ People | x born on 29 February}

Size of [George]p ≈ 6bln/(4 ∗ 365.25) ≈ 4mln

Discrete Mathematics I – p. 143/292

Page 605: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet Fred, George ∈ People

Suppose Fred was born on 1 November

[Fred]p = {x ∈ People | x born on 1 November}Size of [Fred]p ≈ 6bln/365.25 ≈ 16mln

Suppose George was born on 29 February

[George]p = {x ∈ People | x born on 29 February}Size of [George]p ≈ 6bln/(4 ∗ 365.25) ≈ 4mln

Discrete Mathematics I – p. 143/292

Page 606: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsAnother example:

R≡5: Z ↔ Z a ≡5 b ⇐⇒ 5 | (a− b)

[0]≡5= {. . . ,−10,−5, 0, 5, 10, . . . }

[1]≡5= {. . . ,−9,−4, 1, 6, 11, . . . }

[2]≡5= {. . . ,−8,−3, 2, 7, 12, . . . }

[3]≡5= {. . . ,−7,−2, 3, 8, 13, . . . }

[4]≡5= {. . . ,−6,−1, 4, 9, 14, . . . }

[a]≡5called residue classes modulo 5 (can be any n)

Discrete Mathematics I – p. 144/292

Page 607: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsAnother example:

R≡5: Z ↔ Z a ≡5 b ⇐⇒ 5 | (a− b)

[0]≡5=

{. . . ,−10,−5, 0, 5, 10, . . . }[1]≡5

= {. . . ,−9,−4, 1, 6, 11, . . . }[2]≡5

= {. . . ,−8,−3, 2, 7, 12, . . . }[3]≡5

= {. . . ,−7,−2, 3, 8, 13, . . . }[4]≡5

= {. . . ,−6,−1, 4, 9, 14, . . . }[a]≡5

called residue classes modulo 5 (can be any n)

Discrete Mathematics I – p. 144/292

Page 608: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsAnother example:

R≡5: Z ↔ Z a ≡5 b ⇐⇒ 5 | (a− b)

[0]≡5= {. . . ,−10,−5, 0, 5, 10, . . . }

[1]≡5= {. . . ,−9,−4, 1, 6, 11, . . . }

[2]≡5= {. . . ,−8,−3, 2, 7, 12, . . . }

[3]≡5= {. . . ,−7,−2, 3, 8, 13, . . . }

[4]≡5= {. . . ,−6,−1, 4, 9, 14, . . . }

[a]≡5called residue classes modulo 5 (can be any n)

Discrete Mathematics I – p. 144/292

Page 609: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsAnother example:

R≡5: Z ↔ Z a ≡5 b ⇐⇒ 5 | (a− b)

[0]≡5= {. . . ,−10,−5, 0, 5, 10, . . . }

[1]≡5=

{. . . ,−9,−4, 1, 6, 11, . . . }[2]≡5

= {. . . ,−8,−3, 2, 7, 12, . . . }[3]≡5

= {. . . ,−7,−2, 3, 8, 13, . . . }[4]≡5

= {. . . ,−6,−1, 4, 9, 14, . . . }[a]≡5

called residue classes modulo 5 (can be any n)

Discrete Mathematics I – p. 144/292

Page 610: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsAnother example:

R≡5: Z ↔ Z a ≡5 b ⇐⇒ 5 | (a− b)

[0]≡5= {. . . ,−10,−5, 0, 5, 10, . . . }

[1]≡5= {. . . ,−9,−4, 1, 6, 11, . . . }

[2]≡5= {. . . ,−8,−3, 2, 7, 12, . . . }

[3]≡5= {. . . ,−7,−2, 3, 8, 13, . . . }

[4]≡5= {. . . ,−6,−1, 4, 9, 14, . . . }

[a]≡5called residue classes modulo 5 (can be any n)

Discrete Mathematics I – p. 144/292

Page 611: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsAnother example:

R≡5: Z ↔ Z a ≡5 b ⇐⇒ 5 | (a− b)

[0]≡5= {. . . ,−10,−5, 0, 5, 10, . . . }

[1]≡5= {. . . ,−9,−4, 1, 6, 11, . . . }

[2]≡5= {. . . ,−8,−3, 2, 7, 12, . . . }

[3]≡5= {. . . ,−7,−2, 3, 8, 13, . . . }

[4]≡5= {. . . ,−6,−1, 4, 9, 14, . . . }

[a]≡5called residue classes modulo 5 (can be any n)

Discrete Mathematics I – p. 144/292

Page 612: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsAnother example:

R≡5: Z ↔ Z a ≡5 b ⇐⇒ 5 | (a− b)

[0]≡5= {. . . ,−10,−5, 0, 5, 10, . . . }

[1]≡5= {. . . ,−9,−4, 1, 6, 11, . . . }

[2]≡5= {. . . ,−8,−3, 2, 7, 12, . . . }

[3]≡5= {. . . ,−7,−2, 3, 8, 13, . . . }

[4]≡5= {. . . ,−6,−1, 4, 9, 14, . . . }

[a]≡5called residue classes modulo 5 (can be any n)

Discrete Mathematics I – p. 144/292

Page 613: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsAnother example:

R≡5: Z ↔ Z a ≡5 b ⇐⇒ 5 | (a− b)

[0]≡5= {. . . ,−10,−5, 0, 5, 10, . . . }

[1]≡5= {. . . ,−9,−4, 1, 6, 11, . . . }

[2]≡5= {. . . ,−8,−3, 2, 7, 12, . . . }

[3]≡5= {. . . ,−7,−2, 3, 8, 13, . . . }

[4]≡5= {. . . ,−6,−1, 4, 9, 14, . . . }

[a]≡5called residue classes modulo 5 (can be any n)

Discrete Mathematics I – p. 144/292

Page 614: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsAnother example:

R≡5: Z ↔ Z a ≡5 b ⇐⇒ 5 | (a− b)

[0]≡5= {. . . ,−10,−5, 0, 5, 10, . . . }

[1]≡5= {. . . ,−9,−4, 1, 6, 11, . . . }

[2]≡5= {. . . ,−8,−3, 2, 7, 12, . . . }

[3]≡5= {. . . ,−7,−2, 3, 8, 13, . . . }

[4]≡5= {. . . ,−6,−1, 4, 9, 14, . . . }

[a]≡5called residue classes modulo 5 (can be any n)

Discrete Mathematics I – p. 144/292

Page 615: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

Theorem.

The equivalence classes of R∼ are pairwise disjoint.

∀a, b ∈ A : ([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)The union of all equivalence classes is the whole A.⋃

a∈A[a]∼ = A

A is partitioned by R∼ into a disjoint union ofequivalence classes

Discrete Mathematics I – p. 145/292

Page 616: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

Theorem.

The equivalence classes of R∼ are pairwise disjoint.

∀a, b ∈ A : ([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)

The union of all equivalence classes is the whole A.⋃

a∈A[a]∼ = A

A is partitioned by R∼ into a disjoint union ofequivalence classes

Discrete Mathematics I – p. 145/292

Page 617: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

Theorem.

The equivalence classes of R∼ are pairwise disjoint.

∀a, b ∈ A : ([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)The union of all equivalence classes is the whole A.⋃

a∈A[a]∼ = A

A is partitioned by R∼ into a disjoint union ofequivalence classes

Discrete Mathematics I – p. 145/292

Page 618: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR∼ : A ↔ A — an equivalence relation

Theorem.

The equivalence classes of R∼ are pairwise disjoint.

∀a, b ∈ A : ([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)The union of all equivalence classes is the whole A.⋃

a∈A[a]∼ = A

A is partitioned by R∼ into a disjoint union ofequivalence classes

Discrete Mathematics I – p. 145/292

Page 619: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProof. For all a, b, we need:

([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)

Consider two cases: a ∼ b, a 6∼ b.

Discrete Mathematics I – p. 146/292

Page 620: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProof. For all a, b, we need:

([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)Consider two cases: a ∼ b, a 6∼ b.

Discrete Mathematics I – p. 146/292

Page 621: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a ∼ b. Take any x ∈ [a]∼.

(x ∼ a) ∧ (a ∼ b) =⇒ x ∼ b =⇒ x ∈ [b]∼

Hence [a]∼ ⊆ [b]∼. Similarly [b]∼ ⊆ [a]∼.

Therefore [a]∼ = [b]∼.

Discrete Mathematics I – p. 147/292

Page 622: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a ∼ b. Take any x ∈ [a]∼.

(x ∼ a) ∧ (a ∼ b) =⇒ x ∼ b =⇒ x ∈ [b]∼

Hence [a]∼ ⊆ [b]∼. Similarly [b]∼ ⊆ [a]∼.

Therefore [a]∼ = [b]∼.

Discrete Mathematics I – p. 147/292

Page 623: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a ∼ b. Take any x ∈ [a]∼.

(x ∼ a) ∧ (a ∼ b) =⇒ x ∼ b =⇒ x ∈ [b]∼

Hence [a]∼ ⊆ [b]∼. Similarly [b]∼ ⊆ [a]∼.

Therefore [a]∼ = [b]∼.

Discrete Mathematics I – p. 147/292

Page 624: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a ∼ b. Take any x ∈ [a]∼.

(x ∼ a) ∧ (a ∼ b) =⇒ x ∼ b =⇒ x ∈ [b]∼

Hence [a]∼ ⊆ [b]∼. Similarly [b]∼ ⊆ [a]∼.

Therefore [a]∼ = [b]∼.

Discrete Mathematics I – p. 147/292

Page 625: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a 6∼ b. Suppose ∃x : x ∈ [a]∼ ∩ [b]∼.

(x ∼ a) ∧ (x ∼ b) =⇒ a ∼ b — contradiction.

Therefore [a]∼ ∩ [b]∼ = ∅.

Discrete Mathematics I – p. 148/292

Page 626: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a 6∼ b. Suppose ∃x : x ∈ [a]∼ ∩ [b]∼.

(x ∼ a) ∧ (x ∼ b) =⇒ a ∼ b — contradiction.

Therefore [a]∼ ∩ [b]∼ = ∅.

Discrete Mathematics I – p. 148/292

Page 627: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a 6∼ b. Suppose ∃x : x ∈ [a]∼ ∩ [b]∼.

(x ∼ a) ∧ (x ∼ b) =⇒ a ∼ b — contradiction.

Therefore [a]∼ ∩ [b]∼ = ∅.

Discrete Mathematics I – p. 148/292

Page 628: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a ∼ b =⇒ [a]∼ = [b]∼

Case a 6∼ b =⇒ [a]∼ ∩ [b]∼ = ∅

Therefore ([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)Finally, for all a ∈ A: a ∼ a =⇒ a ∈ [a]∼ ⊆ A.

Hence A ⊆ ⋃

a∈A[a]∼ ⊆ A.

Therefore⋃

a∈A[a]∼ = A.

Discrete Mathematics I – p. 149/292

Page 629: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a ∼ b =⇒ [a]∼ = [b]∼

Case a 6∼ b =⇒ [a]∼ ∩ [b]∼ = ∅Therefore ([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)

Finally, for all a ∈ A: a ∼ a =⇒ a ∈ [a]∼ ⊆ A.

Hence A ⊆ ⋃

a∈A[a]∼ ⊆ A.

Therefore⋃

a∈A[a]∼ = A.

Discrete Mathematics I – p. 149/292

Page 630: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a ∼ b =⇒ [a]∼ = [b]∼

Case a 6∼ b =⇒ [a]∼ ∩ [b]∼ = ∅Therefore ([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)

Finally, for all a ∈ A: a ∼ a =⇒ a ∈ [a]∼ ⊆ A.

Hence A ⊆ ⋃

a∈A[a]∼ ⊆ A.

Therefore⋃

a∈A[a]∼ = A.

Discrete Mathematics I – p. 149/292

Page 631: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a ∼ b =⇒ [a]∼ = [b]∼

Case a 6∼ b =⇒ [a]∼ ∩ [b]∼ = ∅Therefore ([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)

Finally, for all a ∈ A: a ∼ a =⇒ a ∈ [a]∼ ⊆ A.

Hence A ⊆ ⋃

a∈A[a]∼ ⊆ A.

Therefore⋃

a∈A[a]∼ = A.

Discrete Mathematics I – p. 149/292

Page 632: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsCase a ∼ b =⇒ [a]∼ = [b]∼

Case a 6∼ b =⇒ [a]∼ ∩ [b]∼ = ∅Therefore ([a]∼ = [b]∼) ∨ ([a]∼ ∩ [b]∼ = ∅)

Finally, for all a ∈ A: a ∼ a =⇒ a ∈ [a]∼ ⊆ A.

Hence A ⊆ ⋃

a∈A[a]∼ ⊆ A.

Therefore⋃

a∈A[a]∼ = A.

Discrete Mathematics I – p. 149/292

Page 633: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsIf A finite, A/R∼ finite

If A has n elements, and if every [a]∼ has m elements,then m | n, and A/R∼ has n/m elements

If A infinite, A/R∼ can be finite or infinite

Discrete Mathematics I – p. 150/292

Page 634: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsIf A finite, A/R∼ finite

If A has n elements, and if every [a]∼ has m elements,then m | n, and A/R∼ has n/m elements

If A infinite, A/R∼ can be finite or infinite

Discrete Mathematics I – p. 150/292

Page 635: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsIf A finite, A/R∼ finite

If A has n elements, and if every [a]∼ has m elements,then m | n, and A/R∼ has n/m elements

If A infinite, A/R∼ can be finite or infinite

Discrete Mathematics I – p. 150/292

Page 636: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation R∼ : A ↔ A is an equivalence relation,if it is reflexive, symmetric and transitive

Relation R� : A ↔ A is a partial order,if it is reflexive, antisymmetric and transitive

Set A is partially ordered

Discrete Mathematics I – p. 151/292

Page 637: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRelation R∼ : A ↔ A is an equivalence relation,if it is reflexive, symmetric and transitive

Relation R� : A ↔ A is a partial order,if it is reflexive, antisymmetric and transitive

Set A is partially ordered

Discrete Mathematics I – p. 151/292

Page 638: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R≤, R≥ : N ↔ N

Hasse diagram (illustration only):

0

1

2

3

4

R≤

0

1

2

3

4

R≥

Discrete Mathematics I – p. 152/292

Page 639: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R≤, R≥ : N ↔ N

Hasse diagram (illustration only):

��

��

0

1

2

3

4

R≤

0

1

2

3

4

R≥

Discrete Mathematics I – p. 152/292

Page 640: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R≤, R≥ : N ↔ N

Hasse diagram (illustration only):

��

��

0

1

2

3

4

R≤

��

��

0

1

2

3

4

R≥

Discrete Mathematics I – p. 152/292

Page 641: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRE : People ↔ People

xE y ⇐⇒ x is an descendant of y

(Everyone is his/her own descendant)

Lamech Bitenosh

Noah Naamah

Shem Ham Japheth

Discrete Mathematics I – p. 153/292

Page 642: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRE : People ↔ People

xE y ⇐⇒ x is an descendant of y

(Everyone is his/her own descendant)

Lamech Bitenosh

Noah Naamah

Shem Ham Japheth

Discrete Mathematics I – p. 153/292

Page 643: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRE : People ↔ People

xE y ⇐⇒ x is an descendant of y

(Everyone is his/her own descendant)

Lamech

Bitenosh

�Noah � Naamah

Shem

Ham

Japheth

Discrete Mathematics I – p. 153/292

Page 644: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N ↔ N x | y ⇐⇒ ∃k : k · x = y

1

2 3 5 7

4 6 9

810

0

Discrete Mathematics I – p. 154/292

Page 645: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N ↔ N x | y ⇐⇒ ∃k : k · x = y

1�2 �3 � 5 � 7

4

6�

9

8

10

0

Discrete Mathematics I – p. 154/292

Page 646: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R| is a partial order.

Proof. Let x ∈ N.

x | x ⇐⇒ ∃k : k · x = x ⇐⇒ T (since 1 · x = x)

Hence R| reflexive.

Let x, y ∈ N.

x | y =⇒ ∃k : k · x = y

y | x =⇒ ∃l : l · y = x

x = l · y = k · l · x =⇒ k · l = 1 =⇒k = l = 1 =⇒ x = y

Hence R| antisymmetric.

Discrete Mathematics I – p. 155/292

Page 647: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R| is a partial order.

Proof. Let x ∈ N.

x | x ⇐⇒ ∃k : k · x = x ⇐⇒ T (since 1 · x = x)

Hence R| reflexive.

Let x, y ∈ N.

x | y =⇒ ∃k : k · x = y

y | x =⇒ ∃l : l · y = x

x = l · y = k · l · x =⇒ k · l = 1 =⇒k = l = 1 =⇒ x = y

Hence R| antisymmetric.

Discrete Mathematics I – p. 155/292

Page 648: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R| is a partial order.

Proof. Let x ∈ N.

x | x ⇐⇒ ∃k : k · x = x ⇐⇒ T (since 1 · x = x)

Hence R| reflexive.

Let x, y ∈ N.

x | y =⇒ ∃k : k · x = y

y | x =⇒ ∃l : l · y = x

x = l · y = k · l · x =⇒ k · l = 1 =⇒k = l = 1 =⇒ x = y

Hence R| antisymmetric.

Discrete Mathematics I – p. 155/292

Page 649: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R| is a partial order.

Proof. Let x ∈ N.

x | x ⇐⇒ ∃k : k · x = x ⇐⇒ T (since 1 · x = x)

Hence R| reflexive.

Let x, y ∈ N.

x | y =⇒ ∃k : k · x = y

y | x =⇒ ∃l : l · y = x

x = l · y = k · l · x =⇒ k · l = 1 =⇒k = l = 1 =⇒ x = y

Hence R| antisymmetric.

Discrete Mathematics I – p. 155/292

Page 650: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R| is a partial order.

Proof. Let x ∈ N.

x | x ⇐⇒ ∃k : k · x = x ⇐⇒ T (since 1 · x = x)

Hence R| reflexive.

Let x, y ∈ N.

x | y =⇒ ∃k : k · x = y

y | x =⇒ ∃l : l · y = x

x = l · y = k · l · x =⇒ k · l = 1 =⇒k = l = 1 =⇒ x = y

Hence R| antisymmetric.

Discrete Mathematics I – p. 155/292

Page 651: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R| is a partial order.

Proof. Let x ∈ N.

x | x ⇐⇒ ∃k : k · x = x ⇐⇒ T (since 1 · x = x)

Hence R| reflexive.

Let x, y ∈ N.

x | y =⇒ ∃k : k · x = y

y | x =⇒ ∃l : l · y = x

x = l · y = k · l · x =⇒ k · l = 1 =⇒k = l = 1 =⇒ x = y

Hence R| antisymmetric.

Discrete Mathematics I – p. 155/292

Page 652: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R| is a partial order.

Proof. Let x ∈ N.

x | x ⇐⇒ ∃k : k · x = x ⇐⇒ T (since 1 · x = x)

Hence R| reflexive.

Let x, y ∈ N.

x | y =⇒ ∃k : k · x = y

y | x =⇒ ∃l : l · y = x

x = l · y = k · l · x =⇒ k · l = 1 =⇒k = l = 1 =⇒ x = y

Hence R| antisymmetric.

Discrete Mathematics I – p. 155/292

Page 653: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R| is a partial order.

Proof. Let x ∈ N.

x | x ⇐⇒ ∃k : k · x = x ⇐⇒ T (since 1 · x = x)

Hence R| reflexive.

Let x, y ∈ N.

x | y =⇒ ∃k : k · x = y

y | x =⇒ ∃l : l · y = x

x = l · y = k · l · x =⇒ k · l = 1 =⇒k = l = 1 =⇒ x = y

Hence R| antisymmetric.

Discrete Mathematics I – p. 155/292

Page 654: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsProve: R| is a partial order.

Proof. Let x ∈ N.

x | x ⇐⇒ ∃k : k · x = x ⇐⇒ T (since 1 · x = x)

Hence R| reflexive.

Let x, y ∈ N.

x | y =⇒ ∃k : k · x = y

y | x =⇒ ∃l : l · y = x

x = l · y = k · l · x =⇒ k · l = 1 =⇒k = l = 1 =⇒ x = y

Hence R| antisymmetric.Discrete Mathematics I – p. 155/292

Page 655: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ N.

x | y =⇒ ∃k : k · x = y

y | z =⇒ ∃l : l · y = z

z = l · y = (k · l) · x =⇒ x | zHence R| transitive.

R| reflexive, antisymmetric and transitive, thereforeR| is a partial order.

Discrete Mathematics I – p. 156/292

Page 656: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ N.

x | y =⇒ ∃k : k · x = y

y | z =⇒ ∃l : l · y = z

z = l · y = (k · l) · x =⇒ x | zHence R| transitive.

R| reflexive, antisymmetric and transitive, thereforeR| is a partial order.

Discrete Mathematics I – p. 156/292

Page 657: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ N.

x | y =⇒ ∃k : k · x = y

y | z =⇒ ∃l : l · y = z

z = l · y = (k · l) · x =⇒ x | zHence R| transitive.

R| reflexive, antisymmetric and transitive, thereforeR| is a partial order.

Discrete Mathematics I – p. 156/292

Page 658: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ N.

x | y =⇒ ∃k : k · x = y

y | z =⇒ ∃l : l · y = z

z = l · y = (k · l) · x =⇒ x | z

Hence R| transitive.

R| reflexive, antisymmetric and transitive, thereforeR| is a partial order.

Discrete Mathematics I – p. 156/292

Page 659: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ N.

x | y =⇒ ∃k : k · x = y

y | z =⇒ ∃l : l · y = z

z = l · y = (k · l) · x =⇒ x | zHence R| transitive.

R| reflexive, antisymmetric and transitive, thereforeR| is a partial order.

Discrete Mathematics I – p. 156/292

Page 660: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsLet x, y, z ∈ N.

x | y =⇒ ∃k : k · x = y

y | z =⇒ ∃l : l · y = z

z = l · y = (k · l) · x =⇒ x | zHence R| transitive.

R| reflexive, antisymmetric and transitive, thereforeR| is a partial order.

Discrete Mathematics I – p. 156/292

Page 661: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S) A ⊆ B

S = {0, 1, 2}

01

2

1202

01

012

Discrete Mathematics I – p. 157/292

Page 662: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S) A ⊆ B

S = {0, 1, 2}

01

2

1202

01

012

Discrete Mathematics I – p. 157/292

Page 663: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S) A ⊆ B

S = {0, 1, 2}

�0 �

1

� 2�12 �

02

� 01�

012

Discrete Mathematics I – p. 157/292

Page 664: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

R� is called a total order, if for all a, b ∈ A,either a � b or b � a

Set A is called totally ordered

Discrete Mathematics I – p. 158/292

Page 665: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

R� is called a total order, if for all a, b ∈ A,either a � b or b � a

Set A is called totally ordered

Discrete Mathematics I – p. 158/292

Page 666: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R≤ R≥ — total (but still a partial order!)

RE R| R⊆ — not total

Discrete Mathematics I – p. 159/292

Page 667: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R≤ R≥ — total (but still a partial order!)

RE R| R⊆ — not total

Discrete Mathematics I – p. 159/292

Page 668: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order (need not be total)

a ∈ A

c ∈ A is an upper bound of a, if a � c

d ∈ A is a lower bound of a, if d � a

Discrete Mathematics I – p. 160/292

Page 669: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order (need not be total)

a ∈ A

c ∈ A is an upper bound of a, if a � c

d ∈ A is a lower bound of a, if d � a

Discrete Mathematics I – p. 160/292

Page 670: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order (need not be total)

a ∈ A

c ∈ A is an upper bound of a, if a � c

d ∈ A is a lower bound of a, if d � a

Discrete Mathematics I – p. 160/292

Page 671: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

c ∈ A is an upper bound of a, b, if (a � c) ∧ (b � c)

d ∈ A is a lower bound of a, b, if (d � a) ∧ (d � b)

Discrete Mathematics I – p. 161/292

Page 672: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

c ∈ A is an upper bound of a, b, if (a � c) ∧ (b � c)

d ∈ A is a lower bound of a, b, if (d � a) ∧ (d � b)

Discrete Mathematics I – p. 161/292

Page 673: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

c ∈ A is the least upper bound of a, b, if

• c is an upper bound of a, b

• for all x ∈ A, (a � x) ∧ (b � x) ⇒ (c � x)

c = lub(a, b) (may not exist!)

Discrete Mathematics I – p. 162/292

Page 674: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

c ∈ A is the least upper bound of a, b, if

• c is an upper bound of a, b

• for all x ∈ A, (a � x) ∧ (b � x) ⇒ (c � x)

c = lub(a, b) (may not exist!)

Discrete Mathematics I – p. 162/292

Page 675: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

c ∈ A is the least upper bound of a, b, if

• c is an upper bound of a, b

• for all x ∈ A, (a � x) ∧ (b � x) ⇒ (c � x)

c = lub(a, b) (may not exist!)

Discrete Mathematics I – p. 162/292

Page 676: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

c ∈ A is the least upper bound of a, b, if

• c is an upper bound of a, b

• for all x ∈ A, (a � x) ∧ (b � x) ⇒ (c � x)

c = lub(a, b) (may not exist!)

Discrete Mathematics I – p. 162/292

Page 677: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

c ∈ A is the least upper bound of a, b, if

• c is an upper bound of a, b

• for all x ∈ A, (a � x) ∧ (b � x) ⇒ (c � x)

c = lub(a, b) (may not exist!)

Discrete Mathematics I – p. 162/292

Page 678: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

d ∈ A is the greatest lower bound of a, b, if

• d is a lower bound of a, b

• for all x ∈ A, (x � a) ∧ (x � b) ⇒ (x � d)

d = glb(a, b) (may not exist!)

Discrete Mathematics I – p. 163/292

Page 679: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

d ∈ A is the greatest lower bound of a, b, if

• d is a lower bound of a, b

• for all x ∈ A, (x � a) ∧ (x � b) ⇒ (x � d)

d = glb(a, b) (may not exist!)

Discrete Mathematics I – p. 163/292

Page 680: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

d ∈ A is the greatest lower bound of a, b, if

• d is a lower bound of a, b

• for all x ∈ A, (x � a) ∧ (x � b) ⇒ (x � d)

d = glb(a, b) (may not exist!)

Discrete Mathematics I – p. 163/292

Page 681: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

d ∈ A is the greatest lower bound of a, b, if

• d is a lower bound of a, b

• for all x ∈ A, (x � a) ∧ (x � b) ⇒ (x � d)

d = glb(a, b) (may not exist!)

Discrete Mathematics I – p. 163/292

Page 682: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Relationsa, b ∈ A

d ∈ A is the greatest lower bound of a, b, if

• d is a lower bound of a, b

• for all x ∈ A, (x � a) ∧ (x � b) ⇒ (x � d)

d = glb(a, b) (may not exist!)

Discrete Mathematics I – p. 163/292

Page 683: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExample:

RE : People ↔ PeoplexE y ⇐⇒ x is a descendant of y

lub(x, y) = youngest common ancestor(x, y)

glb(x, y) = oldest common descendant(x, y)

May not exist, e.g. if x, y are not relatives

Discrete Mathematics I – p. 164/292

Page 684: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExample:

RE : People ↔ PeoplexE y ⇐⇒ x is a descendant of y

lub(x, y) = youngest common ancestor(x, y)

glb(x, y) = oldest common descendant(x, y)

May not exist, e.g. if x, y are not relatives

Discrete Mathematics I – p. 164/292

Page 685: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExample:

RE : People ↔ PeoplexE y ⇐⇒ x is a descendant of y

lub(x, y) = youngest common ancestor(x, y)

glb(x, y) = oldest common descendant(x, y)

May not exist, e.g. if x, y are not relatives

Discrete Mathematics I – p. 164/292

Page 686: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExample:

RE : People ↔ PeoplexE y ⇐⇒ x is a descendant of y

lub(x, y) = youngest common ancestor(x, y)

glb(x, y) = oldest common descendant(x, y)

May not exist, e.g. if x, y are not relatives

Discrete Mathematics I – p. 164/292

Page 687: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N ↔ N x | y ⇐⇒ x divides y

lub(a, b) = least common multiple(a, b)always exists

glb(a, b) = greatest common divisor(a, b)always exists

Discrete Mathematics I – p. 165/292

Page 688: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N ↔ N x | y ⇐⇒ x divides y

lub(a, b) =

least common multiple(a, b)always exists

glb(a, b) = greatest common divisor(a, b)always exists

Discrete Mathematics I – p. 165/292

Page 689: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N ↔ N x | y ⇐⇒ x divides y

lub(a, b) = least common multiple(a, b)

always exists

glb(a, b) = greatest common divisor(a, b)always exists

Discrete Mathematics I – p. 165/292

Page 690: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N ↔ N x | y ⇐⇒ x divides y

lub(a, b) = least common multiple(a, b)always exists

glb(a, b) = greatest common divisor(a, b)always exists

Discrete Mathematics I – p. 165/292

Page 691: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N ↔ N x | y ⇐⇒ x divides y

lub(a, b) = least common multiple(a, b)always exists

glb(a, b) =

greatest common divisor(a, b)always exists

Discrete Mathematics I – p. 165/292

Page 692: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N ↔ N x | y ⇐⇒ x divides y

lub(a, b) = least common multiple(a, b)always exists

glb(a, b) = greatest common divisor(a, b)

always exists

Discrete Mathematics I – p. 165/292

Page 693: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N ↔ N x | y ⇐⇒ x divides y

lub(a, b) = least common multiple(a, b)always exists

glb(a, b) = greatest common divisor(a, b)always exists

Discrete Mathematics I – p. 165/292

Page 694: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR≤ : N ↔ N

lub(a, b) = max(a, b) always exists

glb(a, b) = min(a, b) always exists

{lub(a, b), glb(a, b)} = {a, b}Same holds for any total order

Discrete Mathematics I – p. 166/292

Page 695: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR≤ : N ↔ N

lub(a, b) =

max(a, b) always exists

glb(a, b) = min(a, b) always exists

{lub(a, b), glb(a, b)} = {a, b}Same holds for any total order

Discrete Mathematics I – p. 166/292

Page 696: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR≤ : N ↔ N

lub(a, b) = max(a, b)

always exists

glb(a, b) = min(a, b) always exists

{lub(a, b), glb(a, b)} = {a, b}Same holds for any total order

Discrete Mathematics I – p. 166/292

Page 697: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR≤ : N ↔ N

lub(a, b) = max(a, b) always exists

glb(a, b) = min(a, b) always exists

{lub(a, b), glb(a, b)} = {a, b}Same holds for any total order

Discrete Mathematics I – p. 166/292

Page 698: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR≤ : N ↔ N

lub(a, b) = max(a, b) always exists

glb(a, b) =

min(a, b) always exists

{lub(a, b), glb(a, b)} = {a, b}Same holds for any total order

Discrete Mathematics I – p. 166/292

Page 699: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR≤ : N ↔ N

lub(a, b) = max(a, b) always exists

glb(a, b) = min(a, b)

always exists

{lub(a, b), glb(a, b)} = {a, b}Same holds for any total order

Discrete Mathematics I – p. 166/292

Page 700: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR≤ : N ↔ N

lub(a, b) = max(a, b) always exists

glb(a, b) = min(a, b) always exists

{lub(a, b), glb(a, b)} = {a, b}Same holds for any total order

Discrete Mathematics I – p. 166/292

Page 701: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR≤ : N ↔ N

lub(a, b) = max(a, b) always exists

glb(a, b) = min(a, b) always exists

{lub(a, b), glb(a, b)} = {a, b}

Same holds for any total order

Discrete Mathematics I – p. 166/292

Page 702: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR≤ : N ↔ N

lub(a, b) = max(a, b) always exists

glb(a, b) = min(a, b) always exists

{lub(a, b), glb(a, b)} = {a, b}Same holds for any total order

Discrete Mathematics I – p. 166/292

Page 703: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S)

lub(A, B) = A ∪B always exists

glb(A, B) = A ∩B always exists

Discrete Mathematics I – p. 167/292

Page 704: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S)

lub(A, B) =

A ∪B always exists

glb(A, B) = A ∩B always exists

Discrete Mathematics I – p. 167/292

Page 705: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S)

lub(A, B) = A ∪B

always exists

glb(A, B) = A ∩B always exists

Discrete Mathematics I – p. 167/292

Page 706: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S)

lub(A, B) = A ∪B always exists

glb(A, B) = A ∩B always exists

Discrete Mathematics I – p. 167/292

Page 707: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S)

lub(A, B) = A ∪B always exists

glb(A, B) =

A ∩B always exists

Discrete Mathematics I – p. 167/292

Page 708: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S)

lub(A, B) = A ∪B always exists

glb(A, B) = A ∩B

always exists

Discrete Mathematics I – p. 167/292

Page 709: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) ↔ P(S)

lub(A, B) = A ∪B always exists

glb(A, B) = A ∩B always exists

Discrete Mathematics I – p. 167/292

Page 710: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

R� is called a lattice, if for all a, b ∈ A,lub(a, b) and glb(a, b) exist

(Sometimes A itself called a lattice)

Discrete Mathematics I – p. 168/292

Page 711: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

R� is called a lattice, if for all a, b ∈ A,lub(a, b) and glb(a, b) exist

(Sometimes A itself called a lattice)

Discrete Mathematics I – p. 168/292

Page 712: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

R� is called a lattice, if for all a, b ∈ A,lub(a, b) and glb(a, b) exist

(Sometimes A itself called a lattice)

Discrete Mathematics I – p. 168/292

Page 713: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

any total order (e.g. R≤, R≥)

R| R⊆ for any S

Discrete Mathematics I – p. 169/292

Page 714: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

any total order (e.g. R≤, R≥)

R|

R⊆ for any S

Discrete Mathematics I – p. 169/292

Page 715: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

any total order (e.g. R≤, R≥)

R| R⊆ for any S

Discrete Mathematics I – p. 169/292

Page 716: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

a ∈ A is maximal: ∀x ∈ A : (a � x) ⇒ (a = x)

b ∈ A is minimal: ∀x ∈ A : (x � b) ⇒ (b = x)

Can have many maximal/minimal elements

a ∈ A is the greatest: ∀x ∈ A : x � a

b ∈ A is the least: ∀x ∈ A : b � x

Can have at most one greatest/least element

Discrete Mathematics I – p. 170/292

Page 717: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

a ∈ A is maximal: ∀x ∈ A : (a � x) ⇒ (a = x)

b ∈ A is minimal: ∀x ∈ A : (x � b) ⇒ (b = x)

Can have many maximal/minimal elements

a ∈ A is the greatest: ∀x ∈ A : x � a

b ∈ A is the least: ∀x ∈ A : b � x

Can have at most one greatest/least element

Discrete Mathematics I – p. 170/292

Page 718: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

a ∈ A is maximal: ∀x ∈ A : (a � x) ⇒ (a = x)

b ∈ A is minimal: ∀x ∈ A : (x � b) ⇒ (b = x)

Can have many maximal/minimal elements

a ∈ A is the greatest: ∀x ∈ A : x � a

b ∈ A is the least: ∀x ∈ A : b � x

Can have at most one greatest/least element

Discrete Mathematics I – p. 170/292

Page 719: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

a ∈ A is maximal: ∀x ∈ A : (a � x) ⇒ (a = x)

b ∈ A is minimal: ∀x ∈ A : (x � b) ⇒ (b = x)

Can have many maximal/minimal elements

a ∈ A is the greatest: ∀x ∈ A : x � a

b ∈ A is the least: ∀x ∈ A : b � x

Can have at most one greatest/least element

Discrete Mathematics I – p. 170/292

Page 720: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR� : A ↔ A — a partial order

a ∈ A is maximal: ∀x ∈ A : (a � x) ⇒ (a = x)

b ∈ A is minimal: ∀x ∈ A : (x � b) ⇒ (b = x)

Can have many maximal/minimal elements

a ∈ A is the greatest: ∀x ∈ A : x � a

b ∈ A is the least: ∀x ∈ A : b � x

Can have at most one greatest/least element

Discrete Mathematics I – p. 170/292

Page 721: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S)

∅ least S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 722: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least

S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 723: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 724: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N

0 least no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 725: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N 0 least

no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 726: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 727: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N

no least 0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 728: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N no least

0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 729: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 730: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N

1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 731: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N 1 least

0 greatest

Discrete Mathematics I – p. 171/292

Page 732: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsExamples:

R⊆ : P(S) ↔ P(S) ∅ least S greatest

R≤ : N ↔ N 0 least no greatest

R≥ : N ↔ N no least 0 greatest

R| : N ↔ N 1 least 0 greatest

Discrete Mathematics I – p. 171/292

Page 733: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRE : People ↔ People

xE y ⇐⇒ x is a descendant of y

minimal elements: childless people

no least elements

no maximal elements (Adam and Eve? GE?)

no greatest elements

Discrete Mathematics I – p. 172/292

Page 734: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRE : People ↔ People

xE y ⇐⇒ x is a descendant of y

minimal elements: childless people

no least elements

no maximal elements (Adam and Eve? GE?)

no greatest elements

Discrete Mathematics I – p. 172/292

Page 735: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRE : People ↔ People

xE y ⇐⇒ x is a descendant of y

minimal elements: childless people

no least elements

no maximal elements (Adam and Eve? GE?)

no greatest elements

Discrete Mathematics I – p. 172/292

Page 736: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRE : People ↔ People

xE y ⇐⇒ x is a descendant of y

minimal elements: childless people

no least elements

no maximal elements (Adam and Eve? GE?)

no greatest elements

Discrete Mathematics I – p. 172/292

Page 737: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsRE : People ↔ People

xE y ⇐⇒ x is a descendant of y

minimal elements: childless people

no least elements

no maximal elements (Adam and Eve? GE?)

no greatest elements

Discrete Mathematics I – p. 172/292

Page 738: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N \ {0, 1} ↔ N \ {0, 1}

minimal elements: prime numbers

no least elements

no maximal ⇒ no greatest

Discrete Mathematics I – p. 173/292

Page 739: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N \ {0, 1} ↔ N \ {0, 1}minimal elements: prime numbers

no least elements

no maximal ⇒ no greatest

Discrete Mathematics I – p. 173/292

Page 740: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N \ {0, 1} ↔ N \ {0, 1}minimal elements: prime numbers

no least elements

no maximal ⇒ no greatest

Discrete Mathematics I – p. 173/292

Page 741: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR| : N \ {0, 1} ↔ N \ {0, 1}minimal elements: prime numbers

no least elements

no maximal ⇒ no greatest

Discrete Mathematics I – p. 173/292

Page 742: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) \ {∅, S} ↔ P(S) \ {∅, S}

minimal elements: singletons

no least elements

maximal elements: singleton complements

no greatest elements

Discrete Mathematics I – p. 174/292

Page 743: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) \ {∅, S} ↔ P(S) \ {∅, S}minimal elements: singletons

no least elements

maximal elements: singleton complements

no greatest elements

Discrete Mathematics I – p. 174/292

Page 744: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) \ {∅, S} ↔ P(S) \ {∅, S}minimal elements: singletons

no least elements

maximal elements: singleton complements

no greatest elements

Discrete Mathematics I – p. 174/292

Page 745: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) \ {∅, S} ↔ P(S) \ {∅, S}minimal elements: singletons

no least elements

maximal elements: singleton complements

no greatest elements

Discrete Mathematics I – p. 174/292

Page 746: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsR⊆ : P(S) \ {∅, S} ↔ P(S) \ {∅, S}minimal elements: singletons

no least elements

maximal elements: singleton complements

no greatest elements

Discrete Mathematics I – p. 174/292

Page 747: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsA partially ordered set may have no greatest or leastelement (even if the set is finite)

A finite, totally ordered set must have the greatest andthe least elements

A finite, partially ordered set must have maximal andminimal elements (but may not have the greatest andthe least)

A maximal or minimal element may not be unique

If a greatest or least element exists, it is unique

Discrete Mathematics I – p. 175/292

Page 748: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsA partially ordered set may have no greatest or leastelement (even if the set is finite)

A finite, totally ordered set must have the greatest andthe least elements

A finite, partially ordered set must have maximal andminimal elements (but may not have the greatest andthe least)

A maximal or minimal element may not be unique

If a greatest or least element exists, it is unique

Discrete Mathematics I – p. 175/292

Page 749: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsA partially ordered set may have no greatest or leastelement (even if the set is finite)

A finite, totally ordered set must have the greatest andthe least elements

A finite, partially ordered set must have maximal andminimal elements (but may not have the greatest andthe least)

A maximal or minimal element may not be unique

If a greatest or least element exists, it is unique

Discrete Mathematics I – p. 175/292

Page 750: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsA partially ordered set may have no greatest or leastelement (even if the set is finite)

A finite, totally ordered set must have the greatest andthe least elements

A finite, partially ordered set must have maximal andminimal elements (but may not have the greatest andthe least)

A maximal or minimal element may not be unique

If a greatest or least element exists, it is unique

Discrete Mathematics I – p. 175/292

Page 751: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

RelationsA partially ordered set may have no greatest or leastelement (even if the set is finite)

A finite, totally ordered set must have the greatest andthe least elements

A finite, partially ordered set must have maximal andminimal elements (but may not have the greatest andthe least)

A maximal or minimal element may not be unique

If a greatest or least element exists, it is unique

Discrete Mathematics I – p. 175/292

Page 752: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functions

Discrete Mathematics I – p. 176/292

Page 753: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA function from set A to set B is a relationRf : A ↔ B, where for every a ∈ A, there is a uniqueb ∈ B, such that afb

A B

f

Discrete Mathematics I – p. 177/292

Page 754: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA function from set A to set B is a relationRf : A ↔ B, where for every a ∈ A, there is a uniqueb ∈ B, such that afb

��

��

A

��

��

B

f

Discrete Mathematics I – p. 177/292

Page 755: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B ⇐⇒

(Rf : A ↔ B) ∧ (∀a ∈ A : ∃!b ∈ B : afb)

f maps A into B

Instead of afb, write f(a) = b or f : a 7→ b

f maps a to b

Discrete Mathematics I – p. 178/292

Page 756: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B ⇐⇒

(Rf : A ↔ B) ∧ (∀a ∈ A : ∃!b ∈ B : afb)

f maps A into B

Instead of afb, write f(a) = b or f : a 7→ b

f maps a to b

Discrete Mathematics I – p. 178/292

Page 757: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B ⇐⇒

(Rf : A ↔ B) ∧ (∀a ∈ A : ∃!b ∈ B : afb)

f maps A into B

Instead of afb, write f(a) = b or f : a 7→ b

f maps a to b

Discrete Mathematics I – p. 178/292

Page 758: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B ⇐⇒

(Rf : A ↔ B) ∧ (∀a ∈ A : ∃!b ∈ B : afb)

f maps A into B

Instead of afb, write f(a) = b or f : a 7→ b

f maps a to b

Discrete Mathematics I – p. 178/292

Page 759: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

A is the domain of f Domf = A

B is the co-domain of f Codomf = B

f : a 7→ b a ∈ A b ∈ B

b is the image of a

a is the pre-image of b

Discrete Mathematics I – p. 179/292

Page 760: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

A is the domain of f Domf = A

B is the co-domain of f Codomf = B

f : a 7→ b a ∈ A b ∈ B

b is the image of a

a is the pre-image of b

Discrete Mathematics I – p. 179/292

Page 761: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

A is the domain of f Domf = A

B is the co-domain of f Codomf = B

f : a 7→ b a ∈ A b ∈ B

b is the image of a

a is the pre-image of b

Discrete Mathematics I – p. 179/292

Page 762: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

A is the domain of f Domf = A

B is the co-domain of f Codomf = B

f : a 7→ b a ∈ A b ∈ B

b is the image of a

a is the pre-image of b

Discrete Mathematics I – p. 179/292

Page 763: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

Identity function idA : A → AidA = {(a, a) | a ∈ A} = R=A

A A

idA

Discrete Mathematics I – p. 180/292

Page 764: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

Identity function idA : A → AidA = {(a, a) | a ∈ A} = R=A

��

��

A

��

��

A

idA

Discrete Mathematics I – p. 180/292

Page 765: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : N → N f = {(m, n) ∈ N2 | m2 = n}

= {(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), . . .}

g : {0, 1, 2} → N g = {(0, 0), (1, 1), (2, 4)}g ⊆ f Domg ⊆ Domf Codomg ⊆ Codomf

Function g called a restriction of f

Function f called an extension of g

Discrete Mathematics I – p. 181/292

Page 766: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : N → N f = {(m, n) ∈ N2 | m2 = n}

= {(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), . . .}g : {0, 1, 2} → N g = {(0, 0), (1, 1), (2, 4)}

g ⊆ f Domg ⊆ Domf Codomg ⊆ Codomf

Function g called a restriction of f

Function f called an extension of g

Discrete Mathematics I – p. 181/292

Page 767: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : N → N f = {(m, n) ∈ N2 | m2 = n}

= {(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), . . .}g : {0, 1, 2} → N g = {(0, 0), (1, 1), (2, 4)}g ⊆ f

Domg ⊆ Domf Codomg ⊆ Codomf

Function g called a restriction of f

Function f called an extension of g

Discrete Mathematics I – p. 181/292

Page 768: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : N → N f = {(m, n) ∈ N2 | m2 = n}

= {(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), . . .}g : {0, 1, 2} → N g = {(0, 0), (1, 1), (2, 4)}g ⊆ f Domg ⊆ Domf Codomg ⊆ Codomf

Function g called a restriction of f

Function f called an extension of g

Discrete Mathematics I – p. 181/292

Page 769: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : N → N f = {(m, n) ∈ N2 | m2 = n}

= {(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), . . .}g : {0, 1, 2} → N g = {(0, 0), (1, 1), (2, 4)}g ⊆ f Domg ⊆ Domf Codomg ⊆ Codomf

Function g called a restriction of f

Function f called an extension of g

Discrete Mathematics I – p. 181/292

Page 770: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : N → N f = {(m, n) ∈ N2 | m2 = n}

= {(0, 0), (1, 1), (2, 4), (3, 9), (4, 16), . . .}g : {0, 1, 2} → N g = {(0, 0), (1, 1), (2, 4)}g ⊆ f Domg ⊆ Domf Codomg ⊆ Codomf

Function g called a restriction of f

Function f called an extension of g

Discrete Mathematics I – p. 181/292

Page 771: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsAn infinite sequence of elements of set A is anyfunction a : N → A

Integer sequence N → Z, Boolean sequence N → B,etc.

Instead of a(k) write ak: a = (a0, a1, a2, a3, . . . )

Examples:

a : N → N a = (0, 1, 4, 9, 16, . . . )

b : N → B b = (F, T, F, T, F, . . . )

Discrete Mathematics I – p. 182/292

Page 772: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsAn infinite sequence of elements of set A is anyfunction a : N → A

Integer sequence N → Z, Boolean sequence N → B,etc.

Instead of a(k) write ak: a = (a0, a1, a2, a3, . . . )

Examples:

a : N → N a = (0, 1, 4, 9, 16, . . . )

b : N → B b = (F, T, F, T, F, . . . )

Discrete Mathematics I – p. 182/292

Page 773: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsAn infinite sequence of elements of set A is anyfunction a : N → A

Integer sequence N → Z, Boolean sequence N → B,etc.

Instead of a(k) write ak: a = (a0, a1, a2, a3, . . . )

Examples:

a : N → N a = (0, 1, 4, 9, 16, . . . )

b : N → B b = (F, T, F, T, F, . . . )

Discrete Mathematics I – p. 182/292

Page 774: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsAn infinite sequence of elements of set A is anyfunction a : N → A

Integer sequence N → Z, Boolean sequence N → B,etc.

Instead of a(k) write ak: a = (a0, a1, a2, a3, . . . )

Examples:

a : N → N a = (0, 1, 4, 9, 16, . . . )

b : N → B b = (F, T, F, T, F, . . . )

Discrete Mathematics I – p. 182/292

Page 775: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsAn infinite sequence of elements of set A is anyfunction a : N → A

Integer sequence N → Z, Boolean sequence N → B,etc.

Instead of a(k) write ak: a = (a0, a1, a2, a3, . . . )

Examples:

a : N → N a = (0, 1, 4, 9, 16, . . . )

b : N → B b = (F, T, F, T, F, . . . )

Discrete Mathematics I – p. 182/292

Page 776: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsLet n ∈ N

Nn = {x ∈ N | x < n} = {0, 1, 2, . . . , n− 1}

A finite sequence of elements of set A is any functiona : Nn → A

Example: g = (0, 1, 4)

Number n is the sequence length

Discrete Mathematics I – p. 183/292

Page 777: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsLet n ∈ N

Nn = {x ∈ N | x < n} = {0, 1, 2, . . . , n− 1}A finite sequence of elements of set A is any functiona : Nn → A

Example: g = (0, 1, 4)

Number n is the sequence length

Discrete Mathematics I – p. 183/292

Page 778: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsLet n ∈ N

Nn = {x ∈ N | x < n} = {0, 1, 2, . . . , n− 1}A finite sequence of elements of set A is any functiona : Nn → A

Example: g = (0, 1, 4)

Number n is the sequence length

Discrete Mathematics I – p. 183/292

Page 779: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsLet n ∈ N

Nn = {x ∈ N | x < n} = {0, 1, 2, . . . , n− 1}A finite sequence of elements of set A is any functiona : Nn → A

Example: g = (0, 1, 4)

Number n is the sequence length

Discrete Mathematics I – p. 183/292

Page 780: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B g : B → C

The composition of f and g f ◦ g : A → C

Same as relation composition Rf◦g

Rf , Rg functions =⇒ Rf◦g a function

∀a ∈ A : (f ◦ g)(a) = g(f(a))

Discrete Mathematics I – p. 184/292

Page 781: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B g : B → C

The composition of f and g f ◦ g : A → C

Same as relation composition Rf◦g

Rf , Rg functions =⇒ Rf◦g a function

∀a ∈ A : (f ◦ g)(a) = g(f(a))

Discrete Mathematics I – p. 184/292

Page 782: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B g : B → C

The composition of f and g f ◦ g : A → C

Same as relation composition Rf◦g

Rf , Rg functions =⇒ Rf◦g a function

∀a ∈ A : (f ◦ g)(a) = g(f(a))

Discrete Mathematics I – p. 184/292

Page 783: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B g : B → C

The composition of f and g f ◦ g : A → C

Same as relation composition Rf◦g

Rf , Rg functions =⇒ Rf◦g a function

∀a ∈ A : (f ◦ g)(a) = g(f(a))

Discrete Mathematics I – p. 184/292

Page 784: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) = (n + 1) + 1 = n + 2

(f ◦ g)(n) = (n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) = n2 + 1

(g ◦ g)(n) = (n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 785: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) =

(n + 1) + 1 = n + 2

(f ◦ g)(n) = (n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) = n2 + 1

(g ◦ g)(n) = (n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 786: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) = (n + 1) + 1 = n + 2

(f ◦ g)(n) = (n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) = n2 + 1

(g ◦ g)(n) = (n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 787: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) = (n + 1) + 1 = n + 2

(f ◦ g)(n) =

(n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) = n2 + 1

(g ◦ g)(n) = (n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 788: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) = (n + 1) + 1 = n + 2

(f ◦ g)(n) = (n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) = n2 + 1

(g ◦ g)(n) = (n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 789: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) = (n + 1) + 1 = n + 2

(f ◦ g)(n) = (n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) =

n2 + 1

(g ◦ g)(n) = (n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 790: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) = (n + 1) + 1 = n + 2

(f ◦ g)(n) = (n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) = n2 + 1

(g ◦ g)(n) = (n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 791: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) = (n + 1) + 1 = n + 2

(f ◦ g)(n) = (n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) = n2 + 1

(g ◦ g)(n) =

(n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 792: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) = (n + 1) + 1 = n + 2

(f ◦ g)(n) = (n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) = n2 + 1

(g ◦ g)(n) = (n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 793: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

g : Z → Z n 7→ n2

(f ◦ f)(n) = (n + 1) + 1 = n + 2

(f ◦ g)(n) = (n + 1)2 = n2 + 2n + 1

(g ◦ f)(n) = n2 + 1

(g ◦ g)(n) = (n2)2 = n4

Note (f ◦ g) 6= (g ◦ f)

Discrete Mathematics I – p. 185/292

Page 794: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

The (functional) inverse of f f−1 : B → A

Same as relation inverse Rf−1, but may not be afunction

(we say “functional inverse may not exist”)

∀a ∈ A, b ∈ B : (f(a) = b) ⇔ (f−1(b) = a)

Discrete Mathematics I – p. 186/292

Page 795: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

The (functional) inverse of f f−1 : B → A

Same as relation inverse Rf−1, but may not be afunction

(we say “functional inverse may not exist”)

∀a ∈ A, b ∈ B : (f(a) = b) ⇔ (f−1(b) = a)

Discrete Mathematics I – p. 186/292

Page 796: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

The (functional) inverse of f f−1 : B → A

Same as relation inverse Rf−1, but may not be afunction

(we say “functional inverse may not exist”)

∀a ∈ A, b ∈ B : (f(a) = b) ⇔ (f−1(b) = a)

Discrete Mathematics I – p. 186/292

Page 797: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

The (functional) inverse of f f−1 : B → A

Same as relation inverse Rf−1, but may not be afunction

(we say “functional inverse may not exist”)

∀a ∈ A, b ∈ B : (f(a) = b) ⇔ (f−1(b) = a)

Discrete Mathematics I – p. 186/292

Page 798: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

f−1(n) = n− 1

g : Z → Z n 7→ n2

g−1does not exist (i.e. Rg−1 is not a function)

Discrete Mathematics I – p. 187/292

Page 799: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

f−1(n) =

n− 1

g : Z → Z n 7→ n2

g−1does not exist (i.e. Rg−1 is not a function)

Discrete Mathematics I – p. 187/292

Page 800: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

f−1(n) = n− 1

g : Z → Z n 7→ n2

g−1does not exist (i.e. Rg−1 is not a function)

Discrete Mathematics I – p. 187/292

Page 801: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

f−1(n) = n− 1

g : Z → Z n 7→ n2

g−1does not exist (i.e. Rg−1 is not a function)

Discrete Mathematics I – p. 187/292

Page 802: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

f−1(n) = n− 1

g : Z → Z n 7→ n2

g−1

does not exist (i.e. Rg−1 is not a function)

Discrete Mathematics I – p. 187/292

Page 803: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Z → Z n 7→ n + 1

f−1(n) = n− 1

g : Z → Z n 7→ n2

g−1 does not exist (i.e. Rg−1 is not a function)

Discrete Mathematics I – p. 187/292

Page 804: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

The range of f is the set of all elements in B that havea pre-image in A

f(A) = {b ∈ B | ∃a ∈ A : f(a) = b}

f(A)

A B

f

Discrete Mathematics I – p. 188/292

Page 805: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

The range of f is the set of all elements in B that havea pre-image in A

f(A) = {b ∈ B | ∃a ∈ A : f(a) = b}

f(A)

A B

f

Discrete Mathematics I – p. 188/292

Page 806: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

The range of f is the set of all elements in B that havea pre-image in A

f(A) = {b ∈ B | ∃a ∈ A : f(a) = b}

f(A)

A B

f

Discrete Mathematics I – p. 188/292

Page 807: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B

The range of f is the set of all elements in B that havea pre-image in A

f(A) = {b ∈ B | ∃a ∈ A : f(a) = b}

f(A)

��

��

�A

��

��

B

f

Discrete Mathematics I – p. 188/292

Page 808: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : N → N n 7→ n + 1

f(N) = N \ {0} = {1, 2, 3, 4, . . . }g : {0, 1, 2} → N n 7→ n2

g({0, 1, 2}) = {0, 1, 4}

Discrete Mathematics I – p. 189/292

Page 809: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : N → N n 7→ n + 1

f(N) =

N \ {0} = {1, 2, 3, 4, . . . }g : {0, 1, 2} → N n 7→ n2

g({0, 1, 2}) = {0, 1, 4}

Discrete Mathematics I – p. 189/292

Page 810: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : N → N n 7→ n + 1

f(N) = N \ {0} = {1, 2, 3, 4, . . . }

g : {0, 1, 2} → N n 7→ n2

g({0, 1, 2}) = {0, 1, 4}

Discrete Mathematics I – p. 189/292

Page 811: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : N → N n 7→ n + 1

f(N) = N \ {0} = {1, 2, 3, 4, . . . }g : {0, 1, 2} → N n 7→ n2

g({0, 1, 2}) = {0, 1, 4}

Discrete Mathematics I – p. 189/292

Page 812: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : N → N n 7→ n + 1

f(N) = N \ {0} = {1, 2, 3, 4, . . . }g : {0, 1, 2} → N n 7→ n2

g({0, 1, 2}) =

{0, 1, 4}

Discrete Mathematics I – p. 189/292

Page 813: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : N → N n 7→ n + 1

f(N) = N \ {0} = {1, 2, 3, 4, . . . }g : {0, 1, 2} → N n 7→ n2

g({0, 1, 2}) = {0, 1, 4}

Discrete Mathematics I – p. 189/292

Page 814: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called surjective, if its range is the wholeco-domain

f : A� B ⇐⇒ ∀b ∈ B : ∃a ∈ A : f(a) = b

A B

f

Also say f maps A onto B

Discrete Mathematics I – p. 190/292

Page 815: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called surjective, if its range is the wholeco-domain

f : A� B ⇐⇒ ∀b ∈ B : ∃a ∈ A : f(a) = b

A B

f

Also say f maps A onto B

Discrete Mathematics I – p. 190/292

Page 816: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called surjective, if its range is the wholeco-domain

f : A� B ⇐⇒ ∀b ∈ B : ∃a ∈ A : f(a) = b

��

��

A

��

B

f

Also say f maps A onto B

Discrete Mathematics I – p. 190/292

Page 817: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called surjective, if its range is the wholeco-domain

f : A� B ⇐⇒ ∀b ∈ B : ∃a ∈ A : f(a) = b

��

��

A

��

B

f

Also say f maps A onto B

Discrete Mathematics I – p. 190/292

Page 818: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called injective, if it maps different elementsto different elements

f : A� B ⇐⇒ ∀x, y : (f(x) = f(y)) ⇒ (x = y)

A B

f

Also say f maps A into B one-to-one

Discrete Mathematics I – p. 191/292

Page 819: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called injective, if it maps different elementsto different elements

f : A� B ⇐⇒ ∀x, y : (f(x) = f(y)) ⇒ (x = y)

A B

f

Also say f maps A into B one-to-one

Discrete Mathematics I – p. 191/292

Page 820: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called injective, if it maps different elementsto different elements

f : A� B ⇐⇒ ∀x, y : (f(x) = f(y)) ⇒ (x = y)

��

A

��

��

B

f

Also say f maps A into B one-to-one

Discrete Mathematics I – p. 191/292

Page 821: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called injective, if it maps different elementsto different elements

f : A� B ⇐⇒ ∀x, y : (f(x) = f(y)) ⇒ (x = y)

��

A

��

��

B

f

Also say f maps A into B one-to-one

Discrete Mathematics I – p. 191/292

Page 822: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Cards � {♠,♥,♣,♦} f : x 7→ suit of x

Function f surjective, but not injective

g : N� N g : m 7→ m2

Function g injective, but not surjective

Discrete Mathematics I – p. 192/292

Page 823: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Cards � {♠,♥,♣,♦} f : x 7→ suit of x

Function f surjective, but not injective

g : N� N g : m 7→ m2

Function g injective, but not surjective

Discrete Mathematics I – p. 192/292

Page 824: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Cards � {♠,♥,♣,♦} f : x 7→ suit of x

Function f surjective, but not injective

g : N� N g : m 7→ m2

Function g injective, but not surjective

Discrete Mathematics I – p. 192/292

Page 825: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

f : Cards � {♠,♥,♣,♦} f : x 7→ suit of x

Function f surjective, but not injective

g : N� N g : m 7→ m2

Function g injective, but not surjective

Discrete Mathematics I – p. 192/292

Page 826: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called bijective, if it is both surjective andinjective

f : A��B ⇐⇒ ∀b ∈ B : ∃!a ∈ A : f(a) = b

A B

f

Also say f is a one-to-one correspondence between Aand B

Discrete Mathematics I – p. 193/292

Page 827: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called bijective, if it is both surjective andinjective

f : A��B ⇐⇒ ∀b ∈ B : ∃!a ∈ A : f(a) = b

A B

f

Also say f is a one-to-one correspondence between Aand B

Discrete Mathematics I – p. 193/292

Page 828: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called bijective, if it is both surjective andinjective

f : A��B ⇐⇒ ∀b ∈ B : ∃!a ∈ A : f(a) = b

��

��

A

��

��

B

f

Also say f is a one-to-one correspondence between Aand B

Discrete Mathematics I – p. 193/292

Page 829: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFunction called bijective, if it is both surjective andinjective

f : A��B ⇐⇒ ∀b ∈ B : ∃!a ∈ A : f(a) = b

��

��

A

��

��

B

f

Also say f is a one-to-one correspondence between Aand B

Discrete Mathematics I – p. 193/292

Page 830: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

idA : A��A a 7→ a

Function idA bijective for any set A

id−1

A = idA

f : Z��Z n 7→ n + 5

g : Z��Z n 7→ −n

Discrete Mathematics I – p. 194/292

Page 831: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

idA : A��A a 7→ a

Function idA bijective for any set A

id−1

A = idA

f : Z��Z n 7→ n + 5

g : Z��Z n 7→ −n

Discrete Mathematics I – p. 194/292

Page 832: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

idA : A��A a 7→ a

Function idA bijective for any set A

id−1

A = idA

f : Z��Z n 7→ n + 5

g : Z��Z n 7→ −n

Discrete Mathematics I – p. 194/292

Page 833: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

idA : A��A a 7→ a

Function idA bijective for any set A

id−1

A = idA

f : Z��Z n 7→ n + 5

g : Z��Z n 7→ −n

Discrete Mathematics I – p. 194/292

Page 834: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsExamples:

idA : A��A a 7→ a

Function idA bijective for any set A

id−1

A = idA

f : Z��Z n 7→ n + 5

g : Z��Z n 7→ −n

Discrete Mathematics I – p. 194/292

Page 835: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : Z��Z n 7→ n + 5

Function f bijective

f−1 : Z��Z m 7→ m− 5

f ◦ f−1 = f−1 ◦ f = idZ

For any set A, bijective f : A��A is a permutation

Discrete Mathematics I – p. 195/292

Page 836: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : Z��Z n 7→ n + 5

Function f bijective

f−1 : Z��Z m 7→ m− 5

f ◦ f−1 = f−1 ◦ f = idZ

For any set A, bijective f : A��A is a permutation

Discrete Mathematics I – p. 195/292

Page 837: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : Z��Z n 7→ n + 5

Function f bijective

f−1 : Z��Z m 7→ m− 5

f ◦ f−1 = f−1 ◦ f = idZ

For any set A, bijective f : A��A is a permutation

Discrete Mathematics I – p. 195/292

Page 838: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : Z��Z n 7→ n + 5

Function f bijective

f−1 : Z��Z m 7→ m− 5

f ◦ f−1 = f−1 ◦ f = idZ

For any set A, bijective f : A��A is a permutation

Discrete Mathematics I – p. 195/292

Page 839: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : Z��Z n 7→ n + 5

Function f bijective

f−1 : Z��Z m 7→ m− 5

f ◦ f−1 = f−1 ◦ f = idZ

For any set A, bijective f : A��A is a permutation

Discrete Mathematics I – p. 195/292

Page 840: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsg : Z��Z n 7→ −n

Function g bijective

g−1 : Z��Z g−1 = g

g ◦ g−1 = g−1 ◦ g = g ◦ g = idZ

For any set A, a permutation g : A��A with g−1 = gis an involution

Discrete Mathematics I – p. 196/292

Page 841: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsg : Z��Z n 7→ −n

Function g bijective

g−1 : Z��Z g−1 = g

g ◦ g−1 = g−1 ◦ g = g ◦ g = idZ

For any set A, a permutation g : A��A with g−1 = gis an involution

Discrete Mathematics I – p. 196/292

Page 842: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsg : Z��Z n 7→ −n

Function g bijective

g−1 : Z��Z g−1 = g

g ◦ g−1 = g−1 ◦ g = g ◦ g = idZ

For any set A, a permutation g : A��A with g−1 = gis an involution

Discrete Mathematics I – p. 196/292

Page 843: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsg : Z��Z n 7→ −n

Function g bijective

g−1 : Z��Z g−1 = g

g ◦ g−1 = g−1 ◦ g = g ◦ g = idZ

For any set A, a permutation g : A��A with g−1 = gis an involution

Discrete Mathematics I – p. 196/292

Page 844: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsg : Z��Z n 7→ −n

Function g bijective

g−1 : Z��Z g−1 = g

g ◦ g−1 = g−1 ◦ g = g ◦ g = idZ

For any set A, a permutation g : A��A with g−1 = gis an involution

Discrete Mathematics I – p. 196/292

Page 845: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B g : B → C

If f , g surjective, then f ◦ g surjective

If f , g injective, then f ◦ g injective

If f , g bijective, then f ◦ g bijective

Discrete Mathematics I – p. 197/292

Page 846: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B g : B → C

If f , g surjective, then f ◦ g surjective

If f , g injective, then f ◦ g injective

If f , g bijective, then f ◦ g bijective

Discrete Mathematics I – p. 197/292

Page 847: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B g : B → C

If f , g surjective, then f ◦ g surjective

If f , g injective, then f ◦ g injective

If f , g bijective, then f ◦ g bijective

Discrete Mathematics I – p. 197/292

Page 848: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsf : A → B g : B → C

If f , g surjective, then f ◦ g surjective

If f , g injective, then f ◦ g injective

If f , g bijective, then f ◦ g bijective

Discrete Mathematics I – p. 197/292

Page 849: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒ ∀b ∈ B : ∃!a ∈ A : afb =⇒∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒ f−1 a function

f a function =⇒ ∀a ∈ A : ∃!b ∈ B : afb =⇒∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒ f−1 bijective

Discrete Mathematics I – p. 198/292

Page 850: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒ ∀b ∈ B : ∃!a ∈ A : afb =⇒∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒ f−1 a function

f a function =⇒ ∀a ∈ A : ∃!b ∈ B : afb =⇒∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒ f−1 bijective

Discrete Mathematics I – p. 198/292

Page 851: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒

∀b ∈ B : ∃!a ∈ A : afb =⇒∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒ f−1 a function

f a function =⇒ ∀a ∈ A : ∃!b ∈ B : afb =⇒∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒ f−1 bijective

Discrete Mathematics I – p. 198/292

Page 852: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒ ∀b ∈ B : ∃!a ∈ A : afb =⇒

∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒ f−1 a function

f a function =⇒ ∀a ∈ A : ∃!b ∈ B : afb =⇒∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒ f−1 bijective

Discrete Mathematics I – p. 198/292

Page 853: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒ ∀b ∈ B : ∃!a ∈ A : afb =⇒∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒

f−1 a function

f a function =⇒ ∀a ∈ A : ∃!b ∈ B : afb =⇒∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒ f−1 bijective

Discrete Mathematics I – p. 198/292

Page 854: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒ ∀b ∈ B : ∃!a ∈ A : afb =⇒∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒ f−1 a function

f a function =⇒ ∀a ∈ A : ∃!b ∈ B : afb =⇒∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒ f−1 bijective

Discrete Mathematics I – p. 198/292

Page 855: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒ ∀b ∈ B : ∃!a ∈ A : afb =⇒∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒ f−1 a function

f a function =⇒

∀a ∈ A : ∃!b ∈ B : afb =⇒∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒ f−1 bijective

Discrete Mathematics I – p. 198/292

Page 856: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒ ∀b ∈ B : ∃!a ∈ A : afb =⇒∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒ f−1 a function

f a function =⇒ ∀a ∈ A : ∃!b ∈ B : afb =⇒

∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒ f−1 bijective

Discrete Mathematics I – p. 198/292

Page 857: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒ ∀b ∈ B : ∃!a ∈ A : afb =⇒∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒ f−1 a function

f a function =⇒ ∀a ∈ A : ∃!b ∈ B : afb =⇒∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒

f−1 bijective

Discrete Mathematics I – p. 198/292

Page 858: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if f bijective, then f−1 bijective.

Proof. Consider Rf : A ↔ B, Rf−1 : B ↔ A

f bijective =⇒ ∀b ∈ B : ∃!a ∈ A : afb =⇒∀b ∈ B : ∃!a ∈ A : b(f−1)a =⇒ f−1 a function

f a function =⇒ ∀a ∈ A : ∃!b ∈ B : afb =⇒∀a ∈ A : ∃!b ∈ B : b(f−1)a =⇒ f−1 bijective

Discrete Mathematics I – p. 198/292

Page 859: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if both f and f−1 are functions, then both fand f−1 are bijective

Proof (sketch). Let f : A → B, f−1 : B → A.

f a function ⇒ f−1 surjective

f a function ⇒ f−1 injective

f = (f−1)−1 ⇒ f surjective and injective

To prove f : A��B, only need f−1 : B → A

f ◦ f−1 = idA f−1 ◦ f = idB

Discrete Mathematics I – p. 199/292

Page 860: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if both f and f−1 are functions, then both fand f−1 are bijective

Proof (sketch). Let f : A → B, f−1 : B → A.

f a function ⇒ f−1 surjective

f a function ⇒ f−1 injective

f = (f−1)−1 ⇒ f surjective and injective

To prove f : A��B, only need f−1 : B → A

f ◦ f−1 = idA f−1 ◦ f = idB

Discrete Mathematics I – p. 199/292

Page 861: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if both f and f−1 are functions, then both fand f−1 are bijective

Proof (sketch). Let f : A → B, f−1 : B → A.

f a function ⇒ f−1 surjective

f a function ⇒ f−1 injective

f = (f−1)−1 ⇒ f surjective and injective

To prove f : A��B, only need f−1 : B → A

f ◦ f−1 = idA f−1 ◦ f = idB

Discrete Mathematics I – p. 199/292

Page 862: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if both f and f−1 are functions, then both fand f−1 are bijective

Proof (sketch). Let f : A → B, f−1 : B → A.

f a function ⇒ f−1 surjective

f a function ⇒ f−1 injective

f = (f−1)−1 ⇒ f surjective and injective

To prove f : A��B, only need f−1 : B → A

f ◦ f−1 = idA f−1 ◦ f = idB

Discrete Mathematics I – p. 199/292

Page 863: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if both f and f−1 are functions, then both fand f−1 are bijective

Proof (sketch). Let f : A → B, f−1 : B → A.

f a function ⇒ f−1 surjective

f a function ⇒ f−1 injective

f = (f−1)−1 ⇒ f surjective and injective

To prove f : A��B, only need f−1 : B → A

f ◦ f−1 = idA f−1 ◦ f = idB

Discrete Mathematics I – p. 199/292

Page 864: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: if both f and f−1 are functions, then both fand f−1 are bijective

Proof (sketch). Let f : A → B, f−1 : B → A.

f a function ⇒ f−1 surjective

f a function ⇒ f−1 injective

f = (f−1)−1 ⇒ f surjective and injective

To prove f : A��B, only need f−1 : B → A

f ◦ f−1 = idA f−1 ◦ f = idB

Discrete Mathematics I – p. 199/292

Page 865: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsS — any set A ⊆ S B = {F, T}

Indicator function of A χA : S → B

∀x ∈ S : χA(x) =

{

T if x ∈ A

F if x 6∈ A

Set of all subsets of S P(S) = {A | A ⊆ S}Set of all Boolean functions on S:

B(S) = {f | f : S → B}χ : P(S)��B(S) ∀A ⊆ S : A 7→ χA

Subsets of S�� Boolean functions on S

Discrete Mathematics I – p. 200/292

Page 866: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsS — any set A ⊆ S B = {F, T}Indicator function of A χA : S → B

∀x ∈ S : χA(x) =

{

T if x ∈ A

F if x 6∈ A

Set of all subsets of S P(S) = {A | A ⊆ S}Set of all Boolean functions on S:

B(S) = {f | f : S → B}χ : P(S)��B(S) ∀A ⊆ S : A 7→ χA

Subsets of S�� Boolean functions on S

Discrete Mathematics I – p. 200/292

Page 867: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsS — any set A ⊆ S B = {F, T}Indicator function of A χA : S → B

∀x ∈ S : χA(x) =

{

T if x ∈ A

F if x 6∈ A

Set of all subsets of S P(S) = {A | A ⊆ S}Set of all Boolean functions on S:

B(S) = {f | f : S → B}χ : P(S)��B(S) ∀A ⊆ S : A 7→ χA

Subsets of S�� Boolean functions on S

Discrete Mathematics I – p. 200/292

Page 868: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsS — any set A ⊆ S B = {F, T}Indicator function of A χA : S → B

∀x ∈ S : χA(x) =

{

T if x ∈ A

F if x 6∈ A

Set of all subsets of S P(S) = {A | A ⊆ S}

Set of all Boolean functions on S:B(S) = {f | f : S → B}

χ : P(S)��B(S) ∀A ⊆ S : A 7→ χA

Subsets of S�� Boolean functions on S

Discrete Mathematics I – p. 200/292

Page 869: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsS — any set A ⊆ S B = {F, T}Indicator function of A χA : S → B

∀x ∈ S : χA(x) =

{

T if x ∈ A

F if x 6∈ A

Set of all subsets of S P(S) = {A | A ⊆ S}Set of all Boolean functions on S:

B(S) = {f | f : S → B}

χ : P(S)��B(S) ∀A ⊆ S : A 7→ χA

Subsets of S�� Boolean functions on S

Discrete Mathematics I – p. 200/292

Page 870: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsS — any set A ⊆ S B = {F, T}Indicator function of A χA : S → B

∀x ∈ S : χA(x) =

{

T if x ∈ A

F if x 6∈ A

Set of all subsets of S P(S) = {A | A ⊆ S}Set of all Boolean functions on S:

B(S) = {f | f : S → B}χ : P(S)��B(S) ∀A ⊆ S : A 7→ χA

Subsets of S�� Boolean functions on S

Discrete Mathematics I – p. 200/292

Page 871: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsS — any set A ⊆ S B = {F, T}Indicator function of A χA : S → B

∀x ∈ S : χA(x) =

{

T if x ∈ A

F if x 6∈ A

Set of all subsets of S P(S) = {A | A ⊆ S}Set of all Boolean functions on S:

B(S) = {f | f : S → B}χ : P(S)��B(S) ∀A ⊆ S : A 7→ χA

Subsets of S�� Boolean functions on S

Discrete Mathematics I – p. 200/292

Page 872: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSets A, B are called equinumerous, if there is abijection between A and B

A ∼= B ⇐⇒ ∃f : A��B

A, B ⊆ S =⇒ R∼= an equivalence on P(S)

Discrete Mathematics I – p. 201/292

Page 873: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSets A, B are called equinumerous, if there is abijection between A and B

A ∼= B ⇐⇒ ∃f : A��B

A, B ⊆ S =⇒ R∼= an equivalence on P(S)

Discrete Mathematics I – p. 201/292

Page 874: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSets A, B are called equinumerous, if there is abijection between A and B

A ∼= B ⇐⇒ ∃f : A��B

A, B ⊆ S =⇒ R∼= an equivalence on P(S)

Discrete Mathematics I – p. 201/292

Page 875: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsn ∈ N Nn = {x ∈ N | x < n}

N0 = ∅ N1 = {0} N2 = {0, 1} . . .

Nn = {0, 1, 2, . . . , n− 1}Set A called finite, if A ∼= Nn for some n ∈ N

Otherwise, the set is called infinite

Discrete Mathematics I – p. 202/292

Page 876: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsn ∈ N Nn = {x ∈ N | x < n}N0 = ∅ N1 = {0} N2 = {0, 1} . . .

Nn = {0, 1, 2, . . . , n− 1}Set A called finite, if A ∼= Nn for some n ∈ N

Otherwise, the set is called infinite

Discrete Mathematics I – p. 202/292

Page 877: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsn ∈ N Nn = {x ∈ N | x < n}N0 = ∅ N1 = {0} N2 = {0, 1} . . .

Nn = {0, 1, 2, . . . , n− 1}

Set A called finite, if A ∼= Nn for some n ∈ N

Otherwise, the set is called infinite

Discrete Mathematics I – p. 202/292

Page 878: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsn ∈ N Nn = {x ∈ N | x < n}N0 = ∅ N1 = {0} N2 = {0, 1} . . .

Nn = {0, 1, 2, . . . , n− 1}Set A called finite, if A ∼= Nn for some n ∈ N

Otherwise, the set is called infinite

Discrete Mathematics I – p. 202/292

Page 879: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsn ∈ N Nn = {x ∈ N | x < n}N0 = ∅ N1 = {0} N2 = {0, 1} . . .

Nn = {0, 1, 2, . . . , n− 1}Set A called finite, if A ∼= Nn for some n ∈ N

Otherwise, the set is called infinite

Discrete Mathematics I – p. 202/292

Page 880: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFor every finite set A, there is a unique n ∈ N, suchthat A ∼= Nn

Proof.

Let f : A��Nk. Then f−1 : Nk��A.

Let g : A��Nl.

f−1 ◦ g : Nk��Nl. Therefore k = l.

Number n called the cardinality of A |A| = n

A, B finite, A ∼= B =⇒ |A| = |B|

Discrete Mathematics I – p. 203/292

Page 881: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFor every finite set A, there is a unique n ∈ N, suchthat A ∼= Nn

Proof.

Let f : A��Nk. Then f−1 : Nk��A.

Let g : A��Nl.

f−1 ◦ g : Nk��Nl. Therefore k = l.

Number n called the cardinality of A |A| = n

A, B finite, A ∼= B =⇒ |A| = |B|

Discrete Mathematics I – p. 203/292

Page 882: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFor every finite set A, there is a unique n ∈ N, suchthat A ∼= Nn

Proof.

Let f : A��Nk. Then f−1 : Nk��A.

Let g : A��Nl.

f−1 ◦ g : Nk��Nl. Therefore k = l.

Number n called the cardinality of A |A| = n

A, B finite, A ∼= B =⇒ |A| = |B|

Discrete Mathematics I – p. 203/292

Page 883: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFor every finite set A, there is a unique n ∈ N, suchthat A ∼= Nn

Proof.

Let f : A��Nk. Then f−1 : Nk��A.

Let g : A��Nl.

f−1 ◦ g : Nk��Nl. Therefore k = l.

Number n called the cardinality of A |A| = n

A, B finite, A ∼= B =⇒ |A| = |B|

Discrete Mathematics I – p. 203/292

Page 884: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFor every finite set A, there is a unique n ∈ N, suchthat A ∼= Nn

Proof.

Let f : A��Nk. Then f−1 : Nk��A.

Let g : A��Nl.

f−1 ◦ g : Nk��Nl. Therefore k = l.

Number n called the cardinality of A |A| = n

A, B finite, A ∼= B =⇒ |A| = |B|

Discrete Mathematics I – p. 203/292

Page 885: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFor every finite set A, there is a unique n ∈ N, suchthat A ∼= Nn

Proof.

Let f : A��Nk. Then f−1 : Nk��A.

Let g : A��Nl.

f−1 ◦ g : Nk��Nl. Therefore k = l.

Number n called the cardinality of A

|A| = n

A, B finite, A ∼= B =⇒ |A| = |B|

Discrete Mathematics I – p. 203/292

Page 886: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFor every finite set A, there is a unique n ∈ N, suchthat A ∼= Nn

Proof.

Let f : A��Nk. Then f−1 : Nk��A.

Let g : A��Nl.

f−1 ◦ g : Nk��Nl. Therefore k = l.

Number n called the cardinality of A |A| = n

A, B finite, A ∼= B =⇒ |A| = |B|

Discrete Mathematics I – p. 203/292

Page 887: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFor every finite set A, there is a unique n ∈ N, suchthat A ∼= Nn

Proof.

Let f : A��Nk. Then f−1 : Nk��A.

Let g : A��Nl.

f−1 ◦ g : Nk��Nl. Therefore k = l.

Number n called the cardinality of A |A| = n

A, B finite, A ∼= B =⇒ |A| = |B|

Discrete Mathematics I – p. 203/292

Page 888: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN, Z, N2, N3, P(N), Neven — infinite

An infinite set is called countable, if it isequinumerous with N

In particular, N itself is countable

Discrete Mathematics I – p. 204/292

Page 889: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN, Z, N2, N3, P(N), Neven — infinite

An infinite set is called countable, if it isequinumerous with N

In particular, N itself is countable

Discrete Mathematics I – p. 204/292

Page 890: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN, Z, N2, N3, P(N), Neven — infinite

An infinite set is called countable, if it isequinumerous with N

In particular, N itself is countable

Discrete Mathematics I – p. 204/292

Page 891: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set N+ = N \ {0} is countable.

Proof. Let f : N → N+ ∀n : n 7→ n + 1

∀n ∈ N+ : n = (n− 1) + 1 = f(n− 1)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (m + 1 6= n + 1)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 205/292

Page 892: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set N+ = N \ {0} is countable.

Proof. Let f : N → N+ ∀n : n 7→ n + 1

∀n ∈ N+ : n = (n− 1) + 1 = f(n− 1)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (m + 1 6= n + 1)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 205/292

Page 893: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set N+ = N \ {0} is countable.

Proof. Let f : N → N+ ∀n : n 7→ n + 1

∀n ∈ N+ : n = (n− 1) + 1 = f(n− 1)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (m + 1 6= n + 1)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 205/292

Page 894: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set N+ = N \ {0} is countable.

Proof. Let f : N → N+ ∀n : n 7→ n + 1

∀n ∈ N+ : n = (n− 1) + 1 = f(n− 1)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (m + 1 6= n + 1)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 205/292

Page 895: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set N+ = N \ {0} is countable.

Proof. Let f : N → N+ ∀n : n 7→ n + 1

∀n ∈ N+ : n = (n− 1) + 1 = f(n− 1)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (m + 1 6= n + 1)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 205/292

Page 896: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set N+ = N \ {0} is countable.

Proof. Let f : N → N+ ∀n : n 7→ n + 1

∀n ∈ N+ : n = (n− 1) + 1 = f(n− 1)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (m + 1 6= n + 1)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 205/292

Page 897: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set N+ = N \ {0} is countable.

Proof. Let f : N → N+ ∀n : n 7→ n + 1

∀n ∈ N+ : n = (n− 1) + 1 = f(n− 1)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (m + 1 6= n + 1)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 205/292

Page 898: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN+ ⊆ N

0 1 2 3 4 5 6 7 · · ·l l l l l l l l1 2 3 4 5 6 7 8 · · ·

N+ ∼= N

A part is of the same size as the whole!

Discrete Mathematics I – p. 206/292

Page 899: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN+ ⊆ N

0 1 2 3 4 5 6 7 · · ·l l l l l l l l1 2 3 4 5 6 7 8 · · ·

N+ ∼= N

A part is of the same size as the whole!

Discrete Mathematics I – p. 206/292

Page 900: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN+ ⊆ N

0 1 2 3 4 5 6 7 · · ·l l l l l l l l1 2 3 4 5 6 7 8 · · ·

N+ ∼= N

A part is of the same size as the whole!

Discrete Mathematics I – p. 206/292

Page 901: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN+ ⊆ N

0 1 2 3 4 5 6 7 · · ·l l l l l l l l1 2 3 4 5 6 7 8 · · ·

N+ ∼= N

A part is of the same size as the whole!

Discrete Mathematics I – p. 206/292

Page 902: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Neven = {0, 2, 4, 6, . . . } is countable.

Proof. Let f : N → Neven ∀n : n 7→ 2n

∀n ∈ Neven : n = 2 · n/2 = f(n/2)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (2m 6= 2n)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 207/292

Page 903: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Neven = {0, 2, 4, 6, . . . } is countable.

Proof. Let f : N → Neven ∀n : n 7→ 2n

∀n ∈ Neven : n = 2 · n/2 = f(n/2)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (2m 6= 2n)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 207/292

Page 904: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Neven = {0, 2, 4, 6, . . . } is countable.

Proof. Let f : N → Neven ∀n : n 7→ 2n

∀n ∈ Neven : n = 2 · n/2 = f(n/2)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (2m 6= 2n)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 207/292

Page 905: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Neven = {0, 2, 4, 6, . . . } is countable.

Proof. Let f : N → Neven ∀n : n 7→ 2n

∀n ∈ Neven : n = 2 · n/2 = f(n/2)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (2m 6= 2n)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 207/292

Page 906: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Neven = {0, 2, 4, 6, . . . } is countable.

Proof. Let f : N → Neven ∀n : n 7→ 2n

∀n ∈ Neven : n = 2 · n/2 = f(n/2)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (2m 6= 2n)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 207/292

Page 907: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Neven = {0, 2, 4, 6, . . . } is countable.

Proof. Let f : N → Neven ∀n : n 7→ 2n

∀n ∈ Neven : n = 2 · n/2 = f(n/2)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (2m 6= 2n)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 207/292

Page 908: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Neven = {0, 2, 4, 6, . . . } is countable.

Proof. Let f : N → Neven ∀n : n 7→ 2n

∀n ∈ Neven : n = 2 · n/2 = f(n/2)

Hence f surjective

∀m, n ∈ N : (m 6= n) ⇒ (2m 6= 2n)

Hence f injective

f surjective and injective =⇒ f bijective

Discrete Mathematics I – p. 207/292

Page 909: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsNeven ⊆ N

0 1 2 3 4 5 6 7 · · ·l l l l l l l l0 2 4 6 8 10 12 14 · · ·

Neven∼= N

In general, any subset of a countable set is finite orcountable. Any quotient set of a countable set is finiteor countable.

Discrete Mathematics I – p. 208/292

Page 910: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsNeven ⊆ N

0 1 2 3 4 5 6 7 · · ·l l l l l l l l0 2 4 6 8 10 12 14 · · ·

Neven∼= N

In general, any subset of a countable set is finite orcountable. Any quotient set of a countable set is finiteor countable.

Discrete Mathematics I – p. 208/292

Page 911: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsNeven ⊆ N

0 1 2 3 4 5 6 7 · · ·l l l l l l l l0 2 4 6 8 10 12 14 · · ·

Neven∼= N

In general, any subset of a countable set is finite orcountable. Any quotient set of a countable set is finiteor countable.

Discrete Mathematics I – p. 208/292

Page 912: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsNeven ⊆ N

0 1 2 3 4 5 6 7 · · ·l l l l l l l l0 2 4 6 8 10 12 14 · · ·

Neven∼= N

In general, any subset of a countable set is finite orcountable.

Any quotient set of a countable set is finiteor countable.

Discrete Mathematics I – p. 208/292

Page 913: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsNeven ⊆ N

0 1 2 3 4 5 6 7 · · ·l l l l l l l l0 2 4 6 8 10 12 14 · · ·

Neven∼= N

In general, any subset of a countable set is finite orcountable. Any quotient set of a countable set is finiteor countable.

Discrete Mathematics I – p. 208/292

Page 914: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6 4 2 0 1 3 5 7 · · ·f bijective

Discrete Mathematics I – p. 209/292

Page 915: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6 4 2 0 1 3 5 7 · · ·f bijective

Discrete Mathematics I – p. 209/292

Page 916: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6 4 2 0 1 3 5 7 · · ·f bijective

Discrete Mathematics I – p. 209/292

Page 917: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6 4 2

0

1 3 5 7 · · ·f bijective

Discrete Mathematics I – p. 209/292

Page 918: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6 4 2

0 1

3 5 7 · · ·f bijective

Discrete Mathematics I – p. 209/292

Page 919: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6 4

2 0 1

3 5 7 · · ·f bijective

Discrete Mathematics I – p. 209/292

Page 920: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6 4

2 0 1 3

5 7 · · ·f bijective

Discrete Mathematics I – p. 209/292

Page 921: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6

4 2 0 1 3

5 7 · · ·f bijective

Discrete Mathematics I – p. 209/292

Page 922: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6 4 2 0 1 3 5 7 · · ·

f bijective

Discrete Mathematics I – p. 209/292

Page 923: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: set Z is countable.

Proof. Let f : N → Z

∀n : n 7→{

(n + 1)/2 if n odd−n/2 if n even

· · · −4 −3 −2 −1 0 1 2 3 4 · · ·l l l l l l l l l

· · · 8 6 4 2 0 1 3 5 7 · · ·f bijective

Discrete Mathematics I – p. 209/292

Page 924: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N2 = N× N is countable.

Proof idea:

0 1 2 3 4

0 0 1 3 6 10

1 2 4 7 11 ·2 5 8 12 · ·3 9 13 · · ·4 14 · · · ·

Discrete Mathematics I – p. 210/292

Page 925: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N2 = N× N is countable.

Proof idea:

0 1 2 3 4

0

0 1 3 6 10

1

2 4 7 11 ·

2

5 8 12 · ·

3

9 13 · · ·

4

14 · · · ·

Discrete Mathematics I – p. 210/292

Page 926: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N2 = N× N is countable.

Proof idea:

0 1 2 3 4

0 0

1 3 6 10

1

2 4 7 11 ·

2

5 8 12 · ·

3

9 13 · · ·

4

14 · · · ·

Discrete Mathematics I – p. 210/292

Page 927: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N2 = N× N is countable.

Proof idea:

0 1 2 3 4

0 0 1

3 6 10

1 2

4 7 11 ·

2

5 8 12 · ·

3

9 13 · · ·

4

14 · · · ·

Discrete Mathematics I – p. 210/292

Page 928: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N2 = N× N is countable.

Proof idea:

0 1 2 3 4

0 0 1 3

6 10

1 2 4

7 11 ·

2 5

8 12 · ·

3

9 13 · · ·

4

14 · · · ·

Discrete Mathematics I – p. 210/292

Page 929: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N2 = N× N is countable.

Proof idea:

0 1 2 3 4

0 0 1 3 6

10

1 2 4 7

11 ·

2 5 8

12 · ·

3 9

13 · · ·

4

14 · · · ·

Discrete Mathematics I – p. 210/292

Page 930: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N2 = N× N is countable.

Proof idea:

0 1 2 3 4

0 0 1 3 6 10

1 2 4 7 11

·

2 5 8 12

· ·

3 9 13

· · ·

4 14

· · · ·

Discrete Mathematics I – p. 210/292

Page 931: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N2 = N× N is countable.

Proof idea:

0 1 2 3 4

0 0 1 3 6 10

1 2 4 7 11 ·2 5 8 12 · ·3 9 13 · · ·4 14 · · · ·

Discrete Mathematics I – p. 210/292

Page 932: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N3 = N× N× N is countable.

Proof. N3 = (N× N)× N ∼= N× N ∼= N

In general, the Cartesian product of a finite number ofcountable sets is countable

Not true for an infinite Cartesian product!

Discrete Mathematics I – p. 211/292

Page 933: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N3 = N× N× N is countable.

Proof. N3 = (N× N)× N ∼= N× N ∼= N

In general, the Cartesian product of a finite number ofcountable sets is countable

Not true for an infinite Cartesian product!

Discrete Mathematics I – p. 211/292

Page 934: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N3 = N× N× N is countable.

Proof. N3 = (N× N)× N ∼= N× N ∼= N

In general, the Cartesian product of a finite number ofcountable sets is countable

Not true for an infinite Cartesian product!

Discrete Mathematics I – p. 211/292

Page 935: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsProve: Set N3 = N× N× N is countable.

Proof. N3 = (N× N)× N ∼= N× N ∼= N

In general, the Cartesian product of a finite number ofcountable sets is countable

Not true for an infinite Cartesian product!

Discrete Mathematics I – p. 211/292

Page 936: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA digression on rational numbers

Fractions 1/2, −3/4, 355/113

Similar to Z2, but:

1/2 = 3/6 −5 = −10/2 = 30/(−6) . . .

Discrete Mathematics I – p. 212/292

Page 937: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA digression on rational numbers

Fractions 1/2, −3/4, 355/113

Similar to Z2, but:

1/2 = 3/6 −5 = −10/2 = 30/(−6) . . .

Discrete Mathematics I – p. 212/292

Page 938: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA digression on rational numbers

Fractions 1/2, −3/4, 355/113

Similar to Z2, but:

1/2 = 3/6 −5 = −10/2 = 30/(−6) . . .

Discrete Mathematics I – p. 212/292

Page 939: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsa/b = c/d ⇐⇒ a · d = b · c b, d 6= 0

R∼ : Z2 ↔ Z2 (a, b) ∼ (c, d) ⇐⇒ a · d = b · cThe rational numbers: Q = Z2/R∼

Discrete Mathematics I – p. 213/292

Page 940: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsa/b = c/d ⇐⇒ a · d = b · c b, d 6= 0

R∼ : Z2 ↔ Z2 (a, b) ∼ (c, d) ⇐⇒ a · d = b · c

The rational numbers: Q = Z2/R∼

Discrete Mathematics I – p. 213/292

Page 941: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Functionsa/b = c/d ⇐⇒ a · d = b · c b, d 6= 0

R∼ : Z2 ↔ Z2 (a, b) ∼ (c, d) ⇐⇒ a · d = b · cThe rational numbers: Q = Z2/R∼

Discrete Mathematics I – p. 213/292

Page 942: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSet Q is infinite, and also dense: for any two distinctrationals, there is a rational in between

0 11/21/3

5/12

∀a, b ∈ Q :(

(a < b) ⇒ ∃x ∈ Q : a < x < b)

Still, set Q is countable

Z2 ∼= N =⇒ Q = Z2/R∼ ∼= N

Discrete Mathematics I – p. 214/292

Page 943: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSet Q is infinite, and also dense: for any two distinctrationals, there is a rational in between

0

1

1/21/3

5/12

∀a, b ∈ Q :(

(a < b) ⇒ ∃x ∈ Q : a < x < b)

Still, set Q is countable

Z2 ∼= N =⇒ Q = Z2/R∼ ∼= N

Discrete Mathematics I – p. 214/292

Page 944: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSet Q is infinite, and also dense: for any two distinctrationals, there is a rational in between

0

1

1/2

1/3

5/12

∀a, b ∈ Q :(

(a < b) ⇒ ∃x ∈ Q : a < x < b)

Still, set Q is countable

Z2 ∼= N =⇒ Q = Z2/R∼ ∼= N

Discrete Mathematics I – p. 214/292

Page 945: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSet Q is infinite, and also dense: for any two distinctrationals, there is a rational in between

0

1

1/2

1/3

5/12

∀a, b ∈ Q :(

(a < b) ⇒ ∃x ∈ Q : a < x < b)

Still, set Q is countable

Z2 ∼= N =⇒ Q = Z2/R∼ ∼= N

Discrete Mathematics I – p. 214/292

Page 946: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSet Q is infinite, and also dense: for any two distinctrationals, there is a rational in between

0

1

1/2

1/3

5/12

∀a, b ∈ Q :(

(a < b) ⇒ ∃x ∈ Q : a < x < b)

Still, set Q is countable

Z2 ∼= N =⇒ Q = Z2/R∼ ∼= N

Discrete Mathematics I – p. 214/292

Page 947: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSet Q is infinite, and also dense: for any two distinctrationals, there is a rational in between

0

1

1/2

1/3

5/12

� � � � � � � � � � � �

∀a, b ∈ Q :(

(a < b) ⇒ ∃x ∈ Q : a < x < b)

Still, set Q is countable

Z2 ∼= N =⇒ Q = Z2/R∼ ∼= N

Discrete Mathematics I – p. 214/292

Page 948: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSet Q is infinite, and also dense: for any two distinctrationals, there is a rational in between

0

1

1/2

1/3

5/12

� � � � � � � � � � � �

∀a, b ∈ Q :(

(a < b) ⇒ ∃x ∈ Q : a < x < b)

Still, set Q is countable

Z2 ∼= N =⇒ Q = Z2/R∼ ∼= N

Discrete Mathematics I – p. 214/292

Page 949: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSet Q is infinite, and also dense: for any two distinctrationals, there is a rational in between

0

1

1/2

1/3

5/12

� � � � � � � � � � � �

∀a, b ∈ Q :(

(a < b) ⇒ ∃x ∈ Q : a < x < b)

Still, set Q is countable

Z2 ∼= N =⇒ Q = Z2/R∼ ∼= N

Discrete Mathematics I – p. 214/292

Page 950: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSet Q is infinite, and also dense: for any two distinctrationals, there is a rational in between

0

1

1/2

1/3

5/12

� � � � � � � � � � � �

∀a, b ∈ Q :(

(a < b) ⇒ ∃x ∈ Q : a < x < b)

Still, set Q is countable

Z2 ∼= N =⇒ Q = Z2/R∼ ∼= N

Discrete Mathematics I – p. 214/292

Page 951: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSets N, Z, Q countable: N ∼= Z ∼= Q

N ∼= N2 ∼= N3 ∼= N× Z×Q ∼= · · ·Are there any uncountable sets?

Discrete Mathematics I – p. 215/292

Page 952: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSets N, Z, Q countable: N ∼= Z ∼= Q

N ∼= N2 ∼= N3 ∼= N× Z×Q ∼= · · ·

Are there any uncountable sets?

Discrete Mathematics I – p. 215/292

Page 953: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsSets N, Z, Q countable: N ∼= Z ∼= Q

N ∼= N2 ∼= N3 ∼= N× Z×Q ∼= · · ·Are there any uncountable sets?

Discrete Mathematics I – p. 215/292

Page 954: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCantor’s Theorem. For all sets A, A 6∼= P(A).

Proof. Suppose ∃f : A��P(A).

Let D = {a ∈ A | a 6∈ f(a)}D ⊆ A =⇒ D ∈ P(A) =⇒ ∃d ∈ A : f(d) = D

d ∈ D — true or false?

Case d ∈ D =⇒ d 6∈ f(d) = DCase d 6∈ D = f(d) =⇒ d ∈ D

Contradiction! Bijection f cannot exist.

Discrete Mathematics I – p. 216/292

Page 955: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCantor’s Theorem. For all sets A, A 6∼= P(A).

Proof. Suppose ∃f : A��P(A).

Let D = {a ∈ A | a 6∈ f(a)}D ⊆ A =⇒ D ∈ P(A) =⇒ ∃d ∈ A : f(d) = D

d ∈ D — true or false?

Case d ∈ D =⇒ d 6∈ f(d) = DCase d 6∈ D = f(d) =⇒ d ∈ D

Contradiction! Bijection f cannot exist.

Discrete Mathematics I – p. 216/292

Page 956: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCantor’s Theorem. For all sets A, A 6∼= P(A).

Proof. Suppose ∃f : A��P(A).

Let D = {a ∈ A | a 6∈ f(a)}

D ⊆ A =⇒ D ∈ P(A) =⇒ ∃d ∈ A : f(d) = D

d ∈ D — true or false?

Case d ∈ D =⇒ d 6∈ f(d) = DCase d 6∈ D = f(d) =⇒ d ∈ D

Contradiction! Bijection f cannot exist.

Discrete Mathematics I – p. 216/292

Page 957: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCantor’s Theorem. For all sets A, A 6∼= P(A).

Proof. Suppose ∃f : A��P(A).

Let D = {a ∈ A | a 6∈ f(a)}D ⊆ A =⇒ D ∈ P(A) =⇒ ∃d ∈ A : f(d) = D

d ∈ D — true or false?

Case d ∈ D =⇒ d 6∈ f(d) = DCase d 6∈ D = f(d) =⇒ d ∈ D

Contradiction! Bijection f cannot exist.

Discrete Mathematics I – p. 216/292

Page 958: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCantor’s Theorem. For all sets A, A 6∼= P(A).

Proof. Suppose ∃f : A��P(A).

Let D = {a ∈ A | a 6∈ f(a)}D ⊆ A =⇒ D ∈ P(A) =⇒ ∃d ∈ A : f(d) = D

d ∈ D — true or false?

Case d ∈ D =⇒ d 6∈ f(d) = DCase d 6∈ D = f(d) =⇒ d ∈ D

Contradiction! Bijection f cannot exist.

Discrete Mathematics I – p. 216/292

Page 959: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCantor’s Theorem. For all sets A, A 6∼= P(A).

Proof. Suppose ∃f : A��P(A).

Let D = {a ∈ A | a 6∈ f(a)}D ⊆ A =⇒ D ∈ P(A) =⇒ ∃d ∈ A : f(d) = D

d ∈ D — true or false?

Case d ∈ D =⇒ d 6∈ f(d) = D

Case d 6∈ D = f(d) =⇒ d ∈ D

Contradiction! Bijection f cannot exist.

Discrete Mathematics I – p. 216/292

Page 960: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCantor’s Theorem. For all sets A, A 6∼= P(A).

Proof. Suppose ∃f : A��P(A).

Let D = {a ∈ A | a 6∈ f(a)}D ⊆ A =⇒ D ∈ P(A) =⇒ ∃d ∈ A : f(d) = D

d ∈ D — true or false?

Case d ∈ D =⇒ d 6∈ f(d) = DCase d 6∈ D = f(d) =⇒ d ∈ D

Contradiction! Bijection f cannot exist.

Discrete Mathematics I – p. 216/292

Page 961: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCantor’s Theorem. For all sets A, A 6∼= P(A).

Proof. Suppose ∃f : A��P(A).

Let D = {a ∈ A | a 6∈ f(a)}D ⊆ A =⇒ D ∈ P(A) =⇒ ∃d ∈ A : f(d) = D

d ∈ D — true or false?

Case d ∈ D =⇒ d 6∈ f(d) = DCase d 6∈ D = f(d) =⇒ d ∈ D

Contradiction! Bijection f cannot exist.

Discrete Mathematics I – p. 216/292

Page 962: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCorollary. Set P(N) is uncountable.

P(N) ∼= B(N) = {f : N → B} =⇒ B(N) 6∼= N

B = {F, T} ∼= {0, 1} = N2 ⊆ N

B(N) ∼= {f : N → N2} ⊆{f : N → N} = N× N× · · ·

B(N) uncountable =⇒ N× N× · · · uncountable

Discrete Mathematics I – p. 217/292

Page 963: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCorollary. Set P(N) is uncountable.

P(N) ∼= B(N) = {f : N → B} =⇒ B(N) 6∼= N

B = {F, T} ∼= {0, 1} = N2 ⊆ N

B(N) ∼= {f : N → N2} ⊆{f : N → N} = N× N× · · ·

B(N) uncountable =⇒ N× N× · · · uncountable

Discrete Mathematics I – p. 217/292

Page 964: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCorollary. Set P(N) is uncountable.

P(N) ∼= B(N) = {f : N → B} =⇒ B(N) 6∼= N

B = {F, T} ∼= {0, 1} = N2 ⊆ N

B(N) ∼= {f : N → N2} ⊆{f : N → N} = N× N× · · ·

B(N) uncountable =⇒ N× N× · · · uncountable

Discrete Mathematics I – p. 217/292

Page 965: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCorollary. Set P(N) is uncountable.

P(N) ∼= B(N) = {f : N → B} =⇒ B(N) 6∼= N

B = {F, T} ∼= {0, 1} = N2 ⊆ N

B(N) ∼= {f : N → N2} ⊆{f : N → N} = N× N× · · ·

B(N) uncountable =⇒ N× N× · · · uncountable

Discrete Mathematics I – p. 217/292

Page 966: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsCorollary. Set P(N) is uncountable.

P(N) ∼= B(N) = {f : N → B} =⇒ B(N) 6∼= N

B = {F, T} ∼= {0, 1} = N2 ⊆ N

B(N) ∼= {f : N → N2} ⊆{f : N → N} = N× N× · · ·

B(N) uncountable =⇒ N× N× · · · uncountable

Discrete Mathematics I – p. 217/292

Page 967: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA digression on real numbers

Rationals (20, −3/5, . . . ), irrationals (√

2, π, . . . )

Definition: Dedekind cuts of Q

Q = Q0 ∪Q1 ∀x ∈ Q0, y ∈ Q1 : x < y

Q

Q0 Q1

Every Dedekind cut defines a real number

Discrete Mathematics I – p. 218/292

Page 968: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA digression on real numbers

Rationals (20, −3/5, . . . ), irrationals (√

2, π, . . . )

Definition: Dedekind cuts of Q

Q = Q0 ∪Q1 ∀x ∈ Q0, y ∈ Q1 : x < y

Q

Q0 Q1

Every Dedekind cut defines a real number

Discrete Mathematics I – p. 218/292

Page 969: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA digression on real numbers

Rationals (20, −3/5, . . . ), irrationals (√

2, π, . . . )

Definition: Dedekind cuts of Q

Q = Q0 ∪Q1 ∀x ∈ Q0, y ∈ Q1 : x < y

Q

Q0 Q1

Every Dedekind cut defines a real number

Discrete Mathematics I – p. 218/292

Page 970: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA digression on real numbers

Rationals (20, −3/5, . . . ), irrationals (√

2, π, . . . )

Definition: Dedekind cuts of Q

Q = Q0 ∪Q1 ∀x ∈ Q0, y ∈ Q1 : x < y

Q

Q0 Q1

Every Dedekind cut defines a real number

Discrete Mathematics I – p. 218/292

Page 971: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA digression on real numbers

Rationals (20, −3/5, . . . ), irrationals (√

2, π, . . . )

Definition: Dedekind cuts of Q

Q = Q0 ∪Q1 ∀x ∈ Q0, y ∈ Q1 : x < y

� � � � � � � � � � � � � � � � � � � � � � � �

Q

Q0 Q1

Every Dedekind cut defines a real number

Discrete Mathematics I – p. 218/292

Page 972: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsA digression on real numbers

Rationals (20, −3/5, . . . ), irrationals (√

2, π, . . . )

Definition: Dedekind cuts of Q

Q = Q0 ∪Q1 ∀x ∈ Q0, y ∈ Q1 : x < y

� � � � � � � � � � � � � � � � � � � � � � � �

Q

Q0 Q1

Every Dedekind cut defines a real number

Discrete Mathematics I – p. 218/292

Page 973: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsThe real numbers R = {all Dedekind cuts of Q}

Irrationals are “gaps between rationals”

Example: π = 3.1415926536 . . .

Number π defined by

Q0 = {3, 3.1, 3.14, 3.141, 3.1415, 3.141592, . . .}Q1 = {4, 3.2, 3.15, 3.142, 3.1416, 3.141593, . . .}We approximate real by rationals using a positionalnumber system (decimal, binary, etc.)

Discrete Mathematics I – p. 219/292

Page 974: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsThe real numbers R = {all Dedekind cuts of Q}Irrationals are “gaps between rationals”

Example: π = 3.1415926536 . . .

Number π defined by

Q0 = {3, 3.1, 3.14, 3.141, 3.1415, 3.141592, . . .}Q1 = {4, 3.2, 3.15, 3.142, 3.1416, 3.141593, . . .}We approximate real by rationals using a positionalnumber system (decimal, binary, etc.)

Discrete Mathematics I – p. 219/292

Page 975: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsThe real numbers R = {all Dedekind cuts of Q}Irrationals are “gaps between rationals”

Example: π = 3.1415926536 . . .

Number π defined by

Q0 = {3, 3.1, 3.14, 3.141, 3.1415, 3.141592, . . .}Q1 = {4, 3.2, 3.15, 3.142, 3.1416, 3.141593, . . .}We approximate real by rationals using a positionalnumber system (decimal, binary, etc.)

Discrete Mathematics I – p. 219/292

Page 976: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsThe real numbers R = {all Dedekind cuts of Q}Irrationals are “gaps between rationals”

Example: π = 3.1415926536 . . .

Number π defined by

Q0 = {3, 3.1, 3.14, 3.141, 3.1415, 3.141592, . . .}Q1 = {4, 3.2, 3.15, 3.142, 3.1416, 3.141593, . . .}We approximate real by rationals using a positionalnumber system (decimal, binary, etc.)

Discrete Mathematics I – p. 219/292

Page 977: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsThe real numbers R = {all Dedekind cuts of Q}Irrationals are “gaps between rationals”

Example: π = 3.1415926536 . . .

Number π defined by

Q0 = {3, 3.1, 3.14, 3.141, 3.1415, 3.141592, . . .}Q1 = {4, 3.2, 3.15, 3.142, 3.1416, 3.141593, . . .}

We approximate real by rationals using a positionalnumber system (decimal, binary, etc.)

Discrete Mathematics I – p. 219/292

Page 978: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsThe real numbers R = {all Dedekind cuts of Q}Irrationals are “gaps between rationals”

Example: π = 3.1415926536 . . .

Number π defined by

Q0 = {3, 3.1, 3.14, 3.141, 3.1415, 3.141592, . . .}Q1 = {4, 3.2, 3.15, 3.142, 3.1416, 3.141593, . . .}We approximate real by rationals using a positionalnumber system (decimal, binary, etc.)

Discrete Mathematics I – p. 219/292

Page 979: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsIs set R countable?

Consider [0, 1] = {a ∈ R : 0 ≤ a < 1}Decimal representation of a: sequence N → N10

For example, π − 3 = .141592

f(0) = 1 f(1) = 4 f(2) = 1 f(3) = 5 . . .

(For simplicity, ignore .1415000 . . . = .1414999 . . .)

Discrete Mathematics I – p. 220/292

Page 980: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsIs set R countable?

Consider [0, 1] = {a ∈ R : 0 ≤ a < 1}

Decimal representation of a: sequence N → N10

For example, π − 3 = .141592

f(0) = 1 f(1) = 4 f(2) = 1 f(3) = 5 . . .

(For simplicity, ignore .1415000 . . . = .1414999 . . .)

Discrete Mathematics I – p. 220/292

Page 981: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsIs set R countable?

Consider [0, 1] = {a ∈ R : 0 ≤ a < 1}Decimal representation of a: sequence N → N10

For example, π − 3 = .141592

f(0) = 1 f(1) = 4 f(2) = 1 f(3) = 5 . . .

(For simplicity, ignore .1415000 . . . = .1414999 . . .)

Discrete Mathematics I – p. 220/292

Page 982: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsIs set R countable?

Consider [0, 1] = {a ∈ R : 0 ≤ a < 1}Decimal representation of a: sequence N → N10

For example, π − 3 = .141592

f(0) = 1 f(1) = 4 f(2) = 1 f(3) = 5 . . .

(For simplicity, ignore .1415000 . . . = .1414999 . . .)

Discrete Mathematics I – p. 220/292

Page 983: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsIs set R countable?

Consider [0, 1] = {a ∈ R : 0 ≤ a < 1}Decimal representation of a: sequence N → N10

For example, π − 3 = .141592

f(0) = 1 f(1) = 4 f(2) = 1 f(3) = 5 . . .

(For simplicity, ignore .1415000 . . . = .1414999 . . .)

Discrete Mathematics I – p. 220/292

Page 984: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsIs set R countable?

Consider [0, 1] = {a ∈ R : 0 ≤ a < 1}Decimal representation of a: sequence N → N10

For example, π − 3 = .141592

f(0) = 1 f(1) = 4 f(2) = 1 f(3) = 5 . . .

(For simplicity, ignore .1415000 . . . = .1414999 . . .)

Discrete Mathematics I – p. 220/292

Page 985: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsB = {F, T} ∼= {0, 1} = N2 ⊆ N10 =⇒

B(N) = {f : N → B} ∼={f : N → N2} ⊆ {f : N → N10} ∼= [0, 1]

B(N) uncountable, hence [0, 1] uncountable

Therefore, R uncountable

Discrete Mathematics I – p. 221/292

Page 986: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsB = {F, T} ∼= {0, 1} = N2 ⊆ N10 =⇒B(N) = {f : N → B} ∼=

{f : N → N2} ⊆ {f : N → N10} ∼= [0, 1]

B(N) uncountable, hence [0, 1] uncountable

Therefore, R uncountable

Discrete Mathematics I – p. 221/292

Page 987: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsB = {F, T} ∼= {0, 1} = N2 ⊆ N10 =⇒B(N) = {f : N → B} ∼=

{f : N → N2} ⊆ {f : N → N10} ∼= [0, 1]

B(N) uncountable, hence [0, 1] uncountable

Therefore, R uncountable

Discrete Mathematics I – p. 221/292

Page 988: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsB = {F, T} ∼= {0, 1} = N2 ⊆ N10 =⇒B(N) = {f : N → B} ∼=

{f : N → N2} ⊆ {f : N → N10} ∼= [0, 1]

B(N) uncountable, hence [0, 1] uncountable

Therefore, R uncountable

Discrete Mathematics I – p. 221/292

Page 989: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFinite sets:

n elements, n− 1 gaps

Infinite sets:

R are gaps in Q, but R is much bigger than Q

Weird!

Discrete Mathematics I – p. 222/292

Page 990: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFinite sets:

n elements, n− 1 gaps

Infinite sets:

R are gaps in Q, but R is much bigger than Q

Weird!

Discrete Mathematics I – p. 222/292

Page 991: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFinite sets:

n elements, n− 1 gaps

Infinite sets:

R are gaps in Q, but R is much bigger than Q

Weird!

Discrete Mathematics I – p. 222/292

Page 992: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFinite sets:

n elements, n− 1 gaps

Infinite sets:

R are gaps in Q, but R is much bigger than Q

Weird!

Discrete Mathematics I – p. 222/292

Page 993: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFinite sets:

n elements, n− 1 gaps

Infinite sets:

R are gaps in Q, but R is much bigger than Q

Weird!

Discrete Mathematics I – p. 222/292

Page 994: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsFinite sets:

n elements, n− 1 gaps

Infinite sets:

R are gaps in Q, but R is much bigger than Q

Weird!

Discrete Mathematics I – p. 222/292

Page 995: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN, P(N), P(P(N)), . . . — uncountable

All of different cardinalities — and there any manymore. . .

So much more they don’t even form a set!

Discrete Mathematics I – p. 223/292

Page 996: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN, P(N), P(P(N)), . . . — uncountable

All of different cardinalities — and there any manymore. . .

So much more they don’t even form a set!

Discrete Mathematics I – p. 223/292

Page 997: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

FunctionsN, P(N), P(P(N)), . . . — uncountable

All of different cardinalities — and there any manymore. . .

So much more they don’t even form a set!

Discrete Mathematics I – p. 223/292

Page 998: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Induction

Discrete Mathematics I – p. 224/292

Page 999: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionNatural numbers: N = {0, 1, 2, 3, 4, 5, 6, 7, . . . }

God created the natural numbers, all the restis the work of man.

L. Kronecker (1823–1891)

Discrete Mathematics I – p. 225/292

Page 1000: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionNatural numbers: N = {0, 1, 2, 3, 4, 5, 6, 7, . . . }

God created the natural numbers, all the restis the work of man.

L. Kronecker (1823–1891)

Discrete Mathematics I – p. 225/292

Page 1001: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionThe only possible definition of N is self-referential:

• 0 ∈ N

• for all x ∈ N next(x) ∈ N

• everything else 6∈ N

This is an inductive definition

Discrete Mathematics I – p. 226/292

Page 1002: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionThe only possible definition of N is self-referential:

• 0 ∈ N

• for all x ∈ N next(x) ∈ N

• everything else 6∈ N

This is an inductive definition

Discrete Mathematics I – p. 226/292

Page 1003: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionThe only possible definition of N is self-referential:

• 0 ∈ N

• for all x ∈ N next(x) ∈ N

• everything else 6∈ N

This is an inductive definition

Discrete Mathematics I – p. 226/292

Page 1004: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionThe only possible definition of N is self-referential:

• 0 ∈ N

• for all x ∈ N next(x) ∈ N

• everything else 6∈ N

This is an inductive definition

Discrete Mathematics I – p. 226/292

Page 1005: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionThe only possible definition of N is self-referential:

• 0 ∈ N

• for all x ∈ N next(x) ∈ N

• everything else 6∈ N

This is an inductive definition

Discrete Mathematics I – p. 226/292

Page 1006: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionStructure of inductive definition:

• induction base

• inductive step(s)

• completeness (sometimes implicit)

Discrete Mathematics I – p. 227/292

Page 1007: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionStructure of inductive definition:

• induction base

• inductive step(s)

• completeness (sometimes implicit)

Discrete Mathematics I – p. 227/292

Page 1008: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionStructure of inductive definition:

• induction base

• inductive step(s)

• completeness (sometimes implicit)

Discrete Mathematics I – p. 227/292

Page 1009: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionStructure of inductive definition:

• induction base

• inductive step(s)

• completeness (sometimes implicit)

Discrete Mathematics I – p. 227/292

Page 1010: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionFor example, a queue:

• the empty set ∅ is a queue;

• a queue with a new person behind is still a queue

• every queue is formed in this way

If we know what “behind” means, all works!

Discrete Mathematics I – p. 228/292

Page 1011: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionFor example, a queue:

• the empty set ∅ is a queue;

• a queue with a new person behind is still a queue

• every queue is formed in this way

If we know what “behind” means, all works!

Discrete Mathematics I – p. 228/292

Page 1012: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionFor example, a queue:

• the empty set ∅ is a queue;

• a queue with a new person behind is still a queue

• every queue is formed in this way

If we know what “behind” means, all works!

Discrete Mathematics I – p. 228/292

Page 1013: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionFor example, a queue:

• the empty set ∅ is a queue;

• a queue with a new person behind is still a queue

• every queue is formed in this way

If we know what “behind” means, all works!

Discrete Mathematics I – p. 228/292

Page 1014: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionFor example, a queue:

• the empty set ∅ is a queue;

• a queue with a new person behind is still a queue

• every queue is formed in this way

If we know what “behind” means, all works!

Discrete Mathematics I – p. 228/292

Page 1015: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionAnother example: Boolean statements

• F , T are statements

• if A, B are statements, then ¬A, A ∧B, A ∨B,A ⇒ B, A ⇔ B are statements

• there are no other statements

Discrete Mathematics I – p. 229/292

Page 1016: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionAnother example: Boolean statements

• F , T are statements

• if A, B are statements, then ¬A, A ∧B, A ∨B,A ⇒ B, A ⇔ B are statements

• there are no other statements

Discrete Mathematics I – p. 229/292

Page 1017: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionAnother example: Boolean statements

• F , T are statements

• if A, B are statements, then ¬A, A ∧B, A ∨B,A ⇒ B, A ⇔ B are statements

• there are no other statements

Discrete Mathematics I – p. 229/292

Page 1018: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionAnother example: Boolean statements

• F , T are statements

• if A, B are statements, then ¬A, A ∧B, A ∨B,A ⇒ B, A ⇔ B are statements

• there are no other statements

Discrete Mathematics I – p. 229/292

Page 1019: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionIn general:

• induction base: initial objects

• inductive step(s): ways to make new objects

• completeness: no other objects allowed!

Discrete Mathematics I – p. 230/292

Page 1020: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionIn general:

• induction base: initial objects

• inductive step(s): ways to make new objects

• completeness: no other objects allowed!

Discrete Mathematics I – p. 230/292

Page 1021: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionIn general:

• induction base: initial objects

• inductive step(s): ways to make new objects

• completeness: no other objects allowed!

Discrete Mathematics I – p. 230/292

Page 1022: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionIn general:

• induction base: initial objects

• inductive step(s): ways to make new objects

• completeness: no other objects allowed!

Discrete Mathematics I – p. 230/292

Page 1023: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive proofs: “the domino principle”

Need to prove ∀x ∈ N : P (x) for some P

• induction base: P (0)

• inductive step: ∀x ∈ N : P (x) ⇒ P (next(x))(here P (x) is the induction hypothesis)

• by completeness, P (x) true for all x ∈ N

Discrete Mathematics I – p. 231/292

Page 1024: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive proofs: “the domino principle”

Need to prove ∀x ∈ N : P (x) for some P

• induction base: P (0)

• inductive step: ∀x ∈ N : P (x) ⇒ P (next(x))(here P (x) is the induction hypothesis)

• by completeness, P (x) true for all x ∈ N

Discrete Mathematics I – p. 231/292

Page 1025: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive proofs: “the domino principle”

Need to prove ∀x ∈ N : P (x) for some P

• induction base: P (0)

• inductive step: ∀x ∈ N : P (x) ⇒ P (next(x))(here P (x) is the induction hypothesis)

• by completeness, P (x) true for all x ∈ N

Discrete Mathematics I – p. 231/292

Page 1026: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive proofs: “the domino principle”

Need to prove ∀x ∈ N : P (x) for some P

• induction base: P (0)

• inductive step: ∀x ∈ N : P (x) ⇒ P (next(x))(here P (x) is the induction hypothesis)

• by completeness, P (x) true for all x ∈ N

Discrete Mathematics I – p. 231/292

Page 1027: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive proofs: “the domino principle”

Need to prove ∀x ∈ N : P (x) for some P

• induction base: P (0)

• inductive step: ∀x ∈ N : P (x) ⇒ P (next(x))(here P (x) is the induction hypothesis)

• by completeness, P (x) true for all x ∈ N

Discrete Mathematics I – p. 231/292

Page 1028: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionExample: plane colouring

Consider n lines in the plane.

Can always colour regions like a chessboard.

Discrete Mathematics I – p. 232/292

Page 1029: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionExample: plane colouring

Consider n lines in the plane.

Can always colour regions like a chessboard.

Discrete Mathematics I – p. 232/292

Page 1030: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionExample: plane colouring

Consider n lines in the plane.

Can always colour regions like a chessboard.

Discrete Mathematics I – p. 232/292

Page 1031: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionExample: plane colouring

Consider n lines in the plane.

Can always colour regions like a chessboard.

Discrete Mathematics I – p. 232/292

Page 1032: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionExample: plane colouring

Consider n lines in the plane.

Can always colour regions like a chessboard.

Discrete Mathematics I – p. 232/292

Page 1033: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProof.

Induction base: n = 0.

Paint the plane white.

Discrete Mathematics I – p. 233/292

Page 1034: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProof.

Induction base: n = 0. Paint the plane white.

Discrete Mathematics I – p. 233/292

Page 1035: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProof.

Induction base: n = 0. Paint the plane white.

Discrete Mathematics I – p. 233/292

Page 1036: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive step. Suppose can colour for n lines.

Need to color for n + 1 lines.

Add another line, invert all colours on one side.

By induction, can colour for all n.

Discrete Mathematics I – p. 234/292

Page 1037: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive step. Suppose can colour for n lines.

Need to color for n + 1 lines.

Add another line, invert all colours on one side.

By induction, can colour for all n.

Discrete Mathematics I – p. 234/292

Page 1038: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive step. Suppose can colour for n lines.

Need to color for n + 1 lines.

Add another line, invert all colours on one side.

By induction, can colour for all n.

Discrete Mathematics I – p. 234/292

Page 1039: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive step. Suppose can colour for n lines.

Need to color for n + 1 lines.

Add another line, invert all colours on one side.

By induction, can colour for all n.

Discrete Mathematics I – p. 234/292

Page 1040: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive step. Suppose can colour for n lines.

Need to color for n + 1 lines.

Add another line, invert all colours on one side.

By induction, can colour for all n.

Discrete Mathematics I – p. 234/292

Page 1041: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionInductive step. Suppose can colour for n lines.

Need to color for n + 1 lines.

Add another line, invert all colours on one side.

By induction, can colour for all n.

Discrete Mathematics I – p. 234/292

Page 1042: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1043: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof.

Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1044: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base:

8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1045: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1046: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1047: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1048: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s.

Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1049: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s.

Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1050: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1051: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1052: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: Any postage ≥ 8p can be paid by 3p and 5pstamps.

Proof. Induction base: 8 = 3 + 5.

Inductive step. Suppose can pay n (n ≥ 8).

We need: can pay n + 1

Case 1: have used a 5. Replace 5 → 3 + 3.

Case 2: have only used 3s. Since n ≥ 8, there are atleast three 3s. Replace 3 + 3 + 3 → 5 + 5.

In both cases have paid n + 1.

By induction, can pay any n ≥ 8.

Discrete Mathematics I – p. 235/292

Page 1053: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: For any finite set A,

|A| = n =⇒ |P(A)| = 2n

Proof. Induction base:

|A| = 0 =⇒ A = ∅ =⇒P(A) = {∅} =⇒ |P(A)| = 1 = 20

Inductive step. Suppose it holds for a given n:for all B |B| = n =⇒ |P(B)| = 2n

We need:for all A |A| = n + 1 =⇒ |P(A)| = 2n+1

Discrete Mathematics I – p. 236/292

Page 1054: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: For any finite set A,

|A| = n =⇒ |P(A)| = 2n

Proof.

Induction base:

|A| = 0 =⇒ A = ∅ =⇒P(A) = {∅} =⇒ |P(A)| = 1 = 20

Inductive step. Suppose it holds for a given n:for all B |B| = n =⇒ |P(B)| = 2n

We need:for all A |A| = n + 1 =⇒ |P(A)| = 2n+1

Discrete Mathematics I – p. 236/292

Page 1055: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: For any finite set A,

|A| = n =⇒ |P(A)| = 2n

Proof. Induction base:

|A| = 0 =⇒ A = ∅ =⇒P(A) = {∅} =⇒ |P(A)| = 1 = 20

Inductive step. Suppose it holds for a given n:for all B |B| = n =⇒ |P(B)| = 2n

We need:for all A |A| = n + 1 =⇒ |P(A)| = 2n+1

Discrete Mathematics I – p. 236/292

Page 1056: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: For any finite set A,

|A| = n =⇒ |P(A)| = 2n

Proof. Induction base:

|A| = 0 =⇒

A = ∅ =⇒P(A) = {∅} =⇒ |P(A)| = 1 = 20

Inductive step. Suppose it holds for a given n:for all B |B| = n =⇒ |P(B)| = 2n

We need:for all A |A| = n + 1 =⇒ |P(A)| = 2n+1

Discrete Mathematics I – p. 236/292

Page 1057: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: For any finite set A,

|A| = n =⇒ |P(A)| = 2n

Proof. Induction base:

|A| = 0 =⇒ A = ∅ =⇒

P(A) = {∅} =⇒ |P(A)| = 1 = 20

Inductive step. Suppose it holds for a given n:for all B |B| = n =⇒ |P(B)| = 2n

We need:for all A |A| = n + 1 =⇒ |P(A)| = 2n+1

Discrete Mathematics I – p. 236/292

Page 1058: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: For any finite set A,

|A| = n =⇒ |P(A)| = 2n

Proof. Induction base:

|A| = 0 =⇒ A = ∅ =⇒P(A) = {∅} =⇒

|P(A)| = 1 = 20

Inductive step. Suppose it holds for a given n:for all B |B| = n =⇒ |P(B)| = 2n

We need:for all A |A| = n + 1 =⇒ |P(A)| = 2n+1

Discrete Mathematics I – p. 236/292

Page 1059: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: For any finite set A,

|A| = n =⇒ |P(A)| = 2n

Proof. Induction base:

|A| = 0 =⇒ A = ∅ =⇒P(A) = {∅} =⇒ |P(A)| = 1 = 20

Inductive step. Suppose it holds for a given n:for all B |B| = n =⇒ |P(B)| = 2n

We need:for all A |A| = n + 1 =⇒ |P(A)| = 2n+1

Discrete Mathematics I – p. 236/292

Page 1060: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: For any finite set A,

|A| = n =⇒ |P(A)| = 2n

Proof. Induction base:

|A| = 0 =⇒ A = ∅ =⇒P(A) = {∅} =⇒ |P(A)| = 1 = 20

Inductive step. Suppose it holds for a given n:for all B |B| = n =⇒ |P(B)| = 2n

We need:for all A |A| = n + 1 =⇒ |P(A)| = 2n+1

Discrete Mathematics I – p. 236/292

Page 1061: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet a ∈ A B = A \ {a}.

We have |B| = n, therefore |P(B)| = 2n.

Let P = P(B) Q = {X ∪ {a} | X ∈ P}P(A) = P ∪Q P ∩Q = ∅ |P | = |Q| = 2n

Hence |P(A)| = |P |+ |Q| = 2n + 2n = 2n · 2 = 2n+1

By induction, statement true for all A

Discrete Mathematics I – p. 237/292

Page 1062: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet a ∈ A B = A \ {a}.

We have |B| = n, therefore |P(B)| = 2n.

Let P = P(B) Q = {X ∪ {a} | X ∈ P}P(A) = P ∪Q P ∩Q = ∅ |P | = |Q| = 2n

Hence |P(A)| = |P |+ |Q| = 2n + 2n = 2n · 2 = 2n+1

By induction, statement true for all A

Discrete Mathematics I – p. 237/292

Page 1063: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet a ∈ A B = A \ {a}.

We have |B| = n, therefore |P(B)| = 2n.

Let P = P(B)

Q = {X ∪ {a} | X ∈ P}P(A) = P ∪Q P ∩Q = ∅ |P | = |Q| = 2n

Hence |P(A)| = |P |+ |Q| = 2n + 2n = 2n · 2 = 2n+1

By induction, statement true for all A

Discrete Mathematics I – p. 237/292

Page 1064: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet a ∈ A B = A \ {a}.

We have |B| = n, therefore |P(B)| = 2n.

Let P = P(B) Q = {X ∪ {a} | X ∈ P}

P(A) = P ∪Q P ∩Q = ∅ |P | = |Q| = 2n

Hence |P(A)| = |P |+ |Q| = 2n + 2n = 2n · 2 = 2n+1

By induction, statement true for all A

Discrete Mathematics I – p. 237/292

Page 1065: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet a ∈ A B = A \ {a}.

We have |B| = n, therefore |P(B)| = 2n.

Let P = P(B) Q = {X ∪ {a} | X ∈ P}P(A) = P ∪Q

P ∩Q = ∅ |P | = |Q| = 2n

Hence |P(A)| = |P |+ |Q| = 2n + 2n = 2n · 2 = 2n+1

By induction, statement true for all A

Discrete Mathematics I – p. 237/292

Page 1066: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet a ∈ A B = A \ {a}.

We have |B| = n, therefore |P(B)| = 2n.

Let P = P(B) Q = {X ∪ {a} | X ∈ P}P(A) = P ∪Q P ∩Q = ∅

|P | = |Q| = 2n

Hence |P(A)| = |P |+ |Q| = 2n + 2n = 2n · 2 = 2n+1

By induction, statement true for all A

Discrete Mathematics I – p. 237/292

Page 1067: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet a ∈ A B = A \ {a}.

We have |B| = n, therefore |P(B)| = 2n.

Let P = P(B) Q = {X ∪ {a} | X ∈ P}P(A) = P ∪Q P ∩Q = ∅ |P | = |Q| = 2n

Hence |P(A)| = |P |+ |Q| = 2n + 2n = 2n · 2 = 2n+1

By induction, statement true for all A

Discrete Mathematics I – p. 237/292

Page 1068: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet a ∈ A B = A \ {a}.

We have |B| = n, therefore |P(B)| = 2n.

Let P = P(B) Q = {X ∪ {a} | X ∈ P}P(A) = P ∪Q P ∩Q = ∅ |P | = |Q| = 2n

Hence |P(A)| = |P |+ |Q| = 2n + 2n = 2n · 2 = 2n+1

By induction, statement true for all A

Discrete Mathematics I – p. 237/292

Page 1069: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet a ∈ A B = A \ {a}.

We have |B| = n, therefore |P(B)| = 2n.

Let P = P(B) Q = {X ∪ {a} | X ∈ P}P(A) = P ∪Q P ∩Q = ∅ |P | = |Q| = 2n

Hence |P(A)| = |P |+ |Q| = 2n + 2n = 2n · 2 = 2n+1

By induction, statement true for all A

Discrete Mathematics I – p. 237/292

Page 1070: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionConsider induction on n ∈ N

Inductive step: P (n) ⇒ P (n + 1)

Suppose can only prove:(

P (0) ∧ P (1) ∧ · · · ∧ P (n− 1))

⇒ P (n)

(Also covers T ⇒ P (0))

So-called “strong” induction(in fact, the implication has become weaker!)

Does P (n) still hold for all n?

Discrete Mathematics I – p. 238/292

Page 1071: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionConsider induction on n ∈ N

Inductive step: P (n) ⇒ P (n + 1)

Suppose can only prove:(

P (0) ∧ P (1) ∧ · · · ∧ P (n− 1))

⇒ P (n)

(Also covers T ⇒ P (0))

So-called “strong” induction(in fact, the implication has become weaker!)

Does P (n) still hold for all n?

Discrete Mathematics I – p. 238/292

Page 1072: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionConsider induction on n ∈ N

Inductive step: P (n) ⇒ P (n + 1)

Suppose can only prove:(

P (0) ∧ P (1) ∧ · · · ∧ P (n− 1))

⇒ P (n)

(Also covers T ⇒ P (0))

So-called “strong” induction(in fact, the implication has become weaker!)

Does P (n) still hold for all n?

Discrete Mathematics I – p. 238/292

Page 1073: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionConsider induction on n ∈ N

Inductive step: P (n) ⇒ P (n + 1)

Suppose can only prove:(

P (0) ∧ P (1) ∧ · · · ∧ P (n− 1))

⇒ P (n)

(Also covers T ⇒ P (0))

So-called “strong” induction(in fact, the implication has become weaker!)

Does P (n) still hold for all n?

Discrete Mathematics I – p. 238/292

Page 1074: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionConsider induction on n ∈ N

Inductive step: P (n) ⇒ P (n + 1)

Suppose can only prove:(

P (0) ∧ P (1) ∧ · · · ∧ P (n− 1))

⇒ P (n)

(Also covers T ⇒ P (0))

So-called “strong” induction(in fact, the implication has become weaker!)

Does P (n) still hold for all n?

Discrete Mathematics I – p. 238/292

Page 1075: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionConsider induction on n ∈ N

Inductive step: P (n) ⇒ P (n + 1)

Suppose can only prove:(

P (0) ∧ P (1) ∧ · · · ∧ P (n− 1))

⇒ P (n)

(Also covers T ⇒ P (0))

So-called “strong” induction(in fact, the implication has become weaker!)

Does P (n) still hold for all n?

Discrete Mathematics I – p. 238/292

Page 1076: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet Q(n) ⇐⇒ P (0) ∧ P (1) ∧ · · · ∧ P (n)

We need: ∀n ∈ N : Q(n) ( =⇒ ∀n ∈ N : P (n))

T ⇒ P (0) ⇐⇒ P (0) ⇐⇒ Q(0) induction base

Q(n) ⇐⇒ P (0)∧P (1)∧ · · · ∧P (n) =⇒ P (n+1)(

P (0) ∧ · · · ∧ P (n))

∧ P (n + 1) ⇐⇒ Q(n + 1)

Hence Q(n) ⇒ Q(n + 1) inductive step

By induction, ∀n : Q(n), therefore ∀n : P (n)

Discrete Mathematics I – p. 239/292

Page 1077: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet Q(n) ⇐⇒ P (0) ∧ P (1) ∧ · · · ∧ P (n)

We need: ∀n ∈ N : Q(n) ( =⇒ ∀n ∈ N : P (n))

T ⇒ P (0) ⇐⇒ P (0) ⇐⇒ Q(0) induction base

Q(n) ⇐⇒ P (0)∧P (1)∧ · · · ∧P (n) =⇒ P (n+1)(

P (0) ∧ · · · ∧ P (n))

∧ P (n + 1) ⇐⇒ Q(n + 1)

Hence Q(n) ⇒ Q(n + 1) inductive step

By induction, ∀n : Q(n), therefore ∀n : P (n)

Discrete Mathematics I – p. 239/292

Page 1078: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet Q(n) ⇐⇒ P (0) ∧ P (1) ∧ · · · ∧ P (n)

We need: ∀n ∈ N : Q(n) ( =⇒ ∀n ∈ N : P (n))

T ⇒ P (0) ⇐⇒ P (0) ⇐⇒ Q(0)

induction base

Q(n) ⇐⇒ P (0)∧P (1)∧ · · · ∧P (n) =⇒ P (n+1)(

P (0) ∧ · · · ∧ P (n))

∧ P (n + 1) ⇐⇒ Q(n + 1)

Hence Q(n) ⇒ Q(n + 1) inductive step

By induction, ∀n : Q(n), therefore ∀n : P (n)

Discrete Mathematics I – p. 239/292

Page 1079: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet Q(n) ⇐⇒ P (0) ∧ P (1) ∧ · · · ∧ P (n)

We need: ∀n ∈ N : Q(n) ( =⇒ ∀n ∈ N : P (n))

T ⇒ P (0) ⇐⇒ P (0) ⇐⇒ Q(0) induction base

Q(n) ⇐⇒ P (0)∧P (1)∧ · · · ∧P (n) =⇒ P (n+1)(

P (0) ∧ · · · ∧ P (n))

∧ P (n + 1) ⇐⇒ Q(n + 1)

Hence Q(n) ⇒ Q(n + 1) inductive step

By induction, ∀n : Q(n), therefore ∀n : P (n)

Discrete Mathematics I – p. 239/292

Page 1080: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet Q(n) ⇐⇒ P (0) ∧ P (1) ∧ · · · ∧ P (n)

We need: ∀n ∈ N : Q(n) ( =⇒ ∀n ∈ N : P (n))

T ⇒ P (0) ⇐⇒ P (0) ⇐⇒ Q(0) induction base

Q(n) ⇐⇒ P (0)∧P (1)∧ · · · ∧P (n) =⇒ P (n+1)

(

P (0) ∧ · · · ∧ P (n))

∧ P (n + 1) ⇐⇒ Q(n + 1)

Hence Q(n) ⇒ Q(n + 1) inductive step

By induction, ∀n : Q(n), therefore ∀n : P (n)

Discrete Mathematics I – p. 239/292

Page 1081: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet Q(n) ⇐⇒ P (0) ∧ P (1) ∧ · · · ∧ P (n)

We need: ∀n ∈ N : Q(n) ( =⇒ ∀n ∈ N : P (n))

T ⇒ P (0) ⇐⇒ P (0) ⇐⇒ Q(0) induction base

Q(n) ⇐⇒ P (0)∧P (1)∧ · · · ∧P (n) =⇒ P (n+1)(

P (0) ∧ · · · ∧ P (n))

∧ P (n + 1) ⇐⇒ Q(n + 1)

Hence Q(n) ⇒ Q(n + 1) inductive step

By induction, ∀n : Q(n), therefore ∀n : P (n)

Discrete Mathematics I – p. 239/292

Page 1082: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet Q(n) ⇐⇒ P (0) ∧ P (1) ∧ · · · ∧ P (n)

We need: ∀n ∈ N : Q(n) ( =⇒ ∀n ∈ N : P (n))

T ⇒ P (0) ⇐⇒ P (0) ⇐⇒ Q(0) induction base

Q(n) ⇐⇒ P (0)∧P (1)∧ · · · ∧P (n) =⇒ P (n+1)(

P (0) ∧ · · · ∧ P (n))

∧ P (n + 1) ⇐⇒ Q(n + 1)

Hence Q(n) ⇒ Q(n + 1)

inductive step

By induction, ∀n : Q(n), therefore ∀n : P (n)

Discrete Mathematics I – p. 239/292

Page 1083: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet Q(n) ⇐⇒ P (0) ∧ P (1) ∧ · · · ∧ P (n)

We need: ∀n ∈ N : Q(n) ( =⇒ ∀n ∈ N : P (n))

T ⇒ P (0) ⇐⇒ P (0) ⇐⇒ Q(0) induction base

Q(n) ⇐⇒ P (0)∧P (1)∧ · · · ∧P (n) =⇒ P (n+1)(

P (0) ∧ · · · ∧ P (n))

∧ P (n + 1) ⇐⇒ Q(n + 1)

Hence Q(n) ⇒ Q(n + 1) inductive step

By induction, ∀n : Q(n), therefore ∀n : P (n)

Discrete Mathematics I – p. 239/292

Page 1084: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionLet Q(n) ⇐⇒ P (0) ∧ P (1) ∧ · · · ∧ P (n)

We need: ∀n ∈ N : Q(n) ( =⇒ ∀n ∈ N : P (n))

T ⇒ P (0) ⇐⇒ P (0) ⇐⇒ Q(0) induction base

Q(n) ⇐⇒ P (0)∧P (1)∧ · · · ∧P (n) =⇒ P (n+1)(

P (0) ∧ · · · ∧ P (n))

∧ P (n + 1) ⇐⇒ Q(n + 1)

Hence Q(n) ⇒ Q(n + 1) inductive step

By induction, ∀n : Q(n), therefore ∀n : P (n)

Discrete Mathematics I – p. 239/292

Page 1085: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1086: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof.

Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1087: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base:

2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1088: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1089: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1090: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | n

Case 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1091: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | n

Then ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1092: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1093: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | n

In both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1094: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1095: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

InductionProve: ∀n ∈ N : n ≥ 2 ⇒ n is divisible by a prime

Proof. Induction base: 2 | 2 prime

Inductive step. Suppose true ∀m < n. True for n?

Case 1: n prime n | nCase 2: ∃m < n : m | nThen ∃p : (p prime) ∧ (p | m)

(p | m) ∧ (m | n) =⇒ p | nIn both cases n divisible by a prime

By induction, all n ≥ 2 divisible by a prime

Discrete Mathematics I – p. 240/292

Page 1096: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Discrete Mathematics I – p. 241/292

Page 1097: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

The Königsberg Bridges (L. Euler, 1707–1783)

A tour crossing every bridge exactly once?

Discrete Mathematics I – p. 242/292

Page 1098: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

The Königsberg Bridges (L. Euler, 1707–1783)

A tour crossing every bridge exactly once?

Discrete Mathematics I – p. 242/292

Page 1099: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

The Königsberg Bridges (L. Euler, 1707–1783)

A tour crossing every bridge exactly once?

Discrete Mathematics I – p. 242/292

Page 1100: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

The Königsberg Bridges graph

��

�� ��

� �

� ��

��

4 • nodes (islands) 7 ◦ nodes (bridges)

Discrete Mathematics I – p. 243/292

Page 1101: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

Discrete Mathematics I – p. 244/292

Page 1102: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

Discrete Mathematics I – p. 244/292

Page 1103: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

Discrete Mathematics I – p. 244/292

Page 1104: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

Discrete Mathematics I – p. 244/292

Page 1105: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

Discrete Mathematics I – p. 244/292

Page 1106: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

� FWC

G

Discrete Mathematics I – p. 244/292

Page 1107: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

� FWC

G

C

FWG

Discrete Mathematics I – p. 244/292

Page 1108: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

� FWC

G

C

FWG �

FGC

W

Discrete Mathematics I – p. 244/292

Page 1109: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

� FWC

G

C

FWG �

FGC

W

�G

FWC

Discrete Mathematics I – p. 244/292

Page 1110: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

� FWC

G

C

FWG �

FGC

W

�G

FWC

FG

WC

Discrete Mathematics I – p. 244/292

Page 1111: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

� FWC

G

C

FWG �

FGC

W

�G

FWC

FG

WC

FWGC

Discrete Mathematics I – p. 244/292

Page 1112: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

� FWC

G

C

FWG �

FGC

W

�G

FWC

FG

WC

FWGC

W

FGC

Discrete Mathematics I – p. 244/292

Page 1113: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

� FWC

G

C

FWG �

FGC

W

�G

FWC

FG

WC

FWGC

W

FGC

FGW

C

Discrete Mathematics I – p. 244/292

Page 1114: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Wolf, goat and cabbage

Farmer wants to take W , G, C across the riverCan only take one item at a time

W eats G, G eats C — farmer must keep an eye

FWGC

WC

FG

� FWC

G

C

FWG �

FGC

W

�G

FWC

FG

WC

FWGC

W

FGC

FGW

C

Discrete Mathematics I – p. 244/292

Page 1115: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Houses and wells

Each of 3 houses needs a path to each of 3 wells

Paths must not cross

H1

H2�

H3

W1

W2

W3

Discrete Mathematics I – p. 245/292

Page 1116: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Houses and wells

Each of 3 houses needs a path to each of 3 wells

Paths must not cross

H1

H2�

H3

W1

W2

W3

Discrete Mathematics I – p. 245/292

Page 1117: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Houses and wells

Each of 3 houses needs a path to each of 3 wells

Paths must not cross

H1

H2�

H3

W1

W2

W3

Discrete Mathematics I – p. 245/292

Page 1118: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Houses and wells

Each of 3 houses needs a path to each of 3 wells

Paths must not cross

H1

H2�

H3

W1

W2

W3

Discrete Mathematics I – p. 245/292

Page 1119: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Houses and wells

Each of 3 houses needs a path to each of 3 wells

Paths must not cross

H1

H2�

H3

W1

W2

W3

Discrete Mathematics I – p. 245/292

Page 1120: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — finite set, elements called nodes R⇀ : V ↔ V

R⇀ called irreflexive, if ∀a ∈ A : ¬(a ⇀ a)

R⇀ called symmetric, if ∀a, b ∈ A : a ⇀ b ⇒ b ⇀ a

A graph is an irreflexive, symmetric relationE = R⇀ : V ↔ V

Nodes u, v called adjacent, if u ⇀ v

Pairs in E called edges

Common notation: graph G = (V, E)

Discrete Mathematics I – p. 246/292

Page 1121: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — finite set, elements called nodes R⇀ : V ↔ V

R⇀ called irreflexive, if ∀a ∈ A : ¬(a ⇀ a)

R⇀ called symmetric, if ∀a, b ∈ A : a ⇀ b ⇒ b ⇀ a

A graph is an irreflexive, symmetric relationE = R⇀ : V ↔ V

Nodes u, v called adjacent, if u ⇀ v

Pairs in E called edges

Common notation: graph G = (V, E)

Discrete Mathematics I – p. 246/292

Page 1122: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — finite set, elements called nodes R⇀ : V ↔ V

R⇀ called irreflexive, if ∀a ∈ A : ¬(a ⇀ a)

R⇀ called symmetric, if ∀a, b ∈ A : a ⇀ b ⇒ b ⇀ a

A graph is an irreflexive, symmetric relationE = R⇀ : V ↔ V

Nodes u, v called adjacent, if u ⇀ v

Pairs in E called edges

Common notation: graph G = (V, E)

Discrete Mathematics I – p. 246/292

Page 1123: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — finite set, elements called nodes R⇀ : V ↔ V

R⇀ called irreflexive, if ∀a ∈ A : ¬(a ⇀ a)

R⇀ called symmetric, if ∀a, b ∈ A : a ⇀ b ⇒ b ⇀ a

A graph is an irreflexive, symmetric relationE = R⇀ : V ↔ V

Nodes u, v called adjacent, if u ⇀ v

Pairs in E called edges

Common notation: graph G = (V, E)

Discrete Mathematics I – p. 246/292

Page 1124: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — finite set, elements called nodes R⇀ : V ↔ V

R⇀ called irreflexive, if ∀a ∈ A : ¬(a ⇀ a)

R⇀ called symmetric, if ∀a, b ∈ A : a ⇀ b ⇒ b ⇀ a

A graph is an irreflexive, symmetric relationE = R⇀ : V ↔ V

Nodes u, v called adjacent, if u ⇀ v

Pairs in E called edges

Common notation: graph G = (V, E)

Discrete Mathematics I – p. 246/292

Page 1125: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — finite set, elements called nodes R⇀ : V ↔ V

R⇀ called irreflexive, if ∀a ∈ A : ¬(a ⇀ a)

R⇀ called symmetric, if ∀a, b ∈ A : a ⇀ b ⇒ b ⇀ a

A graph is an irreflexive, symmetric relationE = R⇀ : V ↔ V

Nodes u, v called adjacent, if u ⇀ v

Pairs in E called edges

Common notation: graph G = (V, E)

Discrete Mathematics I – p. 246/292

Page 1126: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — finite set, elements called nodes R⇀ : V ↔ V

R⇀ called irreflexive, if ∀a ∈ A : ¬(a ⇀ a)

R⇀ called symmetric, if ∀a, b ∈ A : a ⇀ b ⇒ b ⇀ a

A graph is an irreflexive, symmetric relationE = R⇀ : V ↔ V

Nodes u, v called adjacent, if u ⇀ v

Pairs in E called edges

Common notation: graph G = (V, E)

Discrete Mathematics I – p. 246/292

Page 1127: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

The complete graph on V : K(V ) = (V, E)where E = {(u, v) ∈ V 2 | u 6= v}

0

1

2

3 4

K(N5)

The complete graph on n nodes: K(n)

Discrete Mathematics I – p. 247/292

Page 1128: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

The complete graph on V : K(V ) = (V, E)where E = {(u, v) ∈ V 2 | u 6= v}

� 0

1

�2

3

4

K(N5)

The complete graph on n nodes: K(n)

Discrete Mathematics I – p. 247/292

Page 1129: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

The complete graph on V : K(V ) = (V, E)where E = {(u, v) ∈ V 2 | u 6= v}

� 0

1

�2

3

4

K(N5)

The complete graph on n nodes: K(n)

Discrete Mathematics I – p. 247/292

Page 1130: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Different graphs may be “similar”

Two graphs are called isomorphic, if there is abijection between their node sets, which preserves theedges

G1 = (V1, E1) G2 = (V2, E2)

G1∼= G2 ⇐⇒ ∃f : V1��V2 :

∀u, v ∈ V1 : (u, v) ∈ E1 ⇔ (f(u), f(v)) ∈ E2

Bijection f is the isomorphism between G1, G2

Discrete Mathematics I – p. 248/292

Page 1131: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Different graphs may be “similar”

Two graphs are called isomorphic, if there is abijection between their node sets, which preserves theedges

G1 = (V1, E1) G2 = (V2, E2)

G1∼= G2 ⇐⇒ ∃f : V1��V2 :

∀u, v ∈ V1 : (u, v) ∈ E1 ⇔ (f(u), f(v)) ∈ E2

Bijection f is the isomorphism between G1, G2

Discrete Mathematics I – p. 248/292

Page 1132: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Different graphs may be “similar”

Two graphs are called isomorphic, if there is abijection between their node sets, which preserves theedges

G1 = (V1, E1) G2 = (V2, E2)

G1∼= G2 ⇐⇒ ∃f : V1��V2 :

∀u, v ∈ V1 : (u, v) ∈ E1 ⇔ (f(u), f(v)) ∈ E2

Bijection f is the isomorphism between G1, G2

Discrete Mathematics I – p. 248/292

Page 1133: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Different graphs may be “similar”

Two graphs are called isomorphic, if there is abijection between their node sets, which preserves theedges

G1 = (V1, E1) G2 = (V2, E2)

G1∼= G2 ⇐⇒ ∃f : V1��V2 :

∀u, v ∈ V1 : (u, v) ∈ E1 ⇔ (f(u), f(v)) ∈ E2

Bijection f is the isomorphism between G1, G2

Discrete Mathematics I – p. 248/292

Page 1134: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Different graphs may be “similar”

Two graphs are called isomorphic, if there is abijection between their node sets, which preserves theedges

G1 = (V1, E1) G2 = (V2, E2)

G1∼= G2 ⇐⇒ ∃f : V1��V2 :

∀u, v ∈ V1 : (u, v) ∈ E1 ⇔ (f(u), f(v)) ∈ E2

Bijection f is the isomorphism between G1, G2

Discrete Mathematics I – p. 248/292

Page 1135: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

0

2

1

3

4

0

2

1

3

4

0

1

2

3

4

Discrete Mathematics I – p. 249/292

Page 1136: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

0

�2 �1

3

4

�0

�2 �1�

3

4

0

1

2

3

�4

Discrete Mathematics I – p. 249/292

Page 1137: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) V = V1 ∪ V2 V1 ∩ V2 = ∅

G called bipartite (or two-coloured), if

• for all u, v ∈ V1, (u, v) 6∈ E

• for all u, v ∈ V2, (u, v) 6∈ E

Sets V1, V2 called colour classes of G

Discrete Mathematics I – p. 250/292

Page 1138: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) V = V1 ∪ V2 V1 ∩ V2 = ∅G called bipartite (or two-coloured), if

• for all u, v ∈ V1, (u, v) 6∈ E

• for all u, v ∈ V2, (u, v) 6∈ E

Sets V1, V2 called colour classes of G

Discrete Mathematics I – p. 250/292

Page 1139: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) V = V1 ∪ V2 V1 ∩ V2 = ∅G called bipartite (or two-coloured), if

• for all u, v ∈ V1, (u, v) 6∈ E

• for all u, v ∈ V2, (u, v) 6∈ E

Sets V1, V2 called colour classes of G

Discrete Mathematics I – p. 250/292

Page 1140: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

��

�� ��

� �

� ��

��

The Königsberg Bridges graph is bipartite

Discrete Mathematics I – p. 251/292

Page 1141: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

��

�� ��

� �

� ��

��

The Königsberg Bridges graph is bipartite

Discrete Mathematics I – p. 251/292

Page 1142: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

� �� �

�� �

�� �

� �

The wolf/goat/cabbage graph is bipartite

Discrete Mathematics I – p. 252/292

Page 1143: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

� �� �

�� �

�� �

� �

The wolf/goat/cabbage graph is bipartite

Discrete Mathematics I – p. 252/292

Page 1144: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V1 ∩ V2 = ∅

Bipartite graph with all possible edges between V1, V2

is called complete bipartite

K(V1, V2) = (V1 ∪ V2, (V1 × V2) ∪ (V2 × V1))

The complete bipartite graph on m + n nodes:K(m, n)

Can also define n-partite (n-coloured), and completen-partite graph

Discrete Mathematics I – p. 253/292

Page 1145: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V1 ∩ V2 = ∅Bipartite graph with all possible edges between V1, V2

is called complete bipartite

K(V1, V2) = (V1 ∪ V2, (V1 × V2) ∪ (V2 × V1))

The complete bipartite graph on m + n nodes:K(m, n)

Can also define n-partite (n-coloured), and completen-partite graph

Discrete Mathematics I – p. 253/292

Page 1146: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V1 ∩ V2 = ∅Bipartite graph with all possible edges between V1, V2

is called complete bipartite

K(V1, V2) = (V1 ∪ V2, (V1 × V2) ∪ (V2 × V1))

The complete bipartite graph on m + n nodes:K(m, n)

Can also define n-partite (n-coloured), and completen-partite graph

Discrete Mathematics I – p. 253/292

Page 1147: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V1 ∩ V2 = ∅Bipartite graph with all possible edges between V1, V2

is called complete bipartite

K(V1, V2) = (V1 ∪ V2, (V1 × V2) ∪ (V2 × V1))

The complete bipartite graph on m + n nodes:K(m, n)

Can also define n-partite (n-coloured), and completen-partite graph

Discrete Mathematics I – p. 253/292

Page 1148: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V1 ∩ V2 = ∅Bipartite graph with all possible edges between V1, V2

is called complete bipartite

K(V1, V2) = (V1 ∪ V2, (V1 × V2) ∪ (V2 × V1))

The complete bipartite graph on m + n nodes:K(m, n)

Can also define n-partite (n-coloured), and completen-partite graph

Discrete Mathematics I – p. 253/292

Page 1149: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

H1

H2

H3

��

W1

��W2

��

W3

The houses/wells graph is complete bipartite

K({H1, H2, H3}, {W1, W2, W3})

Discrete Mathematics I – p. 254/292

Page 1150: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

H1

H2

H3

��

W1

��W2

��

W3

The houses/wells graph is complete bipartite

K({H1, H2, H3}, {W1, W2, W3})

Discrete Mathematics I – p. 254/292

Page 1151: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

H1

H2

H3

��

W1

��W2

��

W3

The houses/wells graph is complete bipartite

K({H1, H2, H3}, {W1, W2, W3})

Discrete Mathematics I – p. 254/292

Page 1152: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A walk: sequence (u, u1, . . . , uk−1, v), such that

(u ⇀ u1) ∧ (u1 ⇀ u2) ∧ · · · ∧ (uk−1 ⇀ v)

Nodes u, v connected by a walk: u# v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

A tour is a walk from a node to itself: u# u

Discrete Mathematics I – p. 255/292

Page 1153: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A walk: sequence (u, u1, . . . , uk−1, v), such that

(u ⇀ u1) ∧ (u1 ⇀ u2) ∧ · · · ∧ (uk−1 ⇀ v)

Nodes u, v connected by a walk: u# v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

A tour is a walk from a node to itself: u# u

Discrete Mathematics I – p. 255/292

Page 1154: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A walk: sequence (u, u1, . . . , uk−1, v), such that

(u ⇀ u1) ∧ (u1 ⇀ u2) ∧ · · · ∧ (uk−1 ⇀ v)

Nodes u, v connected by a walk: u# v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

A tour is a walk from a node to itself: u# u

Discrete Mathematics I – p. 255/292

Page 1155: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A walk: sequence (u, u1, . . . , uk−1, v), such that

(u ⇀ u1) ∧ (u1 ⇀ u2) ∧ · · · ∧ (uk−1 ⇀ v)

Nodes u, v connected by a walk: u# v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

A tour is a walk from a node to itself: u# u

Discrete Mathematics I – p. 255/292

Page 1156: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A walk: sequence (u, u1, . . . , uk−1, v), such that

(u ⇀ u1) ∧ (u1 ⇀ u2) ∧ · · · ∧ (uk−1 ⇀ v)

Nodes u, v connected by a walk: u# v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

A tour is a walk from a node to itself: u# u

Discrete Mathematics I – p. 255/292

Page 1157: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A walk: sequence (u, u1, . . . , uk−1, v), such that

(u ⇀ u1) ∧ (u1 ⇀ u2) ∧ · · · ∧ (uk−1 ⇀ v)

Nodes u, v connected by a walk: u# v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

A tour is a walk from a node to itself: u# u

Discrete Mathematics I – p. 255/292

Page 1158: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

�2

3

4

�10

0

5

1

6

�7

8

9

0# 5 : 0 ⇀ 3 ⇀ 1 ⇀ 4 ⇀ 6 ⇀ 3 ⇀ 0 ⇀ 2 ⇀ 5

A tour: 0 ⇀ 3 ⇀ 1 ⇀ 4 ⇀ 6 ⇀ 3 ⇀ 5 ⇀ 2 ⇀ 0

Discrete Mathematics I – p. 256/292

Page 1159: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

�2

3

4

�10

0

5

1

6

�7

8

9

0# 5 : 0 ⇀ 3 ⇀ 1 ⇀ 4 ⇀ 6 ⇀ 3 ⇀ 0 ⇀ 2 ⇀ 5

A tour: 0 ⇀ 3 ⇀ 1 ⇀ 4 ⇀ 6 ⇀ 3 ⇀ 5 ⇀ 2 ⇀ 0

Discrete Mathematics I – p. 256/292

Page 1160: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

�2

3

4

�10

0

5

1

6

�7

8

9

0# 5 : 0 ⇀ 3 ⇀ 1 ⇀ 4 ⇀ 6 ⇀ 3 ⇀ 0 ⇀ 2 ⇀ 5

A tour: 0 ⇀ 3 ⇀ 1 ⇀ 4 ⇀ 6 ⇀ 3 ⇀ 5 ⇀ 2 ⇀ 0

Discrete Mathematics I – p. 256/292

Page 1161: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

For all v ∈ V , (v) is a walk v # v of length 0

For all u, v ∈ V , (u# v) ⇒ (v # u)

For all u, v, w ∈ V , (u# v) ∧ (v # w) ⇒ (u# w)

Therefore R# : V ↔ V is an equivalence relation

Classes of R# called connected components

A graph is connected, if every two nodes areconnected

Discrete Mathematics I – p. 257/292

Page 1162: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

For all v ∈ V , (v) is a walk v # v of length 0

For all u, v ∈ V , (u# v) ⇒ (v # u)

For all u, v, w ∈ V , (u# v) ∧ (v # w) ⇒ (u# w)

Therefore R# : V ↔ V is an equivalence relation

Classes of R# called connected components

A graph is connected, if every two nodes areconnected

Discrete Mathematics I – p. 257/292

Page 1163: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

For all v ∈ V , (v) is a walk v # v of length 0

For all u, v ∈ V , (u# v) ⇒ (v # u)

For all u, v, w ∈ V , (u# v) ∧ (v # w) ⇒ (u# w)

Therefore R# : V ↔ V is an equivalence relation

Classes of R# called connected components

A graph is connected, if every two nodes areconnected

Discrete Mathematics I – p. 257/292

Page 1164: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

For all v ∈ V , (v) is a walk v # v of length 0

For all u, v ∈ V , (u# v) ⇒ (v # u)

For all u, v, w ∈ V , (u# v) ∧ (v # w) ⇒ (u# w)

Therefore R# : V ↔ V is an equivalence relation

Classes of R# called connected components

A graph is connected, if every two nodes areconnected

Discrete Mathematics I – p. 257/292

Page 1165: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

For all v ∈ V , (v) is a walk v # v of length 0

For all u, v ∈ V , (u# v) ⇒ (v # u)

For all u, v, w ∈ V , (u# v) ∧ (v # w) ⇒ (u# w)

Therefore R# : V ↔ V is an equivalence relation

Classes of R# called connected components

A graph is connected, if every two nodes areconnected

Discrete Mathematics I – p. 257/292

Page 1166: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

For all v ∈ V , (v) is a walk v # v of length 0

For all u, v ∈ V , (u# v) ⇒ (v # u)

For all u, v, w ∈ V , (u# v) ∧ (v # w) ⇒ (u# w)

Therefore R# : V ↔ V is an equivalence relation

Classes of R# called connected components

A graph is connected, if every two nodes areconnected

Discrete Mathematics I – p. 257/292

Page 1167: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A path is a walk where all nodes are distinct

Nodes u, v connected by a path: u v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

∀i, j ∈ Nk+1 : i 6= j ⇒ ui 6= uj

A cycle is a tour of length ≥ 3 where all nodes exceptthe final are distinct: u v ⇀ u

A graph without cycles called acyclic

Discrete Mathematics I – p. 258/292

Page 1168: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A path is a walk where all nodes are distinct

Nodes u, v connected by a path: u v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

∀i, j ∈ Nk+1 : i 6= j ⇒ ui 6= uj

A cycle is a tour of length ≥ 3 where all nodes exceptthe final are distinct: u v ⇀ u

A graph without cycles called acyclic

Discrete Mathematics I – p. 258/292

Page 1169: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A path is a walk where all nodes are distinct

Nodes u, v connected by a path: u v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

∀i, j ∈ Nk+1 : i 6= j ⇒ ui 6= uj

A cycle is a tour of length ≥ 3 where all nodes exceptthe final are distinct: u v ⇀ u

A graph without cycles called acyclic

Discrete Mathematics I – p. 258/292

Page 1170: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A path is a walk where all nodes are distinct

Nodes u, v connected by a path: u v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

∀i, j ∈ Nk+1 : i 6= j ⇒ ui 6= uj

A cycle is a tour of length ≥ 3 where all nodes exceptthe final are distinct: u v ⇀ u

A graph without cycles called acyclic

Discrete Mathematics I – p. 258/292

Page 1171: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A path is a walk where all nodes are distinct

Nodes u, v connected by a path: u v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

∀i, j ∈ Nk+1 : i 6= j ⇒ ui 6= uj

A cycle is a tour of length ≥ 3 where all nodes exceptthe final are distinct: u v ⇀ u

A graph without cycles called acyclic

Discrete Mathematics I – p. 258/292

Page 1172: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A path is a walk where all nodes are distinct

Nodes u, v connected by a path: u v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

∀i, j ∈ Nk+1 : i 6= j ⇒ ui 6= uj

A cycle is a tour of length ≥ 3 where all nodes exceptthe final are distinct: u v ⇀ u

A graph without cycles called acyclic

Discrete Mathematics I – p. 258/292

Page 1173: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

A path is a walk where all nodes are distinct

Nodes u, v connected by a path: u v

u = u0 ⇀ u1 ⇀ u2 ⇀ . . . ⇀ uk−1 ⇀ uk = v

∀i, j ∈ Nk+1 : i 6= j ⇒ ui 6= uj

A cycle is a tour of length ≥ 3 where all nodes exceptthe final are distinct: u v ⇀ u

A graph without cycles called acyclic

Discrete Mathematics I – p. 258/292

Page 1174: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

�2

3

4

�10

0

5

1

6

�7

8

9

0 5 : 0 ⇀ 2 ⇀ 7 ⇀ 10 ⇀ 8 ⇀ 3 ⇀ 5

A cycle: 3 ⇀ 8 ⇀ 10 ⇀ 9 ⇀ 4 ⇀ 6 ⇀ 3

Discrete Mathematics I – p. 259/292

Page 1175: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

�2

3

4

�10

0

5

1

6

�7

8

9

0 5 : 0 ⇀ 2 ⇀ 7 ⇀ 10 ⇀ 8 ⇀ 3 ⇀ 5

A cycle: 3 ⇀ 8 ⇀ 10 ⇀ 9 ⇀ 4 ⇀ 6 ⇀ 3

Discrete Mathematics I – p. 259/292

Page 1176: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

�2

3

4

�10

0

5

1

6

�7

8

9

0 5 : 0 ⇀ 2 ⇀ 7 ⇀ 10 ⇀ 8 ⇀ 3 ⇀ 5

A cycle: 3 ⇀ 8 ⇀ 10 ⇀ 9 ⇀ 4 ⇀ 6 ⇀ 3

Discrete Mathematics I – p. 259/292

Page 1177: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

R : V ↔ V — equivalence relation?

Prove: For all u, v ∈ V , there is a path u v, iffthere is a walk u# v.

R , R# : V ↔ V R = R#

Proof. (u v) ⇒ (u# v): trivial

(u# v) ⇒ (u v): induction on walk length

Discrete Mathematics I – p. 260/292

Page 1178: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

R : V ↔ V — equivalence relation?

Prove: For all u, v ∈ V , there is a path u v, iffthere is a walk u# v.

R , R# : V ↔ V R = R#

Proof. (u v) ⇒ (u# v): trivial

(u# v) ⇒ (u v): induction on walk length

Discrete Mathematics I – p. 260/292

Page 1179: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

R : V ↔ V — equivalence relation?

Prove: For all u, v ∈ V , there is a path u v, iffthere is a walk u# v.

R , R# : V ↔ V R = R#

Proof. (u v) ⇒ (u# v): trivial

(u# v) ⇒ (u v): induction on walk length

Discrete Mathematics I – p. 260/292

Page 1180: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

R : V ↔ V — equivalence relation?

Prove: For all u, v ∈ V , there is a path u v, iffthere is a walk u# v.

R , R# : V ↔ V R = R#

Proof. (u v) ⇒ (u# v): trivial

(u# v) ⇒ (u v): induction on walk length

Discrete Mathematics I – p. 260/292

Page 1181: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

R : V ↔ V — equivalence relation?

Prove: For all u, v ∈ V , there is a path u v, iffthere is a walk u# v.

R , R# : V ↔ V R = R#

Proof.

(u v) ⇒ (u# v): trivial

(u# v) ⇒ (u v): induction on walk length

Discrete Mathematics I – p. 260/292

Page 1182: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

R : V ↔ V — equivalence relation?

Prove: For all u, v ∈ V , there is a path u v, iffthere is a walk u# v.

R , R# : V ↔ V R = R#

Proof. (u v) ⇒ (u# v): trivial

(u# v) ⇒ (u v): induction on walk length

Discrete Mathematics I – p. 260/292

Page 1183: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

R : V ↔ V — equivalence relation?

Prove: For all u, v ∈ V , there is a path u v, iffthere is a walk u# v.

R , R# : V ↔ V R = R#

Proof. (u v) ⇒ (u# v): trivial

(u# v) ⇒ (u v): induction on walk length

Discrete Mathematics I – p. 260/292

Page 1184: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Induction base: (u) is both u# u and u u

Inductive step: consider walk u# w ⇀ v

Assume statement holds for u# w: path u w

Case 1: path u w does not visit v

Then u w ⇀ v is a path

Case 2: path u w visits v: u v w ⇀ v

Take initial u v

Discrete Mathematics I – p. 261/292

Page 1185: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Induction base: (u) is both u# u and u u

Inductive step: consider walk u# w ⇀ v

Assume statement holds for u# w: path u w

Case 1: path u w does not visit v

Then u w ⇀ v is a path

Case 2: path u w visits v: u v w ⇀ v

Take initial u v

Discrete Mathematics I – p. 261/292

Page 1186: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Induction base: (u) is both u# u and u u

Inductive step: consider walk u# w ⇀ v

Assume statement holds for u# w: path u w

Case 1: path u w does not visit v

Then u w ⇀ v is a path

Case 2: path u w visits v: u v w ⇀ v

Take initial u v

Discrete Mathematics I – p. 261/292

Page 1187: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Induction base: (u) is both u# u and u u

Inductive step: consider walk u# w ⇀ v

Assume statement holds for u# w: path u w

Case 1: path u w does not visit v

Then u w ⇀ v is a path

Case 2: path u w visits v: u v w ⇀ v

Take initial u v

Discrete Mathematics I – p. 261/292

Page 1188: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Induction base: (u) is both u# u and u u

Inductive step: consider walk u# w ⇀ v

Assume statement holds for u# w: path u w

Case 1: path u w does not visit v

Then u w ⇀ v is a path

Case 2: path u w visits v: u v w ⇀ v

Take initial u v

Discrete Mathematics I – p. 261/292

Page 1189: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Induction base: (u) is both u# u and u u

Inductive step: consider walk u# w ⇀ v

Assume statement holds for u# w: path u w

Case 1: path u w does not visit v

Then u w ⇀ v is a path

Case 2: path u w visits v: u v w ⇀ v

Take initial u v

Discrete Mathematics I – p. 261/292

Page 1190: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Induction base: (u) is both u# u and u u

Inductive step: consider walk u# w ⇀ v

Assume statement holds for u# w: path u w

Case 1: path u w does not visit v

Then u w ⇀ v is a path

Case 2: path u w visits v: u v w ⇀ v

Take initial u v

Discrete Mathematics I – p. 261/292

Page 1191: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) v ∈ V

The degree of node v is the number of nodes adjacentto v

deg(v) = |{u ∈ V | v ⇀ u}|

a

b c

d

ef

deg(a) = deg(d) = 2

deg(b) = deg(c) = 4

deg(e) = deg(f) = 4

Discrete Mathematics I – p. 262/292

Page 1192: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) v ∈ V

The degree of node v is the number of nodes adjacentto v

deg(v) = |{u ∈ V | v ⇀ u}|

a

b c

d

ef

deg(a) = deg(d) = 2

deg(b) = deg(c) = 4

deg(e) = deg(f) = 4

Discrete Mathematics I – p. 262/292

Page 1193: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) v ∈ V

The degree of node v is the number of nodes adjacentto v

deg(v) = |{u ∈ V | v ⇀ u}|

a

b c

d

ef

deg(a) = deg(d) = 2

deg(b) = deg(c) = 4

deg(e) = deg(f) = 4

Discrete Mathematics I – p. 262/292

Page 1194: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) v ∈ V

The degree of node v is the number of nodes adjacentto v

deg(v) = |{u ∈ V | v ⇀ u}|

�a

b

c

d

e

f

deg(a) = deg(d) = 2

deg(b) = deg(c) = 4

deg(e) = deg(f) = 4

Discrete Mathematics I – p. 262/292

Page 1195: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) v ∈ V

The degree of node v is the number of nodes adjacentto v

deg(v) = |{u ∈ V | v ⇀ u}|

�a

b

c

d

e

f

deg(a) = deg(d) = 2

deg(b) = deg(c) = 4

deg(e) = deg(f) = 4

Discrete Mathematics I – p. 262/292

Page 1196: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

a

b c

d

ef

a ⇀ b ⇀ c ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1197: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1198: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a

⇀ b ⇀ c ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1199: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b

⇀ c ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1200: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c

⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1201: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c ⇀ f

⇀ e ⇀ d ⇀ c ⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1202: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c ⇀ f ⇀ e

⇀ d ⇀ c ⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1203: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c ⇀ f ⇀ e ⇀ d

⇀ c ⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1204: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c ⇀ f ⇀ e ⇀ d ⇀ c

⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1205: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e

⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1206: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1207: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b ⇀ f

⇀ a

Discrete Mathematics I – p. 263/292

Page 1208: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

An Euler tour of graph G is a tour which visits everyedge in E exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ c ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b ⇀ f ⇀ a

Discrete Mathematics I – p. 263/292

Page 1209: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Theorem: Graph G has an Euler tour iff

• G is connected

• every node in V has even degree

Gives an efficient test for Euler tour existence

Discrete Mathematics I – p. 264/292

Page 1210: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Theorem: Graph G has an Euler tour iff

• G is connected

• every node in V has even degree

Gives an efficient test for Euler tour existence

Discrete Mathematics I – p. 264/292

Page 1211: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Theorem: Graph G has an Euler tour iff

• G is connected

• every node in V has even degree

Gives an efficient test for Euler tour existence

Discrete Mathematics I – p. 264/292

Page 1212: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Theorem: Graph G has an Euler tour iff

• G is connected

• every node in V has even degree

Gives an efficient test for Euler tour existence

Discrete Mathematics I – p. 264/292

Page 1213: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Theorem: Graph G has an Euler tour iff

• G is connected

• every node in V has even degree

Gives an efficient test for Euler tour existence

Discrete Mathematics I – p. 264/292

Page 1214: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Proof.

G has Euler tour ⇒ G connected: trivial

G has Euler tour ⇒ every node has even degree

Consider v ∈ V

Suppose v visited k times by Euler tour

Every visit uses 2 new edges (in and out)

Hence deg(v) = 2k

Discrete Mathematics I – p. 265/292

Page 1215: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Proof.

G has Euler tour ⇒ G connected: trivial

G has Euler tour ⇒ every node has even degree

Consider v ∈ V

Suppose v visited k times by Euler tour

Every visit uses 2 new edges (in and out)

Hence deg(v) = 2k

Discrete Mathematics I – p. 265/292

Page 1216: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Proof.

G has Euler tour ⇒ G connected: trivial

G has Euler tour ⇒ every node has even degree

Consider v ∈ V

Suppose v visited k times by Euler tour

Every visit uses 2 new edges (in and out)

Hence deg(v) = 2k

Discrete Mathematics I – p. 265/292

Page 1217: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Proof.

G has Euler tour ⇒ G connected: trivial

G has Euler tour ⇒ every node has even degree

Consider v ∈ V

Suppose v visited k times by Euler tour

Every visit uses 2 new edges (in and out)

Hence deg(v) = 2k

Discrete Mathematics I – p. 265/292

Page 1218: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Proof.

G has Euler tour ⇒ G connected: trivial

G has Euler tour ⇒ every node has even degree

Consider v ∈ V

Suppose v visited k times by Euler tour

Every visit uses 2 new edges (in and out)

Hence deg(v) = 2k

Discrete Mathematics I – p. 265/292

Page 1219: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Proof.

G has Euler tour ⇒ G connected: trivial

G has Euler tour ⇒ every node has even degree

Consider v ∈ V

Suppose v visited k times by Euler tour

Every visit uses 2 new edges (in and out)

Hence deg(v) = 2k

Discrete Mathematics I – p. 265/292

Page 1220: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G connected ∧ every node has even degree⇒ G has an Euler tour

Take any v0 ∈ V

Consider any walk v0 ⇀ v1 ⇀ . . . ⇀ vk 6= v0

Node vk has an odd number of visited edges

deg(vk) is even ⇒ vk has an unvisited edge

Extend walk: v0 ⇀ v1 ⇀ . . . ⇀ vk ⇀ vk+1

Repeat until v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Discrete Mathematics I – p. 266/292

Page 1221: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G connected ∧ every node has even degree⇒ G has an Euler tour

Take any v0 ∈ V

Consider any walk v0 ⇀ v1 ⇀ . . . ⇀ vk 6= v0

Node vk has an odd number of visited edges

deg(vk) is even ⇒ vk has an unvisited edge

Extend walk: v0 ⇀ v1 ⇀ . . . ⇀ vk ⇀ vk+1

Repeat until v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Discrete Mathematics I – p. 266/292

Page 1222: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G connected ∧ every node has even degree⇒ G has an Euler tour

Take any v0 ∈ V

Consider any walk v0 ⇀ v1 ⇀ . . . ⇀ vk 6= v0

Node vk has an odd number of visited edges

deg(vk) is even ⇒ vk has an unvisited edge

Extend walk: v0 ⇀ v1 ⇀ . . . ⇀ vk ⇀ vk+1

Repeat until v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Discrete Mathematics I – p. 266/292

Page 1223: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G connected ∧ every node has even degree⇒ G has an Euler tour

Take any v0 ∈ V

Consider any walk v0 ⇀ v1 ⇀ . . . ⇀ vk 6= v0

Node vk has an odd number of visited edges

deg(vk) is even ⇒ vk has an unvisited edge

Extend walk: v0 ⇀ v1 ⇀ . . . ⇀ vk ⇀ vk+1

Repeat until v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Discrete Mathematics I – p. 266/292

Page 1224: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G connected ∧ every node has even degree⇒ G has an Euler tour

Take any v0 ∈ V

Consider any walk v0 ⇀ v1 ⇀ . . . ⇀ vk 6= v0

Node vk has an odd number of visited edges

deg(vk) is even ⇒ vk has an unvisited edge

Extend walk: v0 ⇀ v1 ⇀ . . . ⇀ vk ⇀ vk+1

Repeat until v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Discrete Mathematics I – p. 266/292

Page 1225: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G connected ∧ every node has even degree⇒ G has an Euler tour

Take any v0 ∈ V

Consider any walk v0 ⇀ v1 ⇀ . . . ⇀ vk 6= v0

Node vk has an odd number of visited edges

deg(vk) is even ⇒ vk has an unvisited edge

Extend walk: v0 ⇀ v1 ⇀ . . . ⇀ vk ⇀ vk+1

Repeat until v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Discrete Mathematics I – p. 266/292

Page 1226: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G connected ∧ every node has even degree⇒ G has an Euler tour

Take any v0 ∈ V

Consider any walk v0 ⇀ v1 ⇀ . . . ⇀ vk 6= v0

Node vk has an odd number of visited edges

deg(vk) is even ⇒ vk has an unvisited edge

Extend walk: v0 ⇀ v1 ⇀ . . . ⇀ vk ⇀ vk+1

Repeat until v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Discrete Mathematics I – p. 266/292

Page 1227: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Consider tour v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Suppose some vi has unvisited edge to vm+1

By symmetry, let vi = v0

Extend walk: v0 ⇀ . . . ⇀ vk ⇀ vm = v0 ⇀ vm+1

Repeat until every vi has no unvisited edges

G connected =⇒ all edges in E visited

Therefore, G has an Euler tour

Discrete Mathematics I – p. 267/292

Page 1228: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Consider tour v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Suppose some vi has unvisited edge to vm+1

By symmetry, let vi = v0

Extend walk: v0 ⇀ . . . ⇀ vk ⇀ vm = v0 ⇀ vm+1

Repeat until every vi has no unvisited edges

G connected =⇒ all edges in E visited

Therefore, G has an Euler tour

Discrete Mathematics I – p. 267/292

Page 1229: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Consider tour v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Suppose some vi has unvisited edge to vm+1

By symmetry, let vi = v0

Extend walk: v0 ⇀ . . . ⇀ vk ⇀ vm = v0 ⇀ vm+1

Repeat until every vi has no unvisited edges

G connected =⇒ all edges in E visited

Therefore, G has an Euler tour

Discrete Mathematics I – p. 267/292

Page 1230: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Consider tour v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Suppose some vi has unvisited edge to vm+1

By symmetry, let vi = v0

Extend walk: v0 ⇀ . . . ⇀ vk ⇀ vm = v0 ⇀ vm+1

Repeat until every vi has no unvisited edges

G connected =⇒ all edges in E visited

Therefore, G has an Euler tour

Discrete Mathematics I – p. 267/292

Page 1231: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Consider tour v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Suppose some vi has unvisited edge to vm+1

By symmetry, let vi = v0

Extend walk: v0 ⇀ . . . ⇀ vk ⇀ vm = v0 ⇀ vm+1

Repeat until every vi has no unvisited edges

G connected =⇒ all edges in E visited

Therefore, G has an Euler tour

Discrete Mathematics I – p. 267/292

Page 1232: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Consider tour v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Suppose some vi has unvisited edge to vm+1

By symmetry, let vi = v0

Extend walk: v0 ⇀ . . . ⇀ vk ⇀ vm = v0 ⇀ vm+1

Repeat until every vi has no unvisited edges

G connected =⇒ all edges in E visited

Therefore, G has an Euler tour

Discrete Mathematics I – p. 267/292

Page 1233: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Consider tour v0 ⇀ v1 ⇀ . . . ⇀ vm = v0

Suppose some vi has unvisited edge to vm+1

By symmetry, let vi = v0

Extend walk: v0 ⇀ . . . ⇀ vk ⇀ vm = v0 ⇀ vm+1

Repeat until every vi has no unvisited edges

G connected =⇒ all edges in E visited

Therefore, G has an Euler tour

Discrete Mathematics I – p. 267/292

Page 1234: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1235: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a

⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1236: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b

⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1237: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c

⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1238: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f

⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1239: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1240: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b

⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1241: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f

⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1242: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e

⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1243: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d

⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1244: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d ⇀ c

⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1245: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e

⇀ b

Discrete Mathematics I – p. 268/292

Page 1246: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Example:

�a

b

c

�d

�e

f

a ⇀ b ⇀ c ⇀ f ⇀ a

b ⇀ c ⇀ f ⇀ a ⇀ b ⇀ f ⇀ e ⇀ d ⇀ c ⇀ e ⇀ b

Discrete Mathematics I – p. 268/292

Page 1247: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A Hamiltonian cycle of graph G is a cycle whichvisits every node in V exactly once

a

b c

d

ef

a ⇀ b ⇀ e ⇀ d ⇀ c ⇀ f ⇀ a

Discrete Mathematics I – p. 269/292

Page 1248: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A Hamiltonian cycle of graph G is a cycle whichvisits every node in V exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ e ⇀ d ⇀ c ⇀ f ⇀ a

Discrete Mathematics I – p. 269/292

Page 1249: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A Hamiltonian cycle of graph G is a cycle whichvisits every node in V exactly once

�a

b

c

d

e�

f

a

⇀ b ⇀ e ⇀ d ⇀ c ⇀ f ⇀ a

Discrete Mathematics I – p. 269/292

Page 1250: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A Hamiltonian cycle of graph G is a cycle whichvisits every node in V exactly once

�a

b

c

d

e�

f

a ⇀ b

⇀ e ⇀ d ⇀ c ⇀ f ⇀ a

Discrete Mathematics I – p. 269/292

Page 1251: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A Hamiltonian cycle of graph G is a cycle whichvisits every node in V exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ e

⇀ d ⇀ c ⇀ f ⇀ a

Discrete Mathematics I – p. 269/292

Page 1252: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A Hamiltonian cycle of graph G is a cycle whichvisits every node in V exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ e ⇀ d

⇀ c ⇀ f ⇀ a

Discrete Mathematics I – p. 269/292

Page 1253: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A Hamiltonian cycle of graph G is a cycle whichvisits every node in V exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ e ⇀ d ⇀ c

⇀ f ⇀ a

Discrete Mathematics I – p. 269/292

Page 1254: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A Hamiltonian cycle of graph G is a cycle whichvisits every node in V exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ e ⇀ d ⇀ c ⇀ f

⇀ a

Discrete Mathematics I – p. 269/292

Page 1255: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A Hamiltonian cycle of graph G is a cycle whichvisits every node in V exactly once

�a

b

c

d

e�

f

a ⇀ b ⇀ e ⇀ d ⇀ c ⇀ f ⇀ a

Discrete Mathematics I – p. 269/292

Page 1256: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Exercise: find an efficient test for existence ofHamiltonian cycle. . .

. . . and claim your $1 000 000!

See www.claymath.org for details

Discrete Mathematics I – p. 270/292

Page 1257: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Exercise: find an efficient test for existence ofHamiltonian cycle. . .

. . . and claim your $1 000 000!

See www.claymath.org for details

Discrete Mathematics I – p. 270/292

Page 1258: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Exercise: find an efficient test for existence ofHamiltonian cycle. . .

. . . and claim your $1 000 000!

See www.claymath.org for details

Discrete Mathematics I – p. 270/292

Page 1259: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

G′ is a subgraph of G, if V ′ ⊆ V , E ′ ⊆ E

0

1

2

3

4G 0

1

2

3

G′

G′ ⊆ G

Discrete Mathematics I – p. 271/292

Page 1260: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

G′ is a subgraph of G, if V ′ ⊆ V , E ′ ⊆ E

0

1

2

3

4G 0

1

2

3

G′

G′ ⊆ G

Discrete Mathematics I – p. 271/292

Page 1261: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

G′ is a subgraph of G, if V ′ ⊆ V , E ′ ⊆ E

0

�1

2

� 3

�4G

0

�1

�2

� 3

G′

G′ ⊆ G

Discrete Mathematics I – p. 271/292

Page 1262: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

G′ is a subgraph of G, if V ′ ⊆ V , E ′ ⊆ E

0

�1

2

� 3

�4G

0

�1

�2

� 3

G′

G′ ⊆ G

Discrete Mathematics I – p. 271/292

Page 1263: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

G′ is a spanning subgraph of G, if V ′ = V , E ′ ⊆ E

0

1

2

3

4G 0

1

2

3

4G′

G′ v G

Discrete Mathematics I – p. 272/292

Page 1264: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

G′ is a spanning subgraph of G, if V ′ = V , E ′ ⊆ E

0

1

2

3

4G 0

1

2

3

4G′

G′ v G

Discrete Mathematics I – p. 272/292

Page 1265: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

G′ is a spanning subgraph of G, if V ′ = V , E ′ ⊆ E

0

�1

2

� 3

�4G

0

�1

�2

� 3

4G′

G′ v G

Discrete Mathematics I – p. 272/292

Page 1266: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

G′ is a spanning subgraph of G, if V ′ = V , E ′ ⊆ E

0

�1

2

� 3

�4G

0

�1

�2

� 3

4G′

G′ v G

Discrete Mathematics I – p. 272/292

Page 1267: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — a finite set G(V ) — set of all graphs on V

R⊆ : G(V ) ↔ G(V )

∀G : G ⊆ G G v G

∀G, G′ : (G′ ⊆ G) ∧ (G ⊆ G′) ⇒ G = G′

∀G, G′, G′′ : (G′′ ⊆ G′) ∧ (G′ ⊆ G) ⇒ G′′ ⊆ G

Therefore, R⊆ is a partial order

Similarly, Rv is a partial order

Discrete Mathematics I – p. 273/292

Page 1268: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — a finite set G(V ) — set of all graphs on V

R⊆ : G(V ) ↔ G(V )

∀G : G ⊆ G G v G

∀G, G′ : (G′ ⊆ G) ∧ (G ⊆ G′) ⇒ G = G′

∀G, G′, G′′ : (G′′ ⊆ G′) ∧ (G′ ⊆ G) ⇒ G′′ ⊆ G

Therefore, R⊆ is a partial order

Similarly, Rv is a partial order

Discrete Mathematics I – p. 273/292

Page 1269: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — a finite set G(V ) — set of all graphs on V

R⊆ : G(V ) ↔ G(V )

∀G : G ⊆ G G v G

∀G, G′ : (G′ ⊆ G) ∧ (G ⊆ G′) ⇒ G = G′

∀G, G′, G′′ : (G′′ ⊆ G′) ∧ (G′ ⊆ G) ⇒ G′′ ⊆ G

Therefore, R⊆ is a partial order

Similarly, Rv is a partial order

Discrete Mathematics I – p. 273/292

Page 1270: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — a finite set G(V ) — set of all graphs on V

R⊆ : G(V ) ↔ G(V )

∀G : G ⊆ G G v G

∀G, G′ : (G′ ⊆ G) ∧ (G ⊆ G′) ⇒ G = G′

∀G, G′, G′′ : (G′′ ⊆ G′) ∧ (G′ ⊆ G) ⇒ G′′ ⊆ G

Therefore, R⊆ is a partial order

Similarly, Rv is a partial order

Discrete Mathematics I – p. 273/292

Page 1271: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — a finite set G(V ) — set of all graphs on V

R⊆ : G(V ) ↔ G(V )

∀G : G ⊆ G G v G

∀G, G′ : (G′ ⊆ G) ∧ (G ⊆ G′) ⇒ G = G′

∀G, G′, G′′ : (G′′ ⊆ G′) ∧ (G′ ⊆ G) ⇒ G′′ ⊆ G

Therefore, R⊆ is a partial order

Similarly, Rv is a partial order

Discrete Mathematics I – p. 273/292

Page 1272: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — a finite set G(V ) — set of all graphs on V

R⊆ : G(V ) ↔ G(V )

∀G : G ⊆ G G v G

∀G, G′ : (G′ ⊆ G) ∧ (G ⊆ G′) ⇒ G = G′

∀G, G′, G′′ : (G′′ ⊆ G′) ∧ (G′ ⊆ G) ⇒ G′′ ⊆ G

Therefore, R⊆ is a partial order

Similarly, Rv is a partial order

Discrete Mathematics I – p. 273/292

Page 1273: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

V — a finite set G(V ) — set of all graphs on V

R⊆ : G(V ) ↔ G(V )

∀G : G ⊆ G G v G

∀G, G′ : (G′ ⊆ G) ∧ (G ⊆ G′) ⇒ G = G′

∀G, G′, G′′ : (G′′ ⊆ G′) ∧ (G′ ⊆ G) ⇒ G′′ ⊆ G

Therefore, R⊆ is a partial order

Similarly, Rv is a partial order

Discrete Mathematics I – p. 273/292

Page 1274: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Recall: a graph is

• connected, if every two nodes connected

• acyclic, if there is no cycle

A connected acyclic graph is called a tree

Discrete Mathematics I – p. 274/292

Page 1275: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Recall: a graph is

• connected, if every two nodes connected

• acyclic, if there is no cycle

A connected acyclic graph is called a tree

Discrete Mathematics I – p. 274/292

Page 1276: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Recall: a graph is

• connected, if every two nodes connected

• acyclic, if there is no cycle

A connected acyclic graph is called a tree

Discrete Mathematics I – p. 274/292

Page 1277: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Recall: a graph is

• connected, if every two nodes connected

• acyclic, if there is no cycle

A connected acyclic graph is called a tree

Discrete Mathematics I – p. 274/292

Page 1278: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Recall: a graph is

• connected, if every two nodes connected

• acyclic, if there is no cycle

A connected acyclic graph is called a tree

� ��

��

��

Discrete Mathematics I – p. 274/292

Page 1279: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Prove: |V | = |E|+ 1.

Proof. Induction base: V = {v}, E = ∅|E| = 0 |V | = 1 = |E|+ 1

Discrete Mathematics I – p. 275/292

Page 1280: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Prove: |V | = |E|+ 1.

Proof. Induction base: V = {v}, E = ∅|E| = 0 |V | = 1 = |E|+ 1

Discrete Mathematics I – p. 275/292

Page 1281: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Prove: |V | = |E|+ 1.

Proof. Induction base: V = {v}, E = ∅

|E| = 0 |V | = 1 = |E|+ 1

Discrete Mathematics I – p. 275/292

Page 1282: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Prove: |V | = |E|+ 1.

Proof. Induction base: V = {v}, E = ∅|E| = 0 |V | = 1 = |E|+ 1

Discrete Mathematics I – p. 275/292

Page 1283: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Inductive step: assume statement holds for all propersubgraphs of G

Take any edge (u, v) ∈ E.

Let G′ = (V, E \ {(u, v), (v, u)}).

G′

u v

Consider R : V ↔ V in G′

Discrete Mathematics I – p. 276/292

Page 1284: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Inductive step: assume statement holds for all propersubgraphs of G

Take any edge (u, v) ∈ E.

Let G′ = (V, E \ {(u, v), (v, u)}).

G′

u v

Consider R : V ↔ V in G′

Discrete Mathematics I – p. 276/292

Page 1285: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Inductive step: assume statement holds for all propersubgraphs of G

Take any edge (u, v) ∈ E.

Let G′ = (V, E \ {(u, v), (v, u)}).

G′

u v

Consider R : V ↔ V in G′

Discrete Mathematics I – p. 276/292

Page 1286: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Inductive step: assume statement holds for all propersubgraphs of G

Take any edge (u, v) ∈ E.

Let G′ = (V, E \ {(u, v), (v, u)}).

G′

�u � v

Consider R : V ↔ V in G′

Discrete Mathematics I – p. 276/292

Page 1287: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Inductive step: assume statement holds for all propersubgraphs of G

Take any edge (u, v) ∈ E.

Let G′ = (V, E \ {(u, v), (v, u)}).

G′

�u � v

Consider R : V ↔ V in G′

Discrete Mathematics I – p. 276/292

Page 1288: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Suppose u v in G′

G′u v

Then u v ⇀ u a cycle in G — contradiction

Therefore u 6 v in G′

Discrete Mathematics I – p. 277/292

Page 1289: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Suppose u v in G′

G′

�u � v

Then u v ⇀ u a cycle in G — contradiction

Therefore u 6 v in G′

Discrete Mathematics I – p. 277/292

Page 1290: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Suppose u v in G′

G′

�u � v

Then u v ⇀ u a cycle in G — contradiction

Therefore u 6 v in G′

Discrete Mathematics I – p. 277/292

Page 1291: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Suppose u v in G′

G′

�u � v

Then u v ⇀ u a cycle in G — contradiction

Therefore u 6 v in G′

Discrete Mathematics I – p. 277/292

Page 1292: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Vu = [u] Vv = [v] (in G′)

Eu = {(x, y) | x, y ∈ Vu} Ev = {(x, y) | x, y ∈ Vv}Gu = (Vu, Eu) Gv = (Vv, Ev)

Gu Gvu v

G connected =⇒ Gu, Gv connected

G acyclic =⇒ Gu, Gv acyclic

Discrete Mathematics I – p. 278/292

Page 1293: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Vu = [u] Vv = [v] (in G′)

Eu = {(x, y) | x, y ∈ Vu} Ev = {(x, y) | x, y ∈ Vv}

Gu = (Vu, Eu) Gv = (Vv, Ev)

Gu Gvu v

G connected =⇒ Gu, Gv connected

G acyclic =⇒ Gu, Gv acyclic

Discrete Mathematics I – p. 278/292

Page 1294: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Vu = [u] Vv = [v] (in G′)

Eu = {(x, y) | x, y ∈ Vu} Ev = {(x, y) | x, y ∈ Vv}Gu = (Vu, Eu) Gv = (Vv, Ev)

Gu Gvu v

G connected =⇒ Gu, Gv connected

G acyclic =⇒ Gu, Gv acyclic

Discrete Mathematics I – p. 278/292

Page 1295: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Vu = [u] Vv = [v] (in G′)

Eu = {(x, y) | x, y ∈ Vu} Ev = {(x, y) | x, y ∈ Vv}Gu = (Vu, Eu) Gv = (Vv, Ev)

Gu Gv

�u � v

G connected =⇒ Gu, Gv connected

G acyclic =⇒ Gu, Gv acyclic

Discrete Mathematics I – p. 278/292

Page 1296: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Vu = [u] Vv = [v] (in G′)

Eu = {(x, y) | x, y ∈ Vu} Ev = {(x, y) | x, y ∈ Vv}Gu = (Vu, Eu) Gv = (Vv, Ev)

Gu Gv

�u � v

G connected =⇒ Gu, Gv connected

G acyclic =⇒ Gu, Gv acyclic

Discrete Mathematics I – p. 278/292

Page 1297: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Vu = [u] Vv = [v] (in G′)

Eu = {(x, y) | x, y ∈ Vu} Ev = {(x, y) | x, y ∈ Vv}Gu = (Vu, Eu) Gv = (Vv, Ev)

Gu Gv

�u � v

G connected =⇒ Gu, Gv connected

G acyclic =⇒ Gu, Gv acyclic

Discrete Mathematics I – p. 278/292

Page 1298: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

By induction hypothesis:|Vu| = |Eu|+ 1 |Vv| = |Ev|+ 1

|V | = |Vu|+ |Vv| = (|Eu|+ 1) + (|Ev|+ 1) =

(|Eu|+ |Ev|+ 1) + 1 = |E|+ 1

Discrete Mathematics I – p. 279/292

Page 1299: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

By induction hypothesis:|Vu| = |Eu|+ 1 |Vv| = |Ev|+ 1

|V | = |Vu|+ |Vv| = (|Eu|+ 1) + (|Ev|+ 1) =

(|Eu|+ |Ev|+ 1) + 1 = |E|+ 1

Discrete Mathematics I – p. 279/292

Page 1300: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

By induction hypothesis:|Vu| = |Eu|+ 1 |Vv| = |Ev|+ 1

|V | = |Vu|+ |Vv| = (|Eu|+ 1) + (|Ev|+ 1) =

(|Eu|+ |Ev|+ 1) + 1 = |E|+ 1

Discrete Mathematics I – p. 279/292

Page 1301: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Corollary: G has a node of degree 1.

Proof. G connected ⇒ no nodes of degree 0.

Suppose all degrees ≥ 2. |E| ≥ 2 · |V |/2 = |V |But |E| = |V | − 1. Hence assumption false.

Therefore G has a node of degree 1.

A node of degree 1 in a tree is called a leaf.

Discrete Mathematics I – p. 280/292

Page 1302: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Corollary: G has a node of degree 1.

Proof. G connected ⇒ no nodes of degree 0.

Suppose all degrees ≥ 2. |E| ≥ 2 · |V |/2 = |V |But |E| = |V | − 1. Hence assumption false.

Therefore G has a node of degree 1.

A node of degree 1 in a tree is called a leaf.

Discrete Mathematics I – p. 280/292

Page 1303: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Corollary: G has a node of degree 1.

Proof. G connected ⇒ no nodes of degree 0.

Suppose all degrees ≥ 2. |E| ≥ 2 · |V |/2 = |V |But |E| = |V | − 1. Hence assumption false.

Therefore G has a node of degree 1.

A node of degree 1 in a tree is called a leaf.

Discrete Mathematics I – p. 280/292

Page 1304: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Corollary: G has a node of degree 1.

Proof. G connected ⇒ no nodes of degree 0.

Suppose all degrees ≥ 2.

|E| ≥ 2 · |V |/2 = |V |But |E| = |V | − 1. Hence assumption false.

Therefore G has a node of degree 1.

A node of degree 1 in a tree is called a leaf.

Discrete Mathematics I – p. 280/292

Page 1305: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Corollary: G has a node of degree 1.

Proof. G connected ⇒ no nodes of degree 0.

Suppose all degrees ≥ 2. |E| ≥ 2 · |V |/2 = |V |

But |E| = |V | − 1. Hence assumption false.

Therefore G has a node of degree 1.

A node of degree 1 in a tree is called a leaf.

Discrete Mathematics I – p. 280/292

Page 1306: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Corollary: G has a node of degree 1.

Proof. G connected ⇒ no nodes of degree 0.

Suppose all degrees ≥ 2. |E| ≥ 2 · |V |/2 = |V |But |E| = |V | − 1. Hence assumption false.

Therefore G has a node of degree 1.

A node of degree 1 in a tree is called a leaf.

Discrete Mathematics I – p. 280/292

Page 1307: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Corollary: G has a node of degree 1.

Proof. G connected ⇒ no nodes of degree 0.

Suppose all degrees ≥ 2. |E| ≥ 2 · |V |/2 = |V |But |E| = |V | − 1. Hence assumption false.

Therefore G has a node of degree 1.

A node of degree 1 in a tree is called a leaf.

Discrete Mathematics I – p. 280/292

Page 1308: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) — a tree

Corollary: G has a node of degree 1.

Proof. G connected ⇒ no nodes of degree 0.

Suppose all degrees ≥ 2. |E| ≥ 2 · |V |/2 = |V |But |E| = |V | − 1. Hence assumption false.

Therefore G has a node of degree 1.

A node of degree 1 in a tree is called a leaf.

Discrete Mathematics I – p. 280/292

Page 1309: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

Recall: G′ is a spanning subgraph of G, if V ′ = V ,E ′ ⊆ E

Rv : G(V ) ↔ G(V )

Consider restricting Rv to the set of all

• connected graphs in G(V )

• acyclic graphs in G(V )

Discrete Mathematics I – p. 281/292

Page 1310: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

Recall: G′ is a spanning subgraph of G, if V ′ = V ,E ′ ⊆ E

Rv : G(V ) ↔ G(V )

Consider restricting Rv to the set of all

• connected graphs in G(V )

• acyclic graphs in G(V )

Discrete Mathematics I – p. 281/292

Page 1311: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

Recall: G′ is a spanning subgraph of G, if V ′ = V ,E ′ ⊆ E

Rv : G(V ) ↔ G(V )

Consider restricting Rv to the set of all

• connected graphs in G(V )

• acyclic graphs in G(V )

Discrete Mathematics I – p. 281/292

Page 1312: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

Recall: G′ is a spanning subgraph of G, if V ′ = V ,E ′ ⊆ E

Rv : G(V ) ↔ G(V )

Consider restricting Rv to the set of all

• connected graphs in G(V )

• acyclic graphs in G(V )

Discrete Mathematics I – p. 281/292

Page 1313: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

Recall: G′ is a spanning subgraph of G, if V ′ = V ,E ′ ⊆ E

Rv : G(V ) ↔ G(V )

Consider restricting Rv to the set of all

• connected graphs in G(V )

• acyclic graphs in G(V )

Discrete Mathematics I – p. 281/292

Page 1314: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) G′ = (V ′, E ′)

Recall: G′ is a spanning subgraph of G, if V ′ = V ,E ′ ⊆ E

Rv : G(V ) ↔ G(V )

Consider restricting Rv to the set of all

• connected graphs in G(V )

• acyclic graphs in G(V )

Discrete Mathematics I – p. 281/292

Page 1315: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-minimal in the set of allconnected graphs on V

Proof. G connected

Need to prove: G acyclic iff G v-minimal

Equivalent to: G has a cycle iff G not v-minimal

Discrete Mathematics I – p. 282/292

Page 1316: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-minimal in the set of allconnected graphs on V

Proof. G connected

Need to prove: G acyclic iff G v-minimal

Equivalent to: G has a cycle iff G not v-minimal

Discrete Mathematics I – p. 282/292

Page 1317: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-minimal in the set of allconnected graphs on V

Proof. G connected

Need to prove: G acyclic iff G v-minimal

Equivalent to: G has a cycle iff G not v-minimal

Discrete Mathematics I – p. 282/292

Page 1318: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-minimal in the set of allconnected graphs on V

Proof. G connected

Need to prove: G acyclic iff G v-minimal

Equivalent to: G has a cycle iff G not v-minimal

Discrete Mathematics I – p. 282/292

Page 1319: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-minimal in the set of allconnected graphs on V

Proof. G connected

Need to prove: G acyclic iff G v-minimal

Equivalent to: G has a cycle iff G not v-minimal

Discrete Mathematics I – p. 282/292

Page 1320: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G has a cycle ⇒ G not v-minimal

Suppose G has a cycle

Remove any edge from cycle

Remaining graph connected

Hence G not v-minimal

Discrete Mathematics I – p. 283/292

Page 1321: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G has a cycle ⇒ G not v-minimal

Suppose G has a cycle

Remove any edge from cycle

Remaining graph connected

Hence G not v-minimal

Discrete Mathematics I – p. 283/292

Page 1322: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G has a cycle ⇒ G not v-minimal

Suppose G has a cycle

Remove any edge from cycle

Remaining graph connected

Hence G not v-minimal

Discrete Mathematics I – p. 283/292

Page 1323: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G has a cycle ⇒ G not v-minimal

Suppose G has a cycle

Remove any edge from cycle

Remaining graph connected

Hence G not v-minimal

Discrete Mathematics I – p. 283/292

Page 1324: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G has a cycle ⇒ G not v-minimal

Suppose G has a cycle

Remove any edge from cycle

Remaining graph connected

Hence G not v-minimal

Discrete Mathematics I – p. 283/292

Page 1325: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-minimal ⇒ G has a cycle

Suppose G not v-minimal

For some u, v ∈ V , removing edge u ⇀ v does notdisconnect the graph

Therefore there is another path u v

Hence G has a cycle

Discrete Mathematics I – p. 284/292

Page 1326: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-minimal ⇒ G has a cycle

Suppose G not v-minimal

For some u, v ∈ V , removing edge u ⇀ v does notdisconnect the graph

Therefore there is another path u v

Hence G has a cycle

Discrete Mathematics I – p. 284/292

Page 1327: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-minimal ⇒ G has a cycle

Suppose G not v-minimal

For some u, v ∈ V , removing edge u ⇀ v does notdisconnect the graph

Therefore there is another path u v

Hence G has a cycle

Discrete Mathematics I – p. 284/292

Page 1328: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-minimal ⇒ G has a cycle

Suppose G not v-minimal

For some u, v ∈ V , removing edge u ⇀ v does notdisconnect the graph

Therefore there is another path u v

Hence G has a cycle

Discrete Mathematics I – p. 284/292

Page 1329: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-minimal ⇒ G has a cycle

Suppose G not v-minimal

For some u, v ∈ V , removing edge u ⇀ v does notdisconnect the graph

Therefore there is another path u v

Hence G has a cycle

Discrete Mathematics I – p. 284/292

Page 1330: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-maximal in the set of allacyclic graphs on V

Proof. G acyclic

Need to prove: G connected iff G v-maximal

Equivalent to:G disconnected iff G not v-maximal

Discrete Mathematics I – p. 285/292

Page 1331: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-maximal in the set of allacyclic graphs on V

Proof. G acyclic

Need to prove: G connected iff G v-maximal

Equivalent to:G disconnected iff G not v-maximal

Discrete Mathematics I – p. 285/292

Page 1332: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-maximal in the set of allacyclic graphs on V

Proof. G acyclic

Need to prove: G connected iff G v-maximal

Equivalent to:G disconnected iff G not v-maximal

Discrete Mathematics I – p. 285/292

Page 1333: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-maximal in the set of allacyclic graphs on V

Proof. G acyclic

Need to prove: G connected iff G v-maximal

Equivalent to:G disconnected iff G not v-maximal

Discrete Mathematics I – p. 285/292

Page 1334: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E)

Prove: G is a tree iff G is v-maximal in the set of allacyclic graphs on V

Proof. G acyclic

Need to prove: G connected iff G v-maximal

Equivalent to:G disconnected iff G not v-maximal

Discrete Mathematics I – p. 285/292

Page 1335: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G disconnected ⇒ G not v-maximal

Suppose G disconnected

Add any edge between two connected components

Resulting graph acyclic

Hence G not v-maximal

Discrete Mathematics I – p. 286/292

Page 1336: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G disconnected ⇒ G not v-maximal

Suppose G disconnected

Add any edge between two connected components

Resulting graph acyclic

Hence G not v-maximal

Discrete Mathematics I – p. 286/292

Page 1337: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G disconnected ⇒ G not v-maximal

Suppose G disconnected

Add any edge between two connected components

Resulting graph acyclic

Hence G not v-maximal

Discrete Mathematics I – p. 286/292

Page 1338: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G disconnected ⇒ G not v-maximal

Suppose G disconnected

Add any edge between two connected components

Resulting graph acyclic

Hence G not v-maximal

Discrete Mathematics I – p. 286/292

Page 1339: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G disconnected ⇒ G not v-maximal

Suppose G disconnected

Add any edge between two connected components

Resulting graph acyclic

Hence G not v-maximal

Discrete Mathematics I – p. 286/292

Page 1340: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-maximal ⇒ G disconnected

Suppose G not v-maximal

For some u, v ∈ V , adding edge u ⇀ v does notcreate cycle

Therefore u, v are in different connected components

Hence G disconnected

Discrete Mathematics I – p. 287/292

Page 1341: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-maximal ⇒ G disconnected

Suppose G not v-maximal

For some u, v ∈ V , adding edge u ⇀ v does notcreate cycle

Therefore u, v are in different connected components

Hence G disconnected

Discrete Mathematics I – p. 287/292

Page 1342: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-maximal ⇒ G disconnected

Suppose G not v-maximal

For some u, v ∈ V , adding edge u ⇀ v does notcreate cycle

Therefore u, v are in different connected components

Hence G disconnected

Discrete Mathematics I – p. 287/292

Page 1343: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-maximal ⇒ G disconnected

Suppose G not v-maximal

For some u, v ∈ V , adding edge u ⇀ v does notcreate cycle

Therefore u, v are in different connected components

Hence G disconnected

Discrete Mathematics I – p. 287/292

Page 1344: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G not v-maximal ⇒ G disconnected

Suppose G not v-maximal

For some u, v ∈ V , adding edge u ⇀ v does notcreate cycle

Therefore u, v are in different connected components

Hence G disconnected

Discrete Mathematics I – p. 287/292

Page 1345: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A graph is called planar, if it can be drawn on theplane without edge crossings.

Examples: any tree, any cycle

Complete graphs:K(1), K(2), K(3), K(4). Not K(5).

Complete bipartite graphs: K(2, 3). Not K(3, 3).

Discrete Mathematics I – p. 288/292

Page 1346: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A graph is called planar, if it can be drawn on theplane without edge crossings.

Examples: any tree

, any cycle

Complete graphs:K(1), K(2), K(3), K(4). Not K(5).

Complete bipartite graphs: K(2, 3). Not K(3, 3).

Discrete Mathematics I – p. 288/292

Page 1347: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A graph is called planar, if it can be drawn on theplane without edge crossings.

Examples: any tree, any cycle

Complete graphs:K(1), K(2), K(3), K(4). Not K(5).

Complete bipartite graphs: K(2, 3). Not K(3, 3).

Discrete Mathematics I – p. 288/292

Page 1348: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A graph is called planar, if it can be drawn on theplane without edge crossings.

Examples: any tree, any cycle

Complete graphs:K(1), K(2), K(3), K(4).

Not K(5).

Complete bipartite graphs: K(2, 3). Not K(3, 3).

Discrete Mathematics I – p. 288/292

Page 1349: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A graph is called planar, if it can be drawn on theplane without edge crossings.

Examples: any tree, any cycle

Complete graphs:K(1), K(2), K(3), K(4). Not K(5).

Complete bipartite graphs: K(2, 3). Not K(3, 3).

Discrete Mathematics I – p. 288/292

Page 1350: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

A graph is called planar, if it can be drawn on theplane without edge crossings.

Examples: any tree, any cycle

Complete graphs:K(1), K(2), K(3), K(4). Not K(5).

Complete bipartite graphs: K(2, 3).

Not K(3, 3).

Discrete Mathematics I – p. 288/292

Page 1351: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) How to test if G is planar?

Subdivision: Let u ⇀ v. Add new node x

Replace u ⇀ v by u ⇀ x ⇀ v

G non-planar ⇒ new graph non-planar

Discrete Mathematics I – p. 289/292

Page 1352: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) How to test if G is planar?

Subdivision: Let u ⇀ v.

Add new node x

Replace u ⇀ v by u ⇀ x ⇀ v

G non-planar ⇒ new graph non-planar

Discrete Mathematics I – p. 289/292

Page 1353: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) How to test if G is planar?

Subdivision: Let u ⇀ v. Add new node x

Replace u ⇀ v by u ⇀ x ⇀ v

G non-planar ⇒ new graph non-planar

Discrete Mathematics I – p. 289/292

Page 1354: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) How to test if G is planar?

Subdivision: Let u ⇀ v. Add new node x

Replace u ⇀ v by u ⇀ x ⇀ v

G non-planar ⇒ new graph non-planar

Discrete Mathematics I – p. 289/292

Page 1355: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

G = (V, E) How to test if G is planar?

Subdivision: Let u ⇀ v. Add new node x

Replace u ⇀ v by u ⇀ x ⇀ v

G non-planar ⇒ new graph non-planar

Discrete Mathematics I – p. 289/292

Page 1356: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Only K(5) and K(3, 3) are “really” non-planar.

Theorem (Kuratowski). A graph is planar iff it has nosubgraph obtained from K(5) or K(3, 3) bysubdivisions.

Proof: difficult.

Discrete Mathematics I – p. 290/292

Page 1357: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Only K(5) and K(3, 3) are “really” non-planar.

Theorem (Kuratowski). A graph is planar iff it has nosubgraph obtained from K(5) or K(3, 3) bysubdivisions.

Proof: difficult.

Discrete Mathematics I – p. 290/292

Page 1358: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Only K(5) and K(3, 3) are “really” non-planar.

Theorem (Kuratowski). A graph is planar iff it has nosubgraph obtained from K(5) or K(3, 3) bysubdivisions.

Proof: difficult.

Discrete Mathematics I – p. 290/292

Page 1359: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Recall: if G = (V, E) a tree, then |V | = |E|+ 1.

Generalisation: G = (V, E) — planar

Drawing of G partitions the plane into faces

Let F be the set of all faces

Discrete Mathematics I – p. 291/292

Page 1360: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Recall: if G = (V, E) a tree, then |V | = |E|+ 1.

Generalisation: G = (V, E) — planar

Drawing of G partitions the plane into faces

Let F be the set of all faces

Discrete Mathematics I – p. 291/292

Page 1361: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Recall: if G = (V, E) a tree, then |V | = |E|+ 1.

Generalisation: G = (V, E) — planar

Drawing of G partitions the plane into faces

Let F be the set of all faces

Discrete Mathematics I – p. 291/292

Page 1362: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Recall: if G = (V, E) a tree, then |V | = |E|+ 1.

Generalisation: G = (V, E) — planar

Drawing of G partitions the plane into faces

Let F be the set of all faces

Discrete Mathematics I – p. 291/292

Page 1363: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Examples:

G is a tree: |V | = |E|+ 1 |F | = 1

G has one cycle: |V | = |E| |F | = 2

Theorem (Euler). For any planar graph G,|V | − |E|+ |F | = 2.

Proof: induction.

Discrete Mathematics I – p. 292/292

Page 1364: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Examples:

G is a tree: |V | = |E|+ 1 |F | = 1

G has one cycle: |V | = |E| |F | = 2

Theorem (Euler). For any planar graph G,|V | − |E|+ |F | = 2.

Proof: induction.

Discrete Mathematics I – p. 292/292

Page 1365: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Examples:

G is a tree: |V | = |E|+ 1 |F | = 1

G has one cycle: |V | = |E| |F | = 2

Theorem (Euler). For any planar graph G,|V | − |E|+ |F | = 2.

Proof: induction.

Discrete Mathematics I – p. 292/292

Page 1366: Discrete Mathematics I - Computer Science Departmenttiskin/teach/dm1/o.pdf · Discrete maths in depth, highly recommended! ... Discrete Mathematics and its Applications Rosen (McGraw-Hill,

Graphs

Examples:

G is a tree: |V | = |E|+ 1 |F | = 1

G has one cycle: |V | = |E| |F | = 2

Theorem (Euler). For any planar graph G,|V | − |E|+ |F | = 2.

Proof: induction.

Discrete Mathematics I – p. 292/292