Discrete Mathematics

22
Discrete Mathematics Definition: D.M concern processes that consist of a sequence of individual steps. Logic: Logic is the study of the principals and methods that distinguish between a valid argument. Statement: A statement is a declarative sentence that is either true or false but not both. A statement is also refereed as a proposition. i.e. 2+2=4 (true) Today is Sunday (true) Not proposition: close the door X is written as 2 he is very rich Truth value of proposition: if proposition is true, we say that it has a truth value of “true”, denoted by “T”. If a proposition is false, we say that it has a truth value of “false”, denoted by “F”. i.e. Grass is Green (T) 4+2=6 (T) 4+2=7 (F)There are four fingers in a hand(F) Note: If the sentence is proceeded by other sentences that make the pronoun or variable reference clear, then sentence is a statement/proposition. Example: 1. If X=1 then X>2 (F) X>2 is a statement with truth value “(F)”. 2. Bill gates is an American. He is very rich (T) he is very rich is a statement with truth value (T) 3. X+2 is positive (not a statement) 4. May I come in (not a statement) 5. Logic is interesting (T) 6. It is hot today (T) 7. -1>0 (F) 8. X+5=12 (not a statement) Compound statement: Simple statements could be used to build the compound statement. i.e. 1. “3+2=5” and “Lahore is a city in Pakistan.” 2. “The grass is green” or “it is hot today.” 3. “Discrete Mathematics is not difficult to me” And, or, not are called logical connectives. Logical connectives:

Transcript of Discrete Mathematics

Page 1: Discrete Mathematics

Discrete Mathematics

Definition: D.M concern processes that consist of a sequence of individual steps.Logic: Logic is the study of the principals and methods that distinguish between a valid argument.Statement: A statement is a declarative sentence that is either true or false but not both. A statement is also refereed as a proposition.i.e. 2+2=4 (true) Today is Sunday (true)Not proposition: close the door X is written as 2 he is very richTruth value of proposition: if proposition is true, we say that it has a truth value of “true”, denoted by “T”.If a proposition is false, we say that it has a truth value of “false”, denoted by “F”.i.e. Grass is Green (T) 4+2=6 (T) 4+2=7 (F)There are four fingers in a hand(F)Note: If the sentence is proceeded by other sentences that make the pronoun or variable reference clear, then sentence is a statement/proposition.Example:1. If X=1 then X>2 (F) X>2 is a statement with truth value “(F)”.2. Bill gates is an American. He is very rich (T) he is very rich is a statement with

truth value (T)3. X+2 is positive (not a statement) 4. May I come in (not a statement)5. Logic is interesting (T) 6. It is hot today (T)7. -1>0 (F) 8. X+5=12 (not a statement)Compound statement: Simple statements could be used to build the compound statement. i.e.1. “3+2=5” and “Lahore is a city in Pakistan.”2. “The grass is green” or “it is hot today.”3. “Discrete Mathematics is not difficult to me”And, or, not are called logical connectives.Logical connectives:Connectives Meaning Symbol CalledNegation NOT ¬ TildeConjunction AND Λ HatDisjunction OR V ValConditional If…then… → ArrowBi-Conditional If and only if ↔ Double arrowSymbolic Representation: Statements are symbolically represented by letters such as p, q, r …!Example: let h =”Zia is healthy”

w =”Zia is wealthy”s =”Zia is wise”

SENTENCE SYMBOLIC FORM1. Zia is healthy & wealthy but not wise. (h Λ w) Λ ¬s2. Zia is not wealthy but he is healthy and wise. ¬w Λ(h Λ s)3. Zia is neither healthy, wealthy nor wise. ¬h Λ ¬w Λ ¬sTranslate from symbols to English:Example:

Page 2: Discrete Mathematics

Let p=”Islamabad is the Capital of Pakistan.”q=”17 is divisible by 3.”

SYMBOLS SENTENCE1. p Λ q Islamabad is the Capital of Pakistan and 17 is divisible by3.2. p V q Islamabad is the Capital of Pakistan or 17 is divisible by 3.3. ¬p Islamabad is not the Capital of Pakistan.Example:Let m = “Ali is good in Mathematics.”

