56
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting Techniques Recurrence relations Trees Graphs Grades: First: 25% Second 25% Final 50% *Note: The outline is subject to change

Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Embed Size (px)

Citation preview

Page 1: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Course Outline

Book: Discrete Mathematics by K. P. BogartTopics:

Sets and statementsSymbolic LogicRelations functionsMathematical InductionCounting TechniquesRecurrence relationsTreesGraphs

Grades: First: 25%Second 25% Final 50%*Note: The outline is subject to change

Page 2: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Discrete Mathematics

Is the one we use to analyze discrete processes that are carried out in a step-by-step fashion.

Page 3: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Algorithm

A list of step by step instructions for carrying out a process

Page 4: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Chapter 1

Sets and Statements

Page 5: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Statements

A declarative sentence can be true, false or ambiguous

A statement is an unambiguous declarative sentence that is either true or false

Page 6: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Example

5 plus 7 is 12 5 plus 7 is 5 5 plus 7 is large Did you have coffee this morning?

Page 7: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Sets

Set: an unambiguous description of a collection of objects

EX:

Set of outcomes for flipping a coin

S={H,T}

However, the list of outcomes might be:

HTTTHHH…….

Page 8: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Sets

Members of a set are called elements– aA “a is an element of A”

“a is a member of A”– aA “a is not an element of A”

EX: Set of +ve integersS={x |x>0}3 S-5 S

Page 9: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Sets

Universe of a statement is the set whose elements are discussed by the statement

EX:x multiplied by x is +veThe universe could be:- Set of +ve integers- Set of –ve integers- Set of all integersFlipping a coin-Universe: {H,T}

Page 10: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Sets

Note: P, q, r, s are used to represent statements X, y, z, w are used to represent variables

Page 11: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Compound Statements

Simple statements are represented by symbolsEX: P: x is a positive integer Compound statements are represented by symbols+ logical

connectivesLogical Connectives:

– Conjunction AND. Symbol ^ – Inclusive disjunction OR Symbol v– Exclusive disjunction OR Symbol (+)– Negation Symbol ¬– Implication Symbol

Page 12: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Compound Statements

Example:-I will take calculas1 and I will take physics class.Represented as: p ^ q- I will have coffee or I will have teaRepresented as: p v q- Ali is at school or Ali is at homeRepresented as: p (+) q- p: x is greater than 2 ¬p: x is not greater than 2-George is at school and either Sue is at store or Sue is at home.P ^( q (+) r )*Note the use of parentheses ( see example 4 page 7).

Page 13: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Truth sets

The set of all values of x that make a symbolic statement p(x) true is called the truth set of the proposition p.

(the set of all values in the universe that makes p true).

The symbolic statements p(x) & q(x) are equivalent if they have the same truth sets.

Page 14: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Truth sets

EX:Universe: The result of flipping 2 coins

P: the result has one head q: the result has one tail

P and q are equivalent since they have the same truth sets.

Page 15: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Fundamental Principle of Set Equality

To show that the sets T and S are equal, we may show that each element in T is an element in S and vice versa.

EX:Universe: 300 coin flipsP: the result has 2 H’sq: the result has 298 T’sShow that p and q are equivalent.

Page 16: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Finite and infinite sets

Finite sets - Examples:

A = {1, 2, 3, 4} B = {x | x is an integer, 1 < x < 4} D = {dog, cat, horse} D = {dog, cat, horse}

Infinite sets- Examples:

Z = {integers} = {…, -3, -2, -1, 0, 1, 2, 3,…} Natural numbers N = {0, 1, 2, 3, …} S={x| x is a real number and 1 < x < 4} = [0, 4]

Page 17: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Section 1.2: Sets

Page 18: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Venn diagrams

A Venn diagram provides a graphic view of sets and their operations: union, intersection, difference and complements can be identified

Page 19: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Set operations

Given two sets X and Y the following are operations that can be performed on them:– Union– Intersection– Complement– Difference

Page 20: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Union

The union of X and Y is defined as the set A B = { x | x A or x B}

Page 21: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Intersection

The intersection of X and Y is defined as the set: X Y = { x | x X and x Y}

Two sets X and Y are disjoint

if X Y =

XY

xy

XY

X Y =

Page 22: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Complement

The complement of a set Y contained in a universal set U is the set Yc = U – Y

YUYc

Page 23: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Difference

The difference of two sets

X – Y = { x | x X and x Y}

The difference is also called the relative complement of Y in X

X YX-y

Page 24: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Properties of set operations

Theorem : Let U be a universal set, and A, B and C subsets of U.

The following properties hold:a) Associativity: (A B) C = A (B C) (A B) C = A (B C)b) Commutativity: A B = B A A B = B A

Page 25: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Properties of set operations (2)

c) Distributive laws: A(BC) = (A B) (A C) A(BC) = (A B) (A C)

d) Identity laws: AU=A A = A

e) Complement laws: AAc = U AAc =

Page 26: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Properties of set operations (3)

f) Idempotent laws:

AA = A AA = A

g) Bound laws:

AU = U A =

h) Absorption laws:

A(AB) = A A(AB) = A

Page 27: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Properties of set operations (4)

i) Involution law: (Ac)c = A

j) 0/1 laws: c = U Uc =

k) De Morgan’s laws for sets:

(AB)c = AcBc

(AB)c = AcBc

Page 28: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Demorgan’s Laws for sets

~(A B) = (~A) (~B)

-Proof: To be discussed in class

~(A B) = (~A) (~B)

-Proof: exercise

Page 29: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Theorem

Let p and q be statements and let P and Q be their truth sets, then:

- P Q is the truth set of p^q (proof discussed in class)

