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
Discrete Mathematics Is the one we use to analyze discrete processes that are carried out in a step-by-step fashion.
Algorithm A list of step by step instructions for carrying out a process
Chapter 1 Sets and Statements
Statements A declarative sentence can be true, false or ambiguous A statement is an unambiguous declarative sentence that is either true or false
Example 5 plus 7 is 12 5 plus 7 is 5 5 plus 7 is large Did you have coffee this morning?
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…….
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 integers S={x |x>0} 3 S -5 S
Sets Universe of a statement is the set whose elements are discussed by the statement EX: x multiplied by x is +ve The universe could be: Set of +ve integers Set of –ve integers Set of all integers Flipping a coin -Universe: {H,T}
Sets Note: P, q, r, s are used to represent statements X, y, z, w are used to represent variables
Compound Statements Simple statements are represented by symbols EX: P: x is a positive integer Compound statements are represented by symbols+ logical connectives Logical Connectives: Conjunction AND. Symbol ^ Inclusive disjunction OR Symbol v Exclusive disjunction OR Symbol (+) Negation Symbol ¬ Implication Symbol
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 tea Represented as: p v q Ali is at school or Ali is at home Represented 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).
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.
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.
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 flips P: the result has 2 H’s q: the result has 298 T’s Show that p and q are equivalent.
Finite and infinite sets - Examples: A = {1, 2, 3, 4} B = {x | x is an integer, 1 < x < 4} D = {dog, cat, horse} Infinite sets 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]
Section 1.2: Sets
Venn diagrams A Venn diagram provides a graphic view of sets and their operations: union, intersection, difference and complements can be identified
Set operations Given two sets X and Y the following are operations that can be performed on them: Union Intersection Complement Difference
Union The union of X and Y is defined as the set A B = { x | x A or x B}
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 = X Y xy X Y X Y =
Complement The complement of a set Y contained in a universal set U is the set Yc = U – Y Y Yc U
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 Y X-y
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
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 =
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
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
Demorgan’s Laws for sets ~(A B) = (~A) (~B) -Proof: To be discussed in class ~(A B) = (~A) (~B) -Proof: exercise
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
Example: Venn Diagrams Show that P (Q R) = (P Q) (P R) Using Venn diagrams - See example 9 page 18
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}, A = {1, 2, 3}, B = {2, 3, 4}, is A B ? Equality: X = Y if X Y and Y X
Subsets using Venn diagrams The ellipse is a subset of the circle
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
Example Prove that R (S T) S (R T)
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
Section 1.3 Determining the Truth of Symbolic Statements
Truth tables Truth tables are used to determine truth or falsity of compound statements
Truth table of conjunction p ^ q is true only when both p and q are true. p q p ^ q T F
Truth table of disjunction p q is false only when both p and q are false p q p v q T F
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 F
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
Truth tables Examples: Truth table for : ¬pvq (pvq) ^ ¬(p^q)
Definition 2 statements are equivalent if their truth tables have the same final column
Exercise Use the truth tables to find out whether the following statements are equivalent: (p^q) v (p^r) P^(qvr)
Section 1.4 The Conditional Connectives
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"
Truth table of p q p q is true when both p and q are true or when p is false
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??
Example Rewrite without arrows: ¬r ( s v (r ^ t))
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}
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.
Example: ( not required) Use Boolean algebra to prove the unique inverse property. if x P= and x P = U then x= ~P x = 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)
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
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 = 0 f) 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
i) Double negation law: ¬ ¬p = p j) De Morgan’s laws: ¬(p V q) = ¬ p ^ ¬ q ¬(p ^ q) = ¬ p V ¬q
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)