Discrete Mathematical Structures 15CS3 6: Set Theory
Discrete Mathematical Structures 15CS3 6: Set Theory
Discrete Mathematical Structures 15CS3 6: Set Theory
Fundamentals of Logic:
Set Theory:
5. Symmetric Difference : Given two sets, their symmetric differ- ence is the
set of elements that belong to either one or the other set but not both.
A ⊕ B = {x | (x e A) ⊕ (x e B)} .
Page
DEPT. OF CSE, ACE 8
15CS3
DISCRETE MATHEMATICAL STRUCTURES 6
Example : The division of the integers Z into even and odd numbers is a
partition: S = {E, O}, where E = { 2n | n e Z}, O = { 2n + 1 | n e Z}.
= A × A × A, etc. In
general:
= A × A ×··· × A .
Then: Prop er ties of probab ili ty:Let P be a probability func- tion on a sample
space S.
Example : Find the probability of obtaining a sum of 10 after rolling two fair dice. Find the
probability of that event if we know that at least one of the dice shows 5 points.
Answer : We call E — “obtaining sum 10” and F — “at least one of the dice shows 5
points”. The number of possible outcomes is 6 × 6 — 36. The event “obtaining a sum 10” is E
— {(4, 6), (5, 5), (6, 4)}, so|E| — 3. Hence the probability is P (E) — |E|/|S|
— 3/36 — 1/12.Now, if we know that at least one of the dice shows 5 points then the sample
space shrinks to
F — {(1, 5), (2, 5), (3, 5), (4, 5), (5, 5), (6, 5), (5, 1), (5, 2), (5, 3), (5, 4), (5, 6)} ,
This is known as the product rule or the multiplication theorem for mutually independent
events .
A gen eralization of expression is if A1,A2,A3………..An are mutually in dependent events in
a sample space S then
Pr(A1∩ A2∩ ……………∩ An)=Pr(A1).Pr(A2)………..Pr(An)
Example : Assume that the probability that a shooter hits a target is p — 0.7, and that hitting
the target in different shots are independent events. Find:
1. The probability that the shooter does not hit the target in one shot.
2. The probability that the shooter does not hit the target three times in a row.
3. The probability that the shooter hits the target at least once after shooting three times.
Answer :
1. P (not hitting the target in one shot) — 1 — 0.7 — 0.3.
3
2. P (not hitting the target three times in a row) — 0.3 — 0.027.
3. P (hitting the target at least once in three shots) — 1—0.027 —
0.973.
A set A is said to be the c ountable if A is a finite set. A set which is not countable is called an
uncountable set.
THE ADDITION PRINCIPLE:
• |AUB|=|A|+|B|-|A∩ B| is the addition principle rule or the principle of inclusion –
exclusion.
• |A-B|=|A|-|A∩ B|
• |A ∩ B|=|U|-|A|-|B| +|A∩ B|
• |AUBUC|=|A|+|B|+|C|-|A ∩B|-|B ∩ C|-|A ∩ C|+|A ∩ B ∩ C| is extended addition
principle
• NOTE: |A ∩ B ∩ C|=|AUBUC|
=|U|-| AUBUC|
= |U|-|A|-|B| -|C|+|B ∩C|+|A ∩B|+|A ∩C|- |A ∩B ∩C| |
A-B-C|=|A|-|A ∩ B|-|A ∩ C|+|A ∩ B ∩ C|
Fundamentals of Logic:
Intr oduction:
Propositi ons:
A proposition is a declarative sentence that is either true or false (but not both). For
instance, the following are propositions: “Paris is in France” (true), “London is in
Denmark” (false), “2< 4” (true), “4 = 7 (false)”. However the following are not
propositions: “what is your name?” (this is a question), “do your homework” (this
is a command), “this sentence is false” (neither true nor false), “x is an even
number” (it depends on what x represents), “So crates” (it is not even a sentence).
The truth or falsehood of a proposition is called its truth value.
Basic Connectives and Truth Tables:
Connectives are used for making compound propositions. The main ones are
the following (p and q represent given propositions):
The truth value of a compound proposition depends only on the value of its components.
Writing F for “false” and T for “true”, we can summarize the meaning of the connectives in the
following way:
q ¬p p⊕ p →p ↔ q
p p∧q p∨q q
T T F T T F T T
T F F F T T F F
F T T F T T T F
F F T F F F T T
Note that ∨ represents a non-exclusive or, i.e., p ∨ q is true when any of p, q is true
and also when both are true. On the other hand ⊕ represents an exclusive or, i.e., p
⊕ q is true only when exactly one of p and q is true.
2. A proposition is said to be a contradiction if its truth value is F for any assignment of truth
values to its components. Example : The proposition p ∧ ¬p is a c ontradiction.
Conditional Propo siti ons: A proposition of the form “if p then q” or “p implies
q”, represented “p → q” is called a conditio nal proposition. For instance: “if John is
from Chicago then John is from Illinois”. The proposition p is called hypothesis or
antecedent, and the proposition q is the conclusion or consequent.
Page
DEPT. OF CSE, ACE 15
15CS3
DISCRETE MATHEMATICAL STRUCTURES 6
Note that p → q is true always except when p is true and q is false. So, the following sentences
are true: “if 2 < 4 then Paris is in France” (true → true), “if London is in Denmark t hen 2 < 4”
(false → true),
“if 4 = 7 then London is in Denmark” (false → false). However the following one
is false: “if 2 < 4 then London is in Denmark” (true → false).
The proposition p ↔ q, read “p if and only if q”, is called bicon- ditional. It is true precCSEly
when p and q have the same truth value, i.e., they are both true or both false.
p q ¬p ¬p ∨ q p →
T T F T T
T F F F F
F T T T T
F F T T T
When two compound propositions have the same truth values no matter what truth value their
constituent propositions have, they are called logically equivalent. For
inst an ce p → q and ¬p ∨ q are logically equivalent, and we write it:
p → q ≡ ¬p ∨q
Note that that two propositions A and B are logically equivalent precCSEly when A ↔
B is a tautology.
Example : De Morgan’s Laws for Logic. The following propositions are logically
Page
DEPT. OF CSE, ACE 16
15CS3
DISCRETE MATHEMATICAL STRUCTURES 6
equivalent:
¬(p ∨ q) ≡ ¬p ∧ ¬q
¬(p ∧ q) ≡ ¬p ∨ ¬q
p ↔ q ≡ (p → q) ∧ (q → p)
p q p →q → (p →q)∧(qp ↔ q
T T T T T T
T F F T F F
F T T F F F
F F T T T T
p ↔ q ≡ (p → q) ∧ (q → p)
So, for instance, saying that “John is married if and only if he has a spouse” is the
same as saying “if John is married then he has a spouse” and “if he has a spouse then
he is married”.
Note that the converse is not equivalent to the given conditional proposition, for
instance “if John is from Chicago then John is from Illinois” is true, but the converse
“if John is from Illinois then John is from Chicago” may be false.
The contrapositive of a conditional proposition p → q is the propo- sition ¬q →
¬p. They are logically equivalent. For instance the con- trapositive of “if John is
from Chicago then John is from Illinois” is “if
John is not from Illinois then John is not from Chicago”.
LOGICAL CONNECTIVES: New propositions are obtained with the aid of word
or phrases like “not”,”and”,”if….then”,and “if and only if”. Such words or phrases are
called logical connectives. The new propositions obtained by the use of connectives are called
compound propositions. The original propositions from which a compound proposition is
obtained are called the components or the primitives of the compound proposition.
Propositions which do not contain any logical connective are called simple propositions
0 1
10
CONJUNCTION:
A compound proposition obtained by combining two given propositions by inserting the word
“and” in between them is called the conjunction of the given proposition.The conjunction of
two proposition p and q is denoted by p^q(read “p and q”).
• The conjunction p^q is true only when p is true and q is true; in all other cases it is
false.
• Ex: p:√2 is an irational number q: 9 is a prime number
p^q: √2 is an i rational number and 9 is a prime number
• Truth table: p q p^q
0 0 0
0 1 0
1 0 0
1 1 1
DISJUNCTION:
A compound proposition obtained by combining two given propositions by inserting the word
“or” in between them is called the disjunction of the given proposition.The di sjunction of two
proposition p and q is denoted by p�q(read “p or q”).
• The di sjunction p�q is false only when p is false and q is false ; in all other cases it
is true.
• Ex: p:√2 is an irational number q: 9 is a prime number
p�q : √2 is an irational number or 9 is a prime number Truth table:
• p q p�q
0 0 0
0 1 1
1 0 1
1 1 1
EXCLUSIVE DISJUNCTION:
• The compound proposition “p or q” to be true only when either p is true or q is true but
not both. The exclusive or is denoted by symbol v.
• Truth Table:
p q pvq
0 0 0
0 1 1
1 0 1
1 1 0
COND ITIONAL(or IMP LICATION):
• The conditional p→q is false only when p is true and q is false ;in all other cases it
DEPT. OF CSE, ACE Page
19
15CS3
DISCRETE MATHEMATICAL STRUCTURES 6
is true.
• Truth Table:
p q p→q
0 0 1
0 1 1
1 0 0
1 1 1
BICONDITIONAL:
• Let p and q be two propositions,then the conjunction of the conditionals p→q and q→p
is called bi- conditional of p and q. It is denoted by p↔q.
• p↔q is same as (p→q)�( q→p ). As such p↔q is read as “ if p then q and if q then
p”.
1 1 0 1 1 0 1 1
TAUTOLOGIES; CONTRADICTIONS:
A compound proposition which is always true regardless of the truth values of its components
is called a tautology.
A compound proposition which is always false regardless of the truth values of its components
is called a cont radiction or an absurdity.
A compound proposition that can be true or false (depending upon the truth values of its
components) is called a contingency I.e contingency is a compound proposition which is
neither a tautology nor a contradiction.
LOGICAL EQUIVALENCE
• Two propositions ‘u’ and ‘v’ are said to be logically equivalent whenever u and v have
the same truth value, or equivalently .
• Then we write u�v. Here the symbol �stands for “logically equivalent to”.
• When the propositions u and v are not logically eq uivalent we write u�v.
LAWS OF LOGIC:
• Law for the negation of a conditional : Given a conditional p→q, its negation is
obtained by using the following law: �(p→q)�[p�(�q)]
TRANSITIVE AND SUBSTITUTION RULES If u,v,w are propositions such that u�v
and v �w, then u �w. (this is transitive rule)
• Ex: current flows from the terminal A to the terminal B if the switch is closed i.e if p is
assigned the symbol 1. This network is represented by the s ymbol p
A P B
Ex: parallel network consists of 2 switches p and q in which the current flows from
the terminal A to the terminal B , if p or q or both are closed i.e if p or q (or both) are assigned
the symbol 1. This network is represent by p�q
Ex: Series network consists of 2 switches p and q in which the current flows from the
terminal A to the terminal B if both of p and q are closed; that is if both p and q are assigned
the symbol 1. This network is repr esented by p�q
DUALITY:
Page
DEPT. OF CSE, ACE 22
15CS3
DISCRETE MATHEMATICAL STRUCTURES 6
NOTE:
d d
• (u ) �u. The dual of the dual of u is logically equ ivalent to u.
d d
• For any two propositions u and v if u �v, then u �v . This is known as the pr
inciple of duality.
(p ↑q)= �(p � q) � p �� q
�
(p ↓q)= �(p � q) � p �� q
�
RULES OF INFERENCE:
There exist rules of logic which can be employed for establishing the validity of a rguments
. These rules are called the Rules of Inference.
1) Rule of conjunctive simpli fication: This rule states that for any two propositions p
DEPT. OF CSE, ACE Page
23
15CS3
DISCRETE MATHEMATICAL STRUCTURES 6
2) Rule of Disjunctive amplification: This rule states that for any two proposition p and q
if p is true then p�q is true i.e p�(p �q)
3) 3) Rule of Syllogism: This rule states that for any three propositions p,q r if p→q is
true and q→r is true then p→r is true. i.e {(p→q)�(q→)} �(p →r) In tabular form:
p→q q→r � (p →r)
4) 4) Modus pones(Rule of Detachment): This rule states that if p is true and p→q
is true, then q is true, ie {p �(p→q )} �q. Tabular form
p p→q �q
5) Modus Tollens: This rule states that if p→q is true and q is false, then p is false.
{(p→q)��q}�q Tabular form: p→q
�q ��p
6) Rule of Disjunctive Syllogism: This rule states that if p�q is true and p is false,
then q is true i.e. {(p�q)��p}�q Tabular Form p�q
�p �q
QUANTIFIERS:
2. The symbol � is used to denote the phrases “FOR ALL”,”FOR EVE RY”,”FOR EACH”
and “FOR ANY”.this is called as universal quantifier.
LOGICAL EQUIVALENCE:
DEPT. OF CSE, ACE Page
24
15CS3
DISCRETE MATHEMATICAL STRUCTURES 6
1. � x,[p(x)�q(x)]�(�x p(x))�(�x,q(x))
�{�x,p(x)}≡�x{�p(x)} �{�x,p(x)}≡�x{�p(x)}
RULES OF INTERFERENCE:
If an open statement p(x) is proved to be true for any (arbitrary)x chosen from a set S,
then the quantified statement �x€S, p(x) is true.
1.DIRECT PROOF:
The direct method of proving a conditional p→q has the following lines of argument:
b) Analysis: starting with the hypothesis and employing the rules /laws of
logic and other known facts , infer that q is true
c) Conclusion:p→q is true.
2. INDIRECT PROOF:
Condition p→q and its contrapositive �q→�p are logically equivalent. On basis of this
proof, we infer that the conditional p→q is true. This method of proving a conditional is
3 .PROOF BY CONTRADICTION
The indirect method of proof is equivalent to what is known as the proof by contradiction.
The lines of argument in this method of proof of the statement p→q are as follows:
1) Hypothesis: Assume that p→q is false i.e assume that p is true and q is
false.
2)Analysis: starting with the hypothesis that q is false and employing the rules of logic
and other known facts , infer that p is false. This contradicts the assumption that p is true
3)Conculsion: because of the contradiction arrived in the analysis , we infer that p→q
is true
4 .PROOF BY E XHAUSTION:
“�x €S,p(x)” is true if p(x)is true for every (each) x in S.If S consists of only a limited number
of elements , we can prove that the statement “�x €S,p(x)” is true by considering p(a) for each
a in S and verifying that p(a) is true .such a method of prove is called method of exhaustion.
5 .PROOF OF EXISTENCE:
“�x €S,p(x)” is true if any one element a € S such that p(a) is true is exhibited. Hence , the
best way of proving a proposition of the form “�x €S,p(x)” is to exhibit the existence of one
a€S such that p(a) is true. This method of proof is called proof of existence.
Suppose we wish to disprove a conditional p→q. for this propose we start with the hypothesis
that p is true and q is true, and end up with a contradiction. In view of the contradiction , we
conclude that the conditional p→q is false.this method of disproving p→q is called
DISPROOF BY CONTRADICTION