- P Q is the truth set of pvq- ~P is the truth set of ¬p

Page 30: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Example: Venn Diagrams

Show that P (Q R) = (P Q) (P R)

Using Venn diagrams

- See example 9 page 18

Page 31: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Subsets

It is a relation between sets ( not operation) A set S is a subset of set T if each element in S is also an

element in T. Examples:

A = {3, 9}, B = {5, 9, 1, 3}, is A B ?

A = {3, 3, 3, 9}, B = {5, 9, 1, 3}, is A B ?

A = {1, 2, 3}, B = {2, 3, 4}, is A B ?

Equality: X = Y if X Y and Y X

Page 32: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Subsets using Venn diagrams

The ellipse is a subset of the circle

Page 33: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Theorem

Let R and S be two sets then:

- R and S are subsets of R S- R S is a subset of both R and S- R S = S if and only if R S- R S=R if and only if R S

Page 34: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Example

Prove that

R (S T) S (R T)

Page 35: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

The Empty Set

The empty set has no elements.

Also called null set or void set.

EX:

P is the truth set of p: x>0

Q is the truth set of q: x<0

The truth set of p^q = P Q= P and Q are disjoint sets

Page 36: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Section 1.3

Determining the Truth of Symbolic Statements

Page 37: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Truth tables

Truth tables are used to determine truth or falsity of compound statements

Page 38: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Truth table of conjunction

Truth table of conjunction

p ^ q is true only when both p and q are true.

p q p ^ q

T T T

T F F

F T F

F F F

Page 39: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Truth table of disjunction

p q is false only when both p and q are false

p q p v q

T T T

T F T

F T T

F F F

Page 40: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Exclusive disjunction

p (+) q is true only when p is true and q is false, or p is false and q is true. Example: p = "John is programmer, q = “John is a lawyer" p (+) q = "Either John is a programmer or John is a lawyer"

p q p (+) q

T T F

T F T

F T T

F F F

Page 41: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Negation

Negation of p: in symbols ¬p

¬ p is false when p is true, ¬ p is true when p is false Example: p = "John is a programmer" ¬ p = "It is not true that John is a programmer"

p ¬ p

T F

F T

Page 42: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Truth tables

Examples:

Truth table for :- ¬pvq- (pvq) ^ ¬(p^q)

Page 43: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Definition

2 statements are equivalent if their truth tables have the same final column

Page 44: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Exercise

Use the truth tables to find out whether the following statements are equivalent:

- (p^q) v (p^r)- P^(qvr)

Page 45: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Section 1.4

The Conditional Connectives

Page 46: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Conditional propositions and logical equivalence

A conditional proposition is of the form “If p then q” In symbols: p q Example:

– p = " John is a programmer"– q = " Mary is a lawyer "– p q = “If John is a programmer then Mary is a

lawyer"

Page 47: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Truth table of p q

p q is true when both p and q are true

or when p is false

p q p q

T T T

T F F

F T T

F F T

Page 48: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

P q is equivalent to ¬pvq

Recall: 2 statements are equivalent if their truth tables have the same final column

Exercise:Show that p q and ¬p v q are equivalent.

Note: it is important to represent the implication() and the exclusive OR(+) using other connectives (^,V, ¬), why??

Page 49: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Example

Rewrite without arrows:

¬r ( s v (r ^ t))

Page 50: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Example

Consider flipping a coin 3 times p is the statement “ the first flip comes up

heads” q is the statement “there are at least 2

heads”

Find the truth sets of p, q, pq

Answer: {TTT,TTH,THT,THH,HHH,HHT,HTH}

Page 51: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Section 1.5

Boolean Algebra:

When we apply known laws about set operations to derive other ones algebraically, we say we are doing Boolean Algebra.

Page 52: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Example: ( not required)

Use Boolean algebra to prove the unique inverse property. if x P= and x P = U then x= ~Px = x U (identity law) = x (P ~P) (inverse law) = (x P) (x ~P) (distributive law) = (x ~P) (given property) = (P ~P) (x ~P) (Inverse law) = (P x) ~P (distributive law) = U ~P (given property) = ~P (Identity law)

Page 53: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Boolean Algebra for statements

A formula says that 2 truth sets are equal corresponds to a formula saying that 2 statements are equivalent ( so all set laws are translated directly into statement laws).

The statements about a universe satisfy the following rules: a) Associativity: (p V q) V r = p v (q v r) (p ^ q) ^ r = p ^ (q^ r)

b) Commutativity: p V q = q V p p ^ q = q ^ p

Page 54: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Boolean Algebra for Statements

c) Distributive laws: p ^ (q v r) = (p ^ q) V (p ^ r) p V ( q ^ r) = (p V q) ^(p V r)

d) Identity laws: p^1=p pV0 = p

e) Complement laws: p V ¬p = 1 p ^ ¬p = 0f) Idempotent laws: p V p = p p ^ p = p

g) Bound laws: p V 1 = 1 p ^ 0 = 0

h) Absorption laws:p v ( p ^ q ) = p p ^ ( p v q) = p

Page 55: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

i) Double negation law: ¬ ¬p = p

j) De Morgan’s laws:

¬(p V q) = ¬ p ^ ¬ q

¬(p ^ q) = ¬ p V ¬q

Page 56: Course Outline Book: Discrete Mathematics by K. P. Bogart Topics: Sets and statements Symbolic Logic Relations functions Mathematical Induction Counting

Final Example

Simplify:- (¬ ¬r) V (s V (r ^ t))

Answer : r V s

- (¬ (r ^ s) V (r V s)) ^ (¬ (r V s) V (r ^ s))

Answer: (¬r ^ ¬s ) V (r ^ s)