Docsity

Discrete Mathematics Review, Lecture Notes - Computer Science, Study notes of Mathematics

Partial preview of the text

Download Discrete Mathematics Review, Lecture Notes - Computer Science and more Study notes Mathematics in PDF only on Docsity!

Discrete Mathematics

Final Review

Zeph Grunschlag

Agenda

List of sections covered

Review major concepts with formulae

Sections Covered

6.1 Relation Basics 6.2 n-ary Relation 6.3 Representing Relations 7.1 Graph Basics 7.2 Graph Terminology 7.3 Graph Representations 7.4 Connectedness 7.5 Euler and Hamilton 7.7 Planar Graphs 7.8 Coloring

Sections Skipped

5.3, 5. 6.4, 6.5, 6.

Logic

A proposition is a statement that is true

or false. Atomic propositions p,q,r… are combined to form compound propositions using the following logical connectives :

Truth Tables

Logical operators/connectives are defined by

truth tables :

Negation truth table (unary):

Binary truth tables:

p  p

F
T
T
F

p q (^) p q p q p  q p  q (^) p  q T T F F

T
F
T
F
T
F
F
F
T
T
T
F
F
T
T
F
T
F
T
T
T
F
F
T

Bit Strings

Can define logical operators on bit

strings. This is done bit by bit. No

carry-over is taken.

EG:

 10 0010 1111 1001

Contrapositive vs. Converse

Given an implication p  q

the converse is q  p while the contrapositive is ¬ q  ¬ p

Logical Proofs

There are two basic techniques for proving

tautologies and logical equivalences:

  1. Build a truth table. Verify that…

last column is all TRUE for tautology relevant columns equal for equivalence

  1. Using tables on next pages, derive…

TRUE starting from supposed tautology 1 st^ proposition from 2nd

Tables of Logical Equivalences

 Excluded middle  Negating creates opposite  Definition of implication in terms of Not and Or

Quantifiers

Existential Quantifier

“” reads “there exists”

Universal Quantifier

“” reads “for all”

Order matters:

y  x R (x,y ) and  x  y R (x,y ) may

not be logically equivalent.

Logical English Logical Puzzles

Precise English statements can be expressed in terms of logical constructs. In cases of English puzzles, this can be useful for solving.

EG: Can there be a man that shaves exactly all the people that don’t shave themselves.

Let S(x,y) = “ x shaves y”. Asking if following

statement satisfiable:

 x  y S(y,y )  S(x,y)

Not satisfiable (trying plugging in y = x )^1

Standard Numerical Sets

Natural numbers: N = { 0, 1, 2, 3, 4, … }

Integers: Z = { … - 3, - 2, - 1, 0, 1, 2, 3, … }

Positive integers: Z+^ = {1, 2, 3, 4, 5, … }

Real numbers: R

Rational numbers: Q (decimal numbers with repeating decimal expansion)

Set Theoretic Operations

power set : P ( S ) or 2^ s

 2 nd^ version reminds us that |2^ s| = 2 |s|

Cartesian product :

 A  B = { (a, b) | a  A and b  B }  |A 1  A 2 … An| = |A 1 ||A 2 | … |An|

complement : A = { x | x  A }

union : A  B = { x | x  A  x  B }

intersection : A  B = { x | x  A  x  B }

difference : A - B = { x | x  A  x  B }

symmetric difference: A B={ x | x A  x B }

Venn Diagrams

Complement

Union

Intersection

Disjoint Union

A

U

A

A B

A  B^ U

A B

U

AB

A B

A  B^ U