c = “Ali is a Computer Science student.”SYMBOLS SENTENCE1. ¬c Ali is not a Computer Science student.2. c V m Ali is a Computer Science student or is good in Mathematics.3. m Λ ¬c Ali is good in Mathematics but not is a Computer Science student.Truth Table: A convenient method for analyzing a compound proposition is to make a truth table for it.

A truth table specifies a truth value of a compound proposition for all possible truth values of its constituent proposition.Negation: If p is a statement variable, then the negation of p, “NOT”, is denoted by “¬p”.

It has opposite truth values, the value from p. i.e. If p is true, ¬p is false; If p is false, ¬p is true.

Truth table for ¬p: Conjunction: If p and q are statements, then the conjunction of p& q is “p and q”, denoted by “p Λ q”.

It is true when, and only when, both p& q are true. If either p or q is false or both are false, then p& q is false.Truth table for p Λ q: Disjunction: if p and q are statements, then the disjunction “p OR q” is denoted by “p V q”.

It is true when at least of p or q is true & is false only when both p& q are false.Truth table for p V q:Q: construct truth table for following statements;(i) ¬p Λ q(ii) ¬p Λ (q V ¬r)(i) (ii)

p ¬pF FT T

p q p Λ qT T TT F FF T FF F F

p q p V qT T TT F TF T TF F F

p q r ¬p ¬r q V ¬r ¬p Λ (q V ¬r)T T T F F T FT F T F F F FT T F F T T FT F F F T T FF T T T F T TF T F T T T TF F T T F F FF F F T T T T

p q ¬p ¬p Λ qT T F FT F F FF T T TF F T F

Page 3: Discrete Mathematics

(iii) (p V q) Λ ¬(p Λ q)p q p V q p Λ q ¬(p Λ q) (p V q) Λ ¬(p Λ

q)T T T T F FT F T F T TF T T F T TF F F F T FExclusive OR: when OR is used in its exclusive sense, then the statement “pORq” means p or q but not both.

OR“p OR q and not p AND q.”

Symbols of Exclusive OR: p q or p XOR qLogical Equivalence:two statement forms are called logically equivalent of and only if, they have identical truth values for all possible truth values for their statement variables.Symbol: ‗ Double Negation law or Involution law: if p is a statement, the the double negation law is stated as ¬ (¬p)

Prove:Demorgan’s law:1. The negation of AND statement is logically equivalent to the OR statement in which each component is negative. ¬ (p Λ q) ‗ ¬p V ¬q p q ¬p ¬q p Λ q ¬ (p Λ q) ¬p V ¬qT T F F T F FT F F T F T TF T T F F T TF F T T F T T2. The negation of OR statement is logically equivalent to the AND statement in which each component is negative. ¬(p V q) ‗ ¬p Λ ¬qp q ¬p ¬q p V q ¬(p V q) ¬p Λ ¬qT T F F T F FT F F T T F FF T T F T F FF F T T F T T

Q: Use Demorgan’s law to write the negation of (-1< x >4)Solution: For some particular middle no. x, 1-< x >4 means x >-1 and x <= 4. By Demorgan’s law, the negation of x >-1 and x <=4 is; ¬ (p Λ q) ‗ ¬p V ¬q x <= -1 OR x >4.Q: Rewrite in a simplest form, “It is not true that T cannot happy.”Solution: let p = “I am happy” => (statements are always written in positive format)

¬p =”I am not happy”and ¬(¬p) =”It is not true that I am not happy.”Since ¬ (¬p) ‗ p

Hence the given statement is equivalent to; “I am happy.”Q: Prove that ¬ (p Λ q) and ¬p Λ ¬q are not equivalent.p q ¬p ¬q p Λ q ¬(p Λ q) ¬p Λ ¬q

p ¬p ¬ (¬p)

T F TF T F

Page 4: Discrete Mathematics

T T F F T F FT F F T F T FF T T F F T FF F T T F T T ¬(p Λ q) ‗ ¬p Λ ¬qQ 1: Are the statements (p Λ q) Λ r and p Λ (q Λ r) logically equivalent?p q r p Λ q q Λ r (p Λ q) Λ r P Λ (q Λ r)T T T T T T TT F T F F F FT T F T F F FT F F F F F FF T T F T F FF T F F F F FF F T F F F FF F F F F F FHence (p Λ q) Λ r ‗ p Λ (q Λ r);Q 2: Are the statements (p Λ q) V r and p Λ (q V r) logically equivalent? p q r p Λ q q V r (p Λ q) V r p Λ(q V r)T T T T T T TT F T F T T TT T F T T T TT F F F F F FF T T F T T FF T F F T F FF F T F T T FF F F F F F F(p Λ q) Λ r ≠ p Λ (q Λ r);Tautology: It is a statement form that is always true regardless of the truth values of the statement variables.

Tautology is represented by the symbol (t).Example: The statement form p V ¬p is a Tautology. p V ¬p ‗ tContradiction: It is a statement form that is always false regardless of the truth values of the statement variables. A Contradiction is represented by the symbol “c”.Example: the statement form p Λ ¬p is a Contradiction. p Λ ¬p ‗ cQ 1: (p Λ q) V (¬p V(p Λ ¬q)) ‗ tp q ¬p ¬q p Λ q (p Λ ¬q) (¬p V(p Λ ¬q)) (p Λ q) V (¬p V(p Λ ¬q))

‗ tT T F F T F F TT F F T F T T TF T T F F F T TF F T T F F T T

p ¬p P V ¬pT F TF T T

p ¬p P V ¬pT F TF T T

Page 5: Discrete Mathematics

Q 2: (p Λ q) Λ (¬p V ¬q) ‗ c

p q ¬p ¬q p Λ q ¬p V ¬q) (p Λ ¬q) Λ (¬p V ¬q) ‗ c

T T F F T F FT F F T F T FF T T F F T FF F T T F T FLaws of logic: For any given statement variables p, q & r having Tautology ‘t’ and Contradiction ‘c’, the following logical equivalences hold;Sr. No.

Law Logical Equivalences

1. Double negation law ¬(¬p) ‗ p2. Negation law p V ¬p ‗ t & p Λ ¬p ‗ c3. Negation of ‘t’ & ‘c’ ¬t ‗ c & ¬c ‗ t4. Identity law p Λ t ‗ p & p V c ‗ p5. Idempotent law p Λ p ‗ p & p V p ‗ p6. Universal found law

orDomination law

p V t ‗ t p Λ c ‗ c

7. Cumulative law p Λ q ‗ q Λ p & p V q ‗ q V p8. Associative law (p Λ q) Λ r ‗ p Λ (q Λ r) & ((p V q) V r ‗ p V (q V

r)9. Distributive law p Λ (q V r) ‗ (p Λ q) V (p Λ r) & p V (q Λ r) ‗ (p V

q) Λ (p V r)10. Demorgan’s law ¬(p Λ q) ‗ ¬p V ¬q & ¬(p V q) ‗ ¬p Λ ¬q11. Absorption law p V (p Λ p) ‗ p & p Λ ( p V p) ‗ pQ: Prove all Laws of logic. Proved as separate assignment…!Q: Simplify p Λ {¬ (¬p V ¬ (q)}

‗ p Λ {¬ (¬p V ¬(q)} Demorgan’s law‗ p Λ {p V ¬(q)} Double negation law‗ (p Λ p) V (p Λ ¬q) Associative law‗ p V ¬ (q) Idempotent law

Q: Verify ¬(¬p Λ q) Λ (p V q) ‗ pL.H.S ‗ ¬(¬p Λ q) Λ (p V q)

‗ {¬ (¬p) V ¬q} Λ (p V q) Demorgan’s law‗ {p V ¬q} Λ (p V q) Double negation law‗ p V (¬q Λ q) Distributive law (in reverse)‗ p V c Negation law‗ p Identity law

Q: Simplify the statement, “You’ll get an A if you are hardworking and sun shines, or you are hardworking and it rains.”Solution: let p =”You are hardworking”

q =”The sun shines”

Page 6: Discrete Mathematics

r =”It rains”The condition is then (p Λ q) V (p Λ r) ‗ p Λ (q V r) (Distributive law)Putting p Λ (q V r) back into English, we can rephrase the given statement as:“You’ll get an A if you are hardworking and the sun shines or it rains.”Q: Use logical equivalence to rewrite each of the following sentences more simply.

1. “It is not true that I’m tired and you are smart.”Let p = “I’m tired”

q = “you are smart”The condition is then ¬ (p Λ q) ‗ ¬p V ¬q (Demorgan’s law)Putting ¬p V ¬q back into English, we can rephrase the given statement as:“It is true that I’m not tired or you are not smart.”2. “It is not true that I’m tired or you are smart.”Let p = “I’m tired”

q = “You are smart”The condition is then ¬ (p V q) ‗ ¬p Λ ¬q (Demorgan’s law)Putting ¬p Λ ¬q back into English, we can rephrase the given statement as:“It is true that I’m not tired and you are not smart.”3. I forgot my pen or my bag and I forgot my pen or my glasses.”Let p = “My pen”

q = “My bag”r= “My glasses”

The condition is then (p V q) Λ (p V r) ‗ p V (q Λ r) (Distributive law)Putting p V (q Λ r) back into English, we can rephrase the given statement as:

“I forgot my pen or my bag and glasses.”4. “It is raining and I’ve forgotten my umbrella, or it is raining and I’ve forgotten

my hat.”Let p = “It is raining”

q = “My umbrella”r = “My hat”

The condition is then (p Λ q) V (p Λ r) ‗ p Λ (q V r) (Distributive law)Putting p Λ (q V r) back into English, we can rephrase the given statement as:

“It is raining and I’ve forgotten my umbrella or hat.”Conditional statements or Implications: If p and q are statement variables, then condition of q by pl is “if p, then q” or “p implies q” and is denoted by ‘p→q’.The original statement is saying that “If p is true, then q is true.”The arrow ‘→’ is the conditional operator, p is called Hypothesis(or Antecedent) and q is called Conclusion(or Consequent).Truth table for p→q:

i.e. p → q is ‘false’ when p is true and q is false, otherwise ‘true’, as if hypothesis is true then conclusion cannot be false.

Statements Truth values1. “If 1=1, then 3=3” T

p q P→qT T TT F FF T TF F T

Page 7: Discrete Mathematics

2. “If 1=1, then 2=3” F3. “If 1=0, then 3=3” T4. “If 1=2, then 2=3” T5. “If 1=1, then 1=2 & 2=3” F6. “If 1=3 or 1=2, then 3=3” T

Alternative ways of expressing Implications:1. “If p then q” 2. “p implies q” 3. “If p, q”4. “p only if q” 5. “p is sufficient for q” 6. “Not unless q”7. “q follows from p” 6. “q if p” 9. “q whenever p”10. “q is necessary for p”Exercises:

1. “Your guarantee is good only if you buying your cd player less than 90 days ago.”“If your guarantee is good, then you must have bought your cd player less than 90 days ago.”

2. “To get tenure as a professor, it is sufficient to be world famous”“If you are world famous then it is sufficient to get tenure as a professor.”

3. “Dad! You get the job that you have the best credentials.”“Dad! If you have the best credentials then you’ll get the job.”

4. “It is necessary to walk 8 miles to get the top of the peak.”“If you want to get the top of the peak then it is necessary to walk 8 miles daily.”Q: translate the following English sentences into symbols.1. “To get an A in this class, it is necessary for you to get an A in the final.”2. you do every exercise in this book; you get an A in the final, implies, you get an A in the class.”Q: Translate the following symbolic propositions into English.Let p, q, & r be the propositions;p = “You have the flu”q = “You miss the final exam”r = “You pass the course”1. p → q 2. ¬q → ¬r 3. ¬p Λ ¬q → rImplication law: The implication law is stated as

p → q ‗ ¬p V qp q ¬p p → q ¬p V qT T F T TT F F F FF T T T TF F T T TNegation of a conditional statement: We know that p → q ‗ ¬p V q

¬(p → q) ‗ ¬ (¬p V q) ‗ ¬ (¬p) Λ (¬q) Demorgan’s law

‗ p Λ (¬q) Double Negation lawHence ¬ (p → q) ‗ p Λ (¬q)

Inverse of a conditional statement: The inverse of the conditional statement, p → q is q → p. The Truth table for converse of p → q:p q q → p

Page 8: Discrete Mathematics

T T TT F TF T FF F TExamples:Write the inverse and converse of the following statements:1. “If today is Friday, then 2+3=5.”2. “If it snows today, I’ll go to University tomorrow.”3. “If p is a square, then p is a tangent.”4. “If my car is in the repair shop, then I cannot get to class.”5. “Write Truth table for p V ¬q → ¬p.”p q ¬p ¬q p V ¬q p V ¬q → ¬pT T F F T FT F F T T FF T T F F TF F T T T T

Contra positive of a conditional statement: The Contra positive of the conditional statement p → q is ¬q → ¬p

A conditional statement and its Contra positive are equivalent.i.e. p → q ‗ ¬q → ¬pTruth table for Contra positive of p → q:

p q ¬p ¬q ¬q → ¬p p → qT T F F T TT F F T F FF T T F T TF F T T T T

Construct the Truth table for (p → q) Λ (¬p → r):p q r ¬p p → q ¬p → r (p → q) Λ (¬p → r)T T T F T F FT F T F T F FT T F F T T TT F F F T T TF T T T F T FF T F T F T FF F T T T T TF F F T T T T

Biconditional (↔): If p and q are statement variables, then the Biconditional of p & q is “p if, and only if, q” and is denoted by “p ↔ q”.

The words if and only if are sometimes abbreviated as ‘iff’. The double headed arrow “↔” is called Biconditional operator. “p ↔ q” is true when p and q, both are the same, otherwise false.Truth table for p ↔ q:p q p ↔ qT T TT F F

Page 9: Discrete Mathematics

F T FF F TAlternate ways of expressing Biconditional: p ↔ q can also be expressed as;1. p is necessary and sufficient for q.2. If p then q, and conversely.3. p is equivalent to q.Examples:Statements Truth values1. 1+1=3 iff earth is flat. T2. Sky is blue, iff 1=0. F3. Milk is white, iff birds lay eggs. T4. 33 is divisible by 4, iff horse has four legs. F5. x>5, iff x2>25. TExample:Write the following English statements in the form of iff.

1. If it is hot outside, you buy an Ice-cream cone and if you buy an Ice-cream cone, it is hot outside.

You buy an Ice-cream cone off it is hot outside.2. For you to win the match, it is necessary and sufficient that you have the only

winning cricket.You win the match iff you have the winning cricket.

3. It rains if it is a weekend day and it is a weekend day if it rains.It rains iff it is a weekend.

4. The train runs late on exactly those days when I take it.The train runs late iff I take it.

5. This number is divisible by 6 precisely when it is divisible by both 2 & 3.This number is divisible by 6 precisely iff it is divisible by both 2 & 3.Hierarchy of operators for Logical connectives:1. ¬ weakest (1st)2. Λ, V strong (next)3. →, ↔ strongest (last)Solve them:1. An implication is logically equivalent to its Contra positive.2. The converse and Inverse of an implication are logically equivalent.3. An implication is not equivalent to its Converse.4. Write the Truth table for p V ¬q → ¬p5. Write the Truth table for p Λ ¬r ↔ q V rQ: p Λ ¬r ↔ q V r ‗ p Λ (¬r) ↔ q V r ‗ (p Λ (¬r) ↔ (q V r)Q: Suppose that p & q are statements so that p → q is false. Find the Truth table of each of the following;1. ¬p → q 2. p V q 3. q → p 4. q ↔ pQ: Suppose that a Composite statement is p V q → (r ↔ ¬s).Let the Truth values for p, q, r & s are (T, F, F & T) respectively. What is the Truth value of the given statement; p V q → (r ↔ ¬ s)

T F F T

Page 10: Discrete Mathematics

FT T

THence, the Truth value of given statement is True.

Solution:Write the truth table for;

1. P V ¬q → ¬pp q ¬p ¬q p V ¬q p V ¬q → ¬pT T F F T FT F F T T FF T T F F TF F T T T T

2. p Λ ¬r ↔ q V rp q r ¬r p Λ ¬r q V r p Λ ¬r ↔ q V rT T T F F T FT F T F F T FT T F T T T TT F F T T F TF T T F F T FF T F T F T FF F T F F T FF F F T F F F

3. Suppose that p & q are statements, so that p → q is false, find the truth value of each of the following;

(i).¬p → q (ii). p V q (iii). q → p (vi). q ↔ pTable for Exclusive OR:p q p qT T FT F TF T TF F FThat is p q is false, when p and q both are same; otherwise true.Questions:(i). Prove that ¬p ↔ q ‗ p ↔ ¬qp q ¬p ¬q ¬p ↔ ¬q p ↔ ¬qT T F F F FT F F T T TF T T F T TF F T T F F(ii). Prove that ¬ (p q) ‗ p ↔ qp q p q ¬ (p q) p ↔ qT T F T TT F T F FF T T F F

Page 11: Discrete Mathematics

F F F T TLaws of Logic:Sr. No. Law Logical Equivalence

1 Commutative law P ↔ q ‗ q ↔ p2 Implication law p → q ‗ ¬p V q ‗ ¬ (p Λ

¬q)3 Exportation law (p Λ q) → r ‗ p → (q → r)4 Equivalence law (p ↔ q) ‗ (p →q) Λ (q

→p)5 p → q ‗ (p Λ ¬q) → c

Questions:Use logical equivalences:p →q ‗ ¬p V q; p V q ‗¬ (¬p Λ ¬q) & p ↔ q ‗ (¬p V q) Λ (¬ q V p)To rewrite the given statement form without using the symbols → & ↔.

Page 12: Discrete Mathematics

Chapter - LOGICSet: A well defined collection of objects is called a Set. The objects are called the elements or numbers of the Set. Sets are denoted by capital letters A, B, C, …, X,Y, Z. The elements of

a Set are denoted by lower case letters a, b, c, …, x, y, z. If an object ‘x’ is a member of a Set ‘A’, then we write x є A, which

reads “x belongs to A” or “x is in A” or “x is an element of A”. Otherwise we write x ¢ A, which reads “x does not belong to A” or “x

is not in A” or “x is not an element of A”.Ways to express Sets:1. Tubular form: Listing all the elements of Set, separated by commas and enclosed by brackets. i.e. A= {1, 2, 3, 4, 5}; B= {2, 4, 6, …, 50}; C= {1, 3, 5, …}2. Descriptive form: Stating in words the elements of a Set. e.g.A= {set of first five natural numbers};B= {set of positive even integers < 50}; C= {set of positive odd integers}3. Set builder form: Writing in symbolic form, the common characteristics by all the elements of a Set. e.g.A= {x є N: x ≤ 5; B= {x є E: 0 <x ≤ 50}; C= {x є O: x > 0}Sets of Numbers:1. Set of natural numbers: N= {1, 2, 3, 5, 7, 9…}2. Set of whole numbers: W= {0, 1, 2, 3 …}3. Set of integers: Z= {0,

±1, ±2, ±3 …} = {…, -3, -2, -1, 0, 1, 2, 3…}

4. Set of even integers: E= {0, ±2, ±4, ±6…}5. Set of odd integers: O= {±1, ±3, ±5…}6. Set of prime numbers: P= {2, 3, 5, 7, 11, 13, 17, 19…}7. Set of rational numbers: Q= {x: x= p/q; p, q є Z, q ≠ 0}8. Set of irrational numbers: Q`= {x: x ≠ Q}9. Set of real numbers: IR= {Q U Q`}

Subset: If A & B are two sets, A is called a subset of B, written as A ≤ B, if and only if every element of A is also an element of B.Symbolically: A ≤ B ↔ if x є A then x є B.Remarks: 1. When A ≤ B, then B is called a superset of A.

2. When A ≤/ B, then there exist at least one x є A, such that x ¢ B.Proper subset: Let A & B be sets. A is a Proper subset of B, iff every element of A is in B but there is at least one element of B that is not in A and it can be written as A < B. (A is Proper subset of B)Example:1. Let A = {1, 3, 5} & B = {1, 2, 3, 5} then A < B2. Let N < WEqual sets: Two sets A & B are equal off every element of A is in B and every element of B is in A. It is denoted as A = B.Symbolically: A = B iff A ≤ B & B ≤ A.

Page 13: Discrete Mathematics

Example: Let A = {1, 2, 3, 6} B = {The set of positive divisors of 6}C = {3, 1, 6, 2} D = {1, 2, 2, 3, 6, 6, 6} Sets A, B, C & D are equal sets.Null set: A set which contains no element is called a Null set, or an Empty set or a Void set.Symbolically: It is denoted by a Greek letter Φ (phi) or { }.Example: 1. A = {x: x is a person taller than 50 feet} => A = Φ

2. B = {x: x2 = 4, x is odd} => B = ΦTrue / False:1. x є {x} T 2. {x} ≤ {x} F3. {x} є {x} F 4. {x} є {{x}} T5. Φ ≤ {x} F 6. Φ є {x} TUniversal set: The set of all elements under consideration is called Universal set. The Universal set is usually denoted by ‘U’.Venn diagram: A Venn diagram is a graphical representation of sets by regions in plain.Finite and Infinite sets: A set ‘S’ is said to be Finite if it contains exactly ‘m’ distinct elements, where m denotes some non-negative integers. In such a case we write |S| = m or n(S) = m (no. of elements in S is m).

A set is said to be Infinite if it is not Finite.Example: 1. The set S of letters of English alphabets is Finite. |S| = 26.

2. The Null set, Φ has no elements, is Finite. |Φ| = 0.3. The set of positive integers is an Infinite set.

Exercises: (Finite / Infinite)1. A = {1 in the year} Finite 2. B = {even integers} Infinite3. C = {positive integers less than 1} Finite 4. E = {Lines parallel to x-axis} Infinite5. F = {x є R: x 100+29x50-1=0} Finite 6. G = {Circles through origin} InfiniteMembership table: A table displaying the membership of elements in sets. To indicate that an element is in a set, a ‘1’ is used. To indicate that an element is not in a set, a ‘0’ is used.Union of sets: Let A & B be subsets of a Universal set U. The union of sets A & B is the sets of all elements in U that belongs to A or to B or to both and is denoted by A U B.Symbolically: A U B = {x є U: x є A or x є B}Example: Let U = {a, b, c, d, e, f, g} A = {a, c, e, g} & B = {b, e, f, g}Then, A U B = {a, c, e, g} U {b, e, f, g} => A U B = {a, b, c, e, f, g}Remarks: 1. A U B = B U A.

2. A ≤ A U B & B ≤ A U B.Membership table for A U B:Venn diagram for A U B:Intersection of Sets: Let A & B be subsets of a Universal set U. The Intersection of sets A & B is the set of all elements in U that belongs to both A & B and is denoted by A ∩ B.Symbolically: A ∩ B = {x є U: x є A and x є B}Example: From upper statements, A ∩ B = {e, g}Remarks: 1. A ∩ B = B ∩ A 2. A ∩ B ≤ A or A ∩ B ≤ B

3. If A ∩ B = φ, then A & B are called disjoint sets.

A Ac

1 00 1

A B A U B1 1 11 0 10 1 10 0 0

U

A B

U

A B

Page 14: Discrete Mathematics

Membership table for A ∩ B: Venn diagram for A ∩ B:

Set difference: Let A & B be subsets of a Universal set U. the difference of A & B (or relative complements of B in A) is the set of all elements in U that belongs to A but not to B, and is denoted by A – B or A \ B.Symbolically: A – B = {x є U: x є A and x ¢ B}.Example: From upper statements, A – B = {a, c}Remarks: 1. A – B ≠ B – A 2. A – B ≤ A

3. A – B; A ∩ B & B – A aremutually disjoint sets.

Membership table for A – B:Venn diagram for A – B: Complement of a set: Let A be subset of Universal set U. the complement of A is the set of all elements in U that do not belongs to A. It is denoted by Ac, Ā or A`.Symbolically: Ac = {x є U: x ¢ A}Example: From upper statements;U = { a, b, c, d, e, f, g} A = {a, c, e, g} Ac = {b, d, f}Remarks: 1. Ac = U – A. 2. A ∩ Ac = φ 3. A U Ac = U.Membership table for Ac:Venn diagram for Ac: Exercises:

1. Let U = {1, 2, 3, …, 10}X = {1, 2, 3, 4, 5} Y = {y: y = 2x, x є X}Z = {z = z2 – 9z + 14 = 0}

Find; 1. X ∩ Y 2. Y U Z. 3. X – Z. 4. Yc. 5. Xc – Zc. 6. (X – Z)c.2. Let U = {x є U: x є Z, 0 ≤ x, ≤ 10} P = {x є U: x is a prime}

Q = { x є U : x2 < 70} Find?1. Draw a Venn diagram for above.2. Pc ∩ Q = ?Solution:1. Y = {2, 4, 6, 8, 10} Z = {2}

Xc = {6, 7, 8, 9, 10} Zc = {1, 3, 4, 5, 6, 7, 8, 9, 10}

(i). X ∩ Y = {2, 4} (ii). Y U Z = {2, 4, 6, 8, 10} (iii). X – Z = {1, 3, 4, 5}(iv). Yc = {1, 3, 5, 7, 9} (v). Xc – Zc = {} (vi). (X – Z)c = {2, 6, 7, 8, 9, 10}

(i). Draw Venn diagram of above;

A B A U B1 1 11 0 10 1 10 0 0

A B A U B1 1 01 0 10 1 00 0 0

A U – A1 00 1

U

A B

U

A B

U

A

UQ

P

Page 15: Discrete Mathematics

(ii). Pc U Q = ?Pc = U – P = {0, 1, 2, ,3 ,4, ,5, 6, 7, 8, 9, 10} – {2, 3, 5, 7} = {0,1,4,6,8,9,10}Pc ∩ Q = {1, 4, 6, 8}Q. Let U = {1, 2, 3, 4, 5} and C = {1, 3} where A & B are empty sets. Find A in each of the following:1. A U B = U ; A ∩ B = Φ and B = {1}Solution: Given:A U B = U and A ∩ B = ΦAccording to Venn diagram;Since, A U B = U & A ∩ B = ΦTherefore; A = Bc

A = Bc = {1}c = U – {1} So, A = Bc = {2, 3, 4, 5}2. A < B = U and A U B = {4, 5}Solution: Given:A < B and A U B = {4, 5}According to Venn diagram;=> A < B < A U B = {4, 5} So,

A < A U B = {4, 5}=> A = {4} or A = {5}1. Idempotent law A U B = A; A ∩ A = A2. Commutative law A U B = B U A; A ∩ B = B ∩ A3. Associative law A U (B U C) = (A U B) U C;

A ∩ (B ∩ C) = (A ∩ B) ∩ C4. Universal law A U (B ∩ C) = (A U B) ∩ (A U C);

A ∩ (B U C) = (A ∩ B) U (A ∩ C)5. Identity law A U Φ = A; A ∩ Φ = Φ

A U U = U; A ∩ U = A6. Compliment law A U Ac = U; A ∩ Ac = Φ

Uc = Φ; Φc = U7. Double compliment law (Ac)c = A8. Demorgan’s law (A U B)c = Ac ∩ Bc

(A ∩ B)c = Ac U Bc

9. Alternative representation of Set difference A – B = A ∩ Bc

10. Subset law A U B ≤ C iff A ≤ C & B ≤ C;C ≤ A ∩ B iff C ≤ A & C ≤ B

11. Absorption law A U (A U B) = A; A ∩ (A U B) = A

Q. Let A, B & C be subsets of a universal set U. Show that;1. A ≤ A U B 2. A – B ≤ A 3. if A ≤ B and B ≤ C then A ≤ C 4. A ≤ B iff Bc ≤ Ac

Solutions: 1. A ≤ A U B (If any arbitrary element of A is present in A U B then A is subset of A U B and vice versa)Let x be an arbitrary element of A, i.e. x є A=> x є A or x є B => x є A U BBut x is an arbitrary element of A, therefore A ≤ A U B.2. A – B ≤ A Let x be an arbitrary element of A – B, i.e. x є A – B

AB

QU

P

Page 16: Discrete Mathematics

=> x є A and ¢ B (set difference) => x є ABut x is an arbitrary element of A – B, therefore A – B ≤ A.3. If A ≤ B and B ≤ C then A ≤ CLet x be an arbitrary element of A, i.e. x є A=> x є B (Because A ≤ B) => x є C (Because B ≤ C)But x is an arbitrary element of A, therefore A ≤ C.4. A ≤ B iff Bc ≤ Ac

Let x be an arbitrary element of A, i.e. x є A=> x ¢ Ac (Complement set) => x ¢ Bc (Because Bc ≤ Ac)=> x є B (Complement set)But x is an arbitrary element of Bc, therefore Bc ≤ Ac.Q. Let A & B be subsets of a Universal set U. Prove that A – B = A ∩ Bc

Case I: A – B ≤ A ∩ Bc

Let x є A – B => x є A and x ¢ B (Set difference)=> x є A and x є Bc (Intersection) => x є A U Bc

But x is an arbitrary element of A – B, therefore A – B ≤ A ∩ Bc ……… (i)Case 2: A ∩ Bc ≤ A – BLet x є A ∩ Bc => x є A and x є Bc (Intersection)=> x є A and x ¢ B (Complement) => x є A – BBut x is an arbitrary element of A ∩ Bc, therefore A ∩ Bc ≤ A – B ……… (ii)By (i) & (ii) A – B = A ∩ Bc