NOtes Module12
NOtes Module12
OF AIML
1. Negation
If 𝑝 is a proposition, then the negation of 𝑝 is denoted by ¬𝑝 , which when translated
to simple English means- “It is not the case that p” or simply “not p“. The truth value of -
p is the opposite of the truth value of p. The truth table of -p is:
p ¬p
T F
F T
Page |1
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Example, Negation of “It is raining today”, is “It is not the case that is raining today” or
simply “It is not raining today”.
2. Conjunction
For any two propositions p and q , their conjunction is denoted by 𝑝∧𝑞 , which means
“ p and 𝑞 “. The conjunction 𝑝∧𝑞 is True when both p and 𝑞 are True, otherwise False.
The truth table of 𝑝∧𝑞 is:
p q p∧q
T T T
T F F
F T F
F F F
3. Disjunction
For any two propositions p and 𝑞 , their disjunction is denoted by p∨q , which means
“p or 𝑞 “. The disjunction 𝑝∨𝑞 is True when either p or 𝑞 is True, otherwise False. The
truth table of 𝑝∨𝑞 is:
p q p∨q
T T T
T F T
F T T
F F F
4. Exclusive Or
For any two propositions p and 𝑞 , their exclusive or is denoted by 𝑝⊕𝑞, which means
“either p or 𝑞 but not both”. The exclusive or 𝑝⊕𝑞 is True when either p or 𝑞 is True,
and False when both are true or both are false. The truth table of 𝑝⊕𝑞 is:
Page |2
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
p q p⊕q
T T F
T F T
F T T
F F F
5. Implication
For any two propositions p and 𝑞 , the statement “ifp then 𝑞 ” is called an implication
and it is denoted by 𝑝→𝑞 . In the implication 𝑝→𝑞 , p is called
the hypothesis or antecedent or premise and q is called the conclusion or consequence.
The implication is 𝑝→𝑞 is also called a conditional statement. The implication is false
when p is true and q is false otherwise it is true. The truth table of 𝑝→𝑞 is:
p q p→q
T T T
T F F
F T T
F F T
One might wonder that why is 𝑝→𝑞 true when p is false. This is because the implication
guarantees that when p and 𝑞 are true then the implication is true. But the implication
does not guarantee anything when the premise p is false. There is no way of knowing
whether or not the implication is false since p did not happen. This situation is similar
to the “Innocent until proven Guilty” stance, which means that the implication p→q is
considered true until proven false. Since we cannot call the implication 𝑝→𝑞 false
when p is false, our only alternative is to call it true.
Page |3
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
T T T
T F F
F T F
F F T
3. “y > 5”
Is this a statement? - Yes
Is this a proposition? – No
What is the truth value – Depends on value of y – Open Statement
of the proposition?
Page |4
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Soln: Let,
P: take discrete mathematics
Q: take calculus
R: take a course in computer science
Then, P → Q R
2. When you buy a new car from Acme Motor Company, you get $2000 back in cash
or a 2% car loan.
Solution: Let,
P: buy a car from Acme Motor Company
Q: get $2000 cash back
R: get a 2% car loan
• Then, P → Q R
3. School is closed if more than 2 feet of snow falls or if the wind chill is below -100
Solution: Let,
P: School is closed
Q: 2 feet of snow falls
R: wind chill is below -100
• Then, Q R → P
Page |5
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Solution: It is not the case that Phyllis go out for a walk if and only if either moon
is out or it is snowing
Logically Equivalence
An expression's statements are considered logically equivalent if they return identical
truth values for every row in a truth table. In computing, logical equivalence is important
in the design of digital circuits. If multiple circuits are logically equivalent, they have
identical truth table values.
Prove that the statements (PQ) and (P) (Q) are logically equivalent
Solution:
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
Page |6
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Contradiction:
A statement that is always false is known as a contradiction.
Principle of Duality
Page |7
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
If s and t are any statements that contain no logical connectives other than and V, and
if s ↔ t, then 𝑠 𝑑 ⟷ 𝑡 𝑑
Substitution rule: If compound statement P is a tautology, and p is a primitive statement
that appears in P, and replaced by q in P1, P1 is also a tautology
Solution:
((p V q) → r )
((p V q)) V r ) [Law of Implication]
p q V r [Demorgans Law]
Problem: Let:
p:Joan goes to Lake George
q:Mary pays for Joans shopping spree
Find negation of p →q
Solution:
(p→q)
=(p V q) [Law of Implication]
= p q [Demorgans Law]
Joan goes to Lake George but Mary does not pay for Joans shopping spree
Problem: Let:
p: Jeff is concerned about his LDL and HDL values
q: Jeff walks atleast 2 miles three times a week
Find implication, contrapositive, converse and inverse
Solution:
Implication: p→q, If Jeff is concerned about his LDL and HDL values, then Jeff will walk
atleast 2 miles three times a week
Page |8
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Contrapositive: q p, If Jeff does not walk atleast 2 miles three times a week, then he is
not concerned about his LDL and HDL values
Converse: : q→p, If Jeff walks atleast 2 miles three times a week, then he is concerned
about his LDL and HDL values
Inverse: p → q, If Jeff is not concerned about his LDL and HDL values, then Jeff will not
walk atleast 2 miles three times a week
Problem: Simplify
1. (p V q) (p q)
Solution:
(p V q) (p q)
= (p V q) (p V q) [Demorgan Law]
=(p V (q q)) [ Distribution Law]
=pVT=p
2. [[(p V q) r] V q]
Solution:
[[(p V q) r] V q]
= ((p V q) r) q [Demorgans Law]
= ((p V q) r) q [Double negation]
= (p V q) (r q) [Associative Law]
= (p V q) (r q) [Commutative Law]
= ((p V q) q) r [Associative Law]
= q r [Absorption Law]
Switching network
❖ It is made of wires and switches connecting 2 terminals
❖ Current flows when switch is closed (1) and does not flow if its open(0)
Eg:
Page |9
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Problem:
1. Represent this network with logic
Solution:
There are 3 stages one after the another
Stage1: p V q V r
Stage 2: p V t V q
Stage 3: p V t V r
Three stages are in serial
Hence resulting representation is: (p V q V r) (p V t V q) (p V t V r)
2.
Stage 2: r (t v q)
Stage 1: p V (r (t v q))
Final solution: p V (r (t v q))
Logical Implication
It is of the format:
P a g e | 10
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Problem:
p: Roger studies
q: Roger plays racketball
r: Roger passes discrete mathematics
Let p1,p2 and p3 be premises:
p1: If Roger studies, then he will pass discrete mathematics
p2: If Roger does not play racketball, then he will study
p3: Roger failed discrete mathematics
q: Roger plays racketball
Establish the validity of the argument
Solution:
Truth table approach:
p q r p1: p2: p3: (p1 p2 (p1 p2
p→r q →p r p3) p3) →q
0 0 0 1 0 1 0 1
0 0 1 1 0 0 0 1
0 1 0 1 1 1 1 1
0 1 1 1 1 0 0 1
1 0 0 0 1 1 0 1
1 0 1 1 1 0 0 1
1 1 0 0 1 1 0 1
1 1 1 1 1 0 0 1
Since the resulting column is a tautology, the validity of the argument is established
Points to note:
❖ If p⟶q is established as tautology, then p is said to logically imply q and denoted
by p ⟹q
❖ If p⟷q is established as tautology, then p is said to logically double imply q and
denoted by p ⟺q
❖ If both p⟶q and q ⟶ p is established as tautology, then p ⟺q
P a g e | 11
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
Since truth table entries are same, the validity of the logical implication is established
Definitions
• Argument – A sequence of statements, and premises, that end with a
conclusion.
• Validity – A deductive argument is said to be valid if and only if it takes a
form that makes it impossible for the premises to be true and the conclusion
nevertheless to be false.
• Fallacy – An incorrect reasoning or mistake which leads to invalid
arguments.
Rules of Inference
Simple arguments can be used as building blocks to construct more complicated valid
arguments. Certain simple arguments that have been established as valid are very
important in terms of their usage. These arguments are called Rules of Inference. The
most commonly used Rules of Inference are tabulated below –
Rules of Inference Name
𝑝,𝑝→𝑞, Modus Ponens
∴𝑞
¬q, p → q, Modus Tollens
∴ ¬p
p → q, Law of Syllogism
q → r,
∴p→r
¬p, p ∨ q, Disjunctive Syllogism
∴q
p, Rule of Disjunctive Amplification
∴ (p ∨ q)
p,q Rule of conjunction
∴ (p q)
(p q) Rule of Conjunctive Simplification
∴p, q
P a g e | 12
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Example:
Solution:
Reduction Rule
p → r , r→s = p →s Law of syllogism
t V¬s = ¬s V t Commutative Law
¬s V t = s → t Law of implication
¬t V u = t → u Law of implication
s → t, t → u = s → u Law of syllogism
p →s, s → u = p → u Law of syllogism
p → u, ¬u = ¬p Modus Tollens
P a g e | 13
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Problem:
If Margaret Thatcher is the president of United States, then she is atleast 35 years old
Margaret Thatcher is atleast 35 years old
Can we conclude Margaret Thatcher is the president of United States
Solution:
p: Margaret Thatcher is the president of United States
q: She is atleast 35 years old
Given,
p→q
q
Truth table:
p q p→q (p→q) q ((p→q) q) →p
0 0 1 0 1
0 1 1 1 0
1 0 0 1 1
1 1 1 1 1
Since the resulting column is not tautology, we cannot conclude Margaret Thatcher is the
president of United States
Solution:
Reduction Rule
p → r , = ¬r → ¬p Implication and contrapositive are
equivalent
¬r → ¬p, ¬p → q, ¬r → q Law of syllogism
¬r → q, q → s = ¬r → s Law of syllogism
P a g e | 14
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Proof:
Reduction Rule
p → q, q→ r = p→ r Law of syllogism
p→ r, r→ s = p→ s Law of syllogism
p→ s, p = s Modus ponens
Hence, I became millionaire
Solution:
Reduction Rule
p → q, q→ (r s) = p → (r s) Law of syllogism
p t = p, t Law of Conjunctive Simplification
p → (r s), p = (r s) Modus ponens
(r s) = r, s Law of Conjunctive Simplification
¬r V (¬t V u) =(¬r V ¬t) V u Associative Law
¬(r t) V u Demorgans Law
¬(r t) V u=(rt) → u Implication rule
r, t= rt Rule of Conjunction
(rt) → u, rt = u Modus ponens
P a g e | 15
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Solution:
For proof by contradiction, conclusion becomes premise as negation
Hence p becomes ¬p
Reduction Rule
¬p ⟷q= ¬p ⟶q and q⟶¬p Double Implication Equivalence
¬p ⟶q, q ⟶ r = ¬p ⟶ 𝑟 Law of Syllogism
¬p ⟶ 𝑟, ¬r = ¬¬p Modus Tollens
¬¬p=p Double Negation
Also we have ¬p due to assumption
of contradiction
But we proved p which is a
contradiction of our assumption,
Proof:
For proof by contradiction, conclusion becomes premise as negation
Hence ¬p becomes p
Reduction Rule
p, p ⟶ (q r) = (q r) Modus ponens
(q r) = q, r Law of conjunctive simplification
r, r ⟶ 𝑠 = s Modus ponens
q, s = (q s) Law of conjunction
(q s), ¬(q s) Contradiction , hence ¬p is correct
P a g e | 16
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Quantifiers
Quantifier is used to quantify the variable of predicates. It contains a formula, which is a
type of statement whose truth value may depend on values of some variables. When we
assign a fixed value to a predicate, then it becomes a proposition. In another way, we can
say that if we quantify the predicate, then the predicate will become a proposition. So
quantify is a type of word which refers to quantifies like "all" or "some".
There are mainly two types of quantifiers that are universal quantifiers and existential
quantifiers. Besides this, we also have other types of quantifiers such as nested
quantifiers and Quantifiers in Standard English Usages. Quantifier is mainly used to show
that for how many elements, a described predicate is true. It also shows that for all
possible values or for some value(s) in the universe of discourse, the predicate is true or
not.
Example 1:
"x ≤ 5 ∧ x > 3"
This statement is false for x= 6 and true for x = 4. Now we will compare the above
statement with the following statement
"For every x, x ≤ 5 ∧ x > 3"
This statement is definitely false. Now we will again define a statement
"There exists an x such that "x ≤ 5 ∧ x > 3"
This statement is definitely true. The phrase "there exists an x such that" is known as the
existential quantifier, and "for every x" phrase is known as the universal quantifier. The
variables in a formula cannot be simply true or false unless we bound these variables by
using the quantifier.
Example 2:
Suppose we have two statements that are ∀x : x2 +1 > 0 and ∀x : x2 > 2. For x = 1, the first
statement ∀x : x2 +1 > 0 is true, but the second statement ∀x : x2 > 2 is false, because it
does not satisfy the predicate. On the other side, if we write the second statement as ∃x :
x 2 > 2, it will be true, because x = 2 is an example that satisfies it.
In the quantified expression, if there is a variable, then we always assume that the variable
comes from some base set. If we specify x as a real number, then the statement ∀x : x2 +1
> 0 will be true. But this statement will be false if we specify x as a complex number such
as i. In this case, the predicate will not satisfy by x = i because we don't specify the value
of i.
Universal Quantifiers
Sometimes the mathematical statements assert that if the given property is true for all
values of a variable in a given domain, it will be known as the domain of discourse. Using
the universal quantifiers, we can easily express these statements. The universal quantifier
symbol is denoted by the ∀, which means "for all". Suppose P(x) is used to indicate
predicate, and D is used to indicate the domain of x. The universal statement will be in the
form "∀x ∈ D, P(x)". The main purpose of a universal statement is to form a proposition.
In the quantifiers, the domain is very important because it is used to decide the possible
values of x. When we change the domain, then the meaning of universal quantifiers of P(x)
will also be changed. When we use the universal quantifier, in this case, the domain must
be specified. Without a domain, the universal quantifier has no meaning.
P a g e | 17
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
The sentence ∀xP(x) will be true if and only if P(x) is true for every x in D or P(x) is true
for every value which is substituted for x. The statement ∀xP(x) will be false if and only if
P(x) is false for at least one x in D. The value for x for which the predicate P(x) is false is
known as the counterexample to the universal statement. If finite values such as {n1, n2,
n3, …, nk} are contained by the universe of discovery, the universal quantifier will be
the conjunction of all elements, which is described as follows:
∀xP(x) ⇔ P(n1) ∧ P(n2) ∧ · · · ∧ P(nk)
Example 1: Suppose P(x) indicates a predicate where "x must take an electronics course"
and Q(x) also indicates a predicate where "x is an electrical student". Now we will find the
universal quantifier of both predicates.
Solution: Suppose the students are from ABC College. For both predicates, the universe of
discourse will be all ABC students.
The statements can be: "Every electrical student must take an electronics course". The
following syntax is used to define this statement:
∀x(Q(x) ⇒ P(x))
This statement can be expressed in another way: "Everybody must take an electronics
course or be an electrical student". The following syntax is used to define this statement:
∀x(Q(x) ∨ P(x))
Example 2: Suppose P(x) indicates a predicate where "x is a square" and Q(x) also
indicates a predicate where "x is a rectangle". Now we will find the universal quantifier of
these predicates.
Solution:
The statement must be:
∀x (x is a square ⇒ x is a rectangle), i.e., "all squares are rectangles.'' The following syntax
is used to describe this statement:
∀xP(x) ⇒Q(x)
P a g e | 18
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Determine the truth value of each statement, if universe comprises of all nonzero
integers
a) ∃𝑥 ∃𝑦 [𝑥𝑦 = 2]
Solution: Let x=1, y=2 then xy=2, Hence True
b) ∃𝑥 ∀𝑦 [𝑥𝑦 = 2]
Solution: Let x=1, y=4 then xy=4!=2, Hence False
c) ∀𝑥 ∃𝑦 [𝑥𝑦 = 2]
P a g e | 19
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
The Rule of Universal Specification: If an open statement becomes true for all
replacements by the members in a given universe, then that open statement is true for
each specific individual member in that universe.
Eg:
m(x): x is a mathematics professor
c(x): x has studied calculus
Consider,
All mathematics professor have studied calculus
Leona is a mathematics professor
Therefore Leona has studied calculus
Then, ∀𝑥 [𝑚(𝑥) ⟶ 𝑐(𝑥)]
𝑚(𝑙)
𝑐(𝑙) [From rule of Universal Specification]
P a g e | 20
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Reduction Rule
𝑝 𝖠 (𝑝 → 𝑞)≡q Modus ponens
𝑟 →∼ 𝑞 ≡q→∼r Law with implication
q, q→∼r≡∼r Modus ponens
𝑠 𝗏 𝑟, ∼r≡ s Law of Disjunctive Syllogism
s≡𝑠𝗏𝑡 Law of Disjunctive
Amplification
For the universe of all integers, let p(x), q(x), r(x), s(x) and t(x) denote the following open statements:
p(x): x>0, q(x): x is even, r(x): x is a perfect square, s(x): x is divisible by 3, t(x): x is divisible by 7.
Write the following statements in symbolic form: i) At least one integer is even. ii) There exists a
positive integer that is even. iii) If x is even, then x is not divisible by 3. iv) No even integer is divisible
by 7. v) There exists even integer divisible by 3.
P a g e | 21
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
1 0 0 0 1 0 0 1
1 0 1 0 1 0 1 1
1 1 0 1 0 0 0 1
1 1 1 1 1 1 1 1
Reduction Rule
𝑞→𝑟≡ ¬𝑞 ∨ 𝑟 Law of Implication
𝑝→(𝑞→𝑟) ≡ ¬𝑝 ∨ ( 𝑞→𝑟) Law of implication
¬𝑝 ∨ ( ¬𝑞 ∨ 𝑟) For Step 1 and Step 2
(¬𝑝 ∨ ( ¬𝑞) ∨ 𝑟) Associative Law
¬(𝑝 ∧ 𝑞) ∨ 𝑟 Demorgans Law
𝑝 ∧ 𝑞 →𝑟 Law of Implication
Give i) direct proof ii) indirect proof iii) proof by contradiction for the
following statement: “if n is an odd integer then n+9 is an even integer”.
Indirect Proof:
Step 1: Assume the Opposite, Assume that n is an odd integer and n + 9 is not even (i.e., n + 9
is odd).
Step 2: Express n + 9 as Odd
If n + 9 is odd, it can be expressed as n + 9 = 2m + 1 for some integer m.
Step 3: Rearrange the Equation,
Rearranging gives us: n = 2m + 1 - 9 = 2m - 8 = 2(m - 4).
Step 4: Conclusion: This shows that n is even (since it can be expressed as 2 times an integer),
which contradicts our assumption that n is odd. Therefore, our assumption must be false, and n
+ 9 must be even.
Proof by Contradiction:
Step 1: Assume n is Odd, Assume n is an odd integer, so n = 2k + 1 for some integer k.
Step 2: Assume n + 9 is Odd
Assume for contradiction that n + 9 is odd.
Step 3: Express n + 9
Then, n + 9 = (2k + 1) + 9 = 2k + 10 = 2(k + 5), which is even.
Step 4: Conclusion: This leads to a contradiction because we assumed n + 9 is odd. Therefore,
n + 9 must be even.
P a g e | 22
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
The statement "if n is an odd integer then n + 9 is an even integer" is proven true using direct
proof, indirect proof, and proof by contradiction.
Define tautology. Show that [(𝑝˅𝑞)˄(𝑝 → 𝑟)˄(𝑞 → 𝑟)] → 𝑟 is atautology by
constructing the truth table.
Reduction Rule
¬𝑝˄¬𝑞˄𝑟 Law of distribution
𝑟˄[(¬𝑝˄¬𝑞) ˅ (𝑞 ˅p)] Law of distribution and
disjunctive simplification
(¬𝑝˄¬𝑞) ˅ (𝑞 ˅p) If p and q are both false
=True ¬𝑝˄¬𝑞 is true
If either q or p is true, 𝑞 ˅p is
true
r˄True=r Substitution
For any two odd integers m and n, show that (i) m+n is even (ii) mn is
odd.
(ii) mn is odd
P a g e | 23
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
An open statement, also known as an open sentence, is a mathematical statement that contains
one or more variables. The truth value of an open statement is not fixed, and can be either true or
false depending on the values assigned to the variables. For example, "1 - y = 8" is an open
statement because the value of "y" is unknown. The process of finding the values of variables
that result in a true sentence is called solving the open sentence, and the replacement value is the
solution.
There are mainly two types of quantifiers that are universal quantifiers and existential
quantifiers. Besides this, we also have other types of quantifiers such as nested quantifiers
and Quantifiers in Standard English Usages. Quantifier is mainly used to show that for how
many elements, a described predicate is true. It also shows that for all possible values or
for some value(s) in the universe of discourse, the predicate is true or not.
Write the following argument in symbolic form and then establish thevalidity
If A gets the Supervisor’s position and works hard, then he will get a raise. If he gets a raise,
then he will buy a car. He has not purchased a car. Therefore he did not get the Supervisor’s
position or he did not
work hard.
Let:
p:He gets a supervisor position
q: He works hard
r:He gets a raise
s: He will buy a car
Given:
𝑝 ∧ 𝑞 ⟶ 𝑟 ……(1)
𝑟 ⟶ 𝑠 ………………(2)
¬𝑠 ……………..(3)
Applying Law of Syllogism on (1) and (2)
𝑝 ∧ 𝑞 ⟶ 𝑠 …..(4)
Applying Modus Tollens on (3) and (4)
¬(𝑝 ∧ 𝑞)
P a g e | 24
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
f) ∃𝑥 ∃𝑦 [𝑥𝑦 = 1]
Solution: Let x=1, y=1 then xy=1, Hence True
g) ∃𝑥 ∀𝑦 [𝑥𝑦 = 1]
Solution: Let x=1, y=4 then xy=4!=1, Hence False
h) ∀𝑥 ∃𝑦 [𝑥𝑦 = 1]
Solution: Let x=4, y=1, then xy=4!=1 Hence False
i) ∃𝑥 ∃𝑦 [(2𝑥 + 𝑦 = 5)𝛬(𝑥 − 3𝑦 = −8)]
Solution: 2x + y =5 ……………….(1)
x – 3y =-8 …………………(2)
(2) - 2*(2) gives
7y =21 => y=3
Hence, 2x+3=5 => x=1
Since both x and y exists, it is true
j) ∃𝑥 ∃𝑦 [(3𝑥 − 𝑦 = 7)𝛬(2𝑥 + 4𝑦 = 3)]
Solution: 3x -y = 7 ………….(1)
2x+4y=3 ………..(2)
4*(1) => 12x – 4y =28 ……………..(3)
(2)+ (3) gives, 14x=31 =>x=31/14
y=3x-7 => y=93/14-7=-5/14
Hence both x and y are rationals and not integers and result is False
P a g e | 25
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Overview of Counting:
In daily lives, many a times one needs to find out the number of all possible outcomes for
a series of events. For instance, in how many ways can a panel of judges comprising of 6
men and 4 women be chosen from among 50 men and 38 women? How many different
10 lettered PAN numbers can be generated such that the first five letters are capital
alphabets, the next four are digits and the last is again a capital letter. For solving these
problems, mathematical theory of counting are used. Counting mainly encompasses
fundamental counting rule, the permutation rule, and the combination rule. Principles of
Counting can be applied in vivid areas like coding theory, probability and statistics, and
analysis of algorithms
Rule of Sum:
If first task can be done in ‘m’ ways and second task in ‘n’ ways and both cannot be
simultaneously done, then either of tasks can be performed in ‘m+n’ ways
Solution: Since books are of different languages, student can select in 40 + 50=90 ways
Problem: First colleague has 3 books on ADA and other has 5 such books. If n
denotes maximum number of different books on this topic, range of n is ____
Solution: Since books may be same of different, minimum number of unique books is 5
(which is with second colleague and first colleague has same 3 books with first
colleague) and maximum number of unique books is 8 (which is 3 different books from
first colleague + 5 different books from second colleague)
Hence, range of n is: 5<=n<=8
Extension of Sum Rule: If tasks T1,T2,..Tm can be done in n1,n2,..,nm ways and no
two tasks are performed simultaneously, number of ways: n1+n2+..+nm
Problem: If a student can chose project either 20 from AI, 30 from ML, 20 from DL
then number of ways he can chose either is __
Solution: Since books are of different subjects, from extension of sum rule, total number
of ways=20+30+20=70 ways
P a g e | 26
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Product Rule: If a procedure can be split into 2 stages, if there are m outcomes for
Stage-1 and n outcomes for each of m outcomes, total procedure can be carried in
m*n ways.
Problem: Six men and eight women are contesting for lead male and female roles,
director can cast leading couple in ____ ways
Solution:
(i) For no repetitions:
2 letters=26 X25
4 digits = 10X9X8X7
Total number of ways=26X25X10X9X8X7
Problem: Mrs. Foster operates Quick Snack Coffee shop. Menu in the shop is: six
kinds of muffins, eight kinds of sandwiches and five beverages (hot coffee, hot tea,
iced tea, cola and orange juice). Ms. Dodd, sends her assistant Carl to get her
lunch- either a muffin and hot beverage or sandwich and cold beverage. Find the
number of ways
Solution:
Lunch= Muffin and Hot beverage OR Sandwich and cold beverage
Case-1: Muffin and Hot beverage=6*2=12 (Product theorem)
Case-2: Sandwich and cold beverage=8*3=24 (Product theorem)
Total number of ways=12 + 24=36 ways (Sum Rule)
P a g e | 27
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Problem: A hotel offers 12 kinds of sweets, 10 kinds of hot tiffins and 5 kinds of
beverages (hot tea, hot coffee, juice, coke, icecream). The breakfast consists of
sweet and hot beverage or a hot tiffin and cold beverage. Number of ways in which
breakfast can be ordered
Solution:
Breakfast= Sweet and Hot beverage OR Hot tiffin and cold beverage
Case-1: Sweet and Hot beverage=12*2=24 (Product theorem)
Case-2: Hot tiffin and cold beverage=10*3=30 (Product theorem)
Total number of ways=24 + 30=54 ways (Sum Rule)
Problem: In a class of 10 students, five are to be chosen and seated in a row. How
many such linear arrangements are possible?
Solution:
Number of ways to chose first student=10
Number of ways to chose second student=9 (As already 1 student selected)
Number of ways to chose first student=8 (As already 2 students selected)
Number of ways to chose first student=7 (As already 3 students selected)
Number of ways to chose first student=6 (As already 4 students selected)
Hence total number of ways=10 * 9 * 8 * 7 * 6 ways
Problem: The number of words of three distinct letters formed from word “JNTU”
Solution: Number of words of three distinct letters=4P3=4!/(4-3)!=24/1=24
Problem: In how many ways can eight men and eight women be seated in a row if
(a) any person may sit next to any other (b) men and women must occupy alternate
seats (c) generalize result for n men and n women
Solution:
(a) Any person can sit next to any one
Total people=8 men + 8 women = 16
P a g e | 28
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
P a g e | 29
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
(i) BALL
n=4
n1=1 (B), n2=1(A), n3=2 (L)
4! 24
Hence total number of arrangement=1!∗1!∗2! = 2
=12
(ii) DATABASES
n=9
n1=1 (D), n2=3 (A), n3=1 (T), n4=1 (B), n5=2 (S), n6=1 (E)
9!
Hence total number of arrangement=3!∗2!
(iii) MASSASAUGA
n=10
n1=1 (M), n2=4 (A), n3=3 (S), n4=1 (U), n5=1 (G)
10!
Hence total number of arrangement=4!∗3!
Problem: Determine the number of staircase paths in the xy plane from (2,1) to
(7,4) where each such path is made up of individual steps going one unit to the right
(R) or one unit upward (U)
Solution:
Sample ways of reaching from (2,1) to (7,4) is show below:
P a g e | 30
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Problem: If six people designated as A,B,..F are seated about a round table, how
many different circular arrangements are possible, if arrangements are considered
the same when one can be obtained from other by rotation
P a g e | 31
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Problem: Number of ways in which a 3 cards can be picked from a standard deck of
52 cards
Solution: 3 cards can be selected from 52 cards in 52C3 ways
Problem: A hostess is having a dinner party for some members of her charity
committee. Because of the size of her home she can invite only 11 of 20 members.
Find the number of ways
Solution: 11 members from total 20 members can be invited in 20C11 ways
Problem: Lyan and Patti decide to buy a PowerBall ticket. To win grand prize of
PowerBall ticket one must match 5 numbers selected from 1 to 49 and then must
also match the powerball, an integer from 1 to 42. Find the number of ways
Solution:
5 numbers can be selected from 1to 49 in 49C5 ways
An integer from 1 to 42 can be selected in 42C1 ways
Hence total number of ways=49C5*42C1 ways
Problem: A student taking history exam is directed to answer any seven of the 10
essay questions. Find the number of ways for:
(i) No specific instructions-any 7
Solution: Any 7 questions from 10 can be selected in 10C7 ways=10!/(7!3!)=120
(ii) Three questions from first 5 and four from remaining 5
Solution: 3 questions from first 5 can be selected in 5C3 ways and 4 questions from
remaining 5 can be selected in 5C4 ways.
Hence total number of ways=5C3*5C4=10*5=50 ways
(iii) Atleast three selected from first 5
Solution: Atleast three selected from first 5 has following cases:
Case-1: 3 from first 5, means 4 from remaining 5 = 5C3*5C4=10*5=50
Case-2: 4 from first 5, means 3 from remaining 5 = 5C4*5C3=5*10=50
Case-3: 5 from first 5, means 2 from remaining 5 = 5C5*5C2=1*10=10
P a g e | 32
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Problem: Gym teacher must make up volleyball teams of nine girls each from 36
freshman girls in her PE class. In how many ways, she can select these four teams
Solution:
First team can be formed in 36C9
Second team can be formed in 27C9 (as 9 already selected in first team)
Third team can be formed in 18C9 (as 18 already selected in first two teams)
Fourth team can be formed in 9C9 (as 27 already selected in first three teams)
Hence total number of ways from product rule = 36C9 * 27C9 * 18C9 * 9C9
Solution:
n=11,
n1=1 (T), n2=3 (A), n3=2 (L), n4=1 (H), n5=2(S). n6=2 (E)
11!
Total number of ways= 3!∗2!∗2!∗2!
Problem: Ellen draws five cards from standard deck of 52 cards. In how many ways:
(i) Select card with no clubs
Solution:
There are totally 13 clubs in a pack of 52 cards.
Hence if no clubs are to be selected, remaining cards available=52-13=39 cards
Number of ways 5 cards can be selected from 39 cards = 39C5
P a g e | 33
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Binomial Theorem
𝑛 𝑛 𝑛 𝑛
(𝑥 + 𝑦)𝑛 = ( ) 𝑥 0 𝑦 𝑛 + ( ) 𝑥1 𝑦 𝑛−1 + ( ) 𝑥 2 𝑦 𝑛−2 + ⋯ + ( ) 𝑥 𝑛 𝑦 0
0 1 2 𝑛
= ∑𝑛𝑘=0(𝑛𝑘)𝑥 𝑘 𝑦 𝑛−𝑘
Problem:
Multinomial Theorem
𝑭𝒐𝒓 𝒑𝒐𝒔𝒊𝒕𝒊𝒗𝒆 𝒊𝒏𝒕𝒆𝒈𝒆𝒓𝒔 𝒏, 𝒕, 𝒕𝒉𝒆 𝒄𝒐𝒆𝒇𝒇𝒊𝒄𝒊𝒆𝒏𝒕 𝒐𝒇
𝒙𝒏𝟏 𝒏𝟐 𝒏𝒕
𝟏 , 𝒙𝟐 , … , 𝒙𝒏
P a g e | 34
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Problem: A donut shop offers 20 kinds of donuts. Assuming that there are atleast
a dozen of each kind, what is the number of selections?
Solution:
Given, n=20, r=12
Then number of selections=(n+r-1)Cr
=(20+12-1)C12=31C12
Problem: In how many ways we can distribute 10(identical) white marbles among six
distinct containers?
Solution:
Given, n=6, r=10
Then number of selections=(n+r-1)Cr
=(6+10-1)C10=15C10
Problem: President Helen has 4 vice presidents. She wishes to distribute among them
1000 as bonus checks where each check will be written as multiple of 100
(i)One or more vicepresidents gets nothing
(ii)Each vice president gets 1 check
Solution:
Given, n=4, r=1000/100=10
(i)One or more vicepresidents gets nothing
number of selections=(n+r-1)Cr
P a g e | 35
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
=(4+10-1)C10=13C10=286
(ii)Each vice president gets 1 check
n=4, r=600/100=6
number of selections=(n+r-1)Cr
=(4+6-1)C6=9C6=84
Problem: In how many ways can we distribute seven bananas and six oranges
among four children so that each child receives atleast one banana
Solution:
Distribution of bananas: Given n=4, r=3 [As each child should get 1 banana atleast=7-4=3
remaining for distribution]
number of selections=(n+r-1)Cr
=(4+3-1)C3=6C3=20
Distribution of oranges: Given n=4, r=6 [As there are 6 oranges for distribution]
number of selections=(n+r-1)Cr
=(4+6-1)C6=9C6=84
Hence total distribution by product rule=20X84=1680 ways
Solution:
Here 7 has t be distributed among x1, x2, x3 and x4
Hence n=4, r=7
number of selections=(n+r-1)Cr
=(7+4-1)C7=10C7=120
P a g e | 36
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Solution:
Outermost loop, n=20
There are 3 loops, hence r=3
number of selections=(n+r-1)Cr
=(20+3-1)C3=22C3=1540 times
P a g e | 37
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Solution:
Outer loop, n=n
Number of loops, r=2
Hence, number of selections=(n+r-1)Cr
=n+2-1C2=n+1C2
(n+1)n(n−1)! n(n+1_
= 2!(n−1)! = 2
Problem: In how many ways can 10 (identical) dimes be distributed among five children
if
(a) There are no restrictions
(b) Each child gets atleast one dime
(c) Oldest child gets atleast two dimes
Solution:
(a) There are no restrictions
n=5, r=10
number of selections=(n+r-1)Cr
=5+10-1C10=14C10
(b) Each child gets atleast one dime
n=5, r=5 [As each dime goes to 1 child and remaining 5 dimes to be distributed]
number of selections=(n+r-1)Cr
=5+5-1C5=9C5
(c) Oldest child gets atleast two dimes
n=5, r=8 [As oldest child gets 2 dimes, remaining dimes is 8]
number of selections=(n+r-1)Cr
=5+8-1C8=12C8
Solution:
x1+x2+x3+x4+x5<40
x1+x2+x3+x4+x5<=39
x1+x2+x3+x4+x5+x6=39
Hence n=6, r=39
number of selections=(n+r-1)Cr
=6+39-1C39=44C39
Solution:
(a) we do not want the same flavor more than once
31C12 as 12 flavors out of 31 can be selected in those many ways
(b) A flavor may be ordered as many as 12 times
n=31 r=12
P a g e | 38
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
number of selections=(n+r-1)Cr
=31+12-1C12=42C12
Proof:
Basis Step:
Induction Step:
Assume it is true for k.
𝑘(𝑘+1)
∑𝑘𝑖=1 𝑖 =
2
LHS=
P a g e | 39
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Proof:
Basis Step:
n=5, S(5) means 25 > 52 , 32 >25 is true . Hence basis step Is true
Induction step:
Let it be true for some k
Means 2k > k 2
Prove for k+1
LHS=2k+1
=2. 2k
=2k + 2k
P a g e | 40
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
>k 2 + k 2
>k 2 + 4n
> k 2 + 2k +1
> (k + 1)2 = RHS
Solution:
P a g e | 41
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Proof:
Induction Step:
Assume it is true for some k
Means:
𝒌
𝒌(𝒌 + 𝟏)(𝟐𝒌 + 𝟏)
∑ 𝒊𝟐 =
𝟔
𝒊=𝟏
LHS:
=RHS
P a g e | 42
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Proof:
Basis Step:
LHS=1
12 +1+2
RHS= 2 =4/2=2
Since LHS is not same as RHS, basis step fails and the validity is disproved
Basis Step:
S(1)=> LHS=1
RHS=1^2=1 Hence LHS=RHS
Induction Step:
Assume it is true for some k. Means
k
∑(2i − 1) = k 2
i=1
To prove for (k+1)
RHS=(k + 1)2
LHS=∑k+1
i=1 (2i − 1)
=∑ki=1(2i − 1) + [2(k + 1) − 1]
=k 2 +2k +1
=(k + 1)2
Since LHS=RHS, sum of first n consecutive odd integers is n2
∑ 𝑯𝒋 = (𝒏 + 𝟏)𝑯𝒏 − 𝒏
𝒋=𝟏
Proof:
Basis Step
P a g e | 43
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Induction Step:
𝒂𝟎 = 𝟏, 𝒂𝟏 =2, 𝒂𝟐 =3 and
𝒂𝒏 = 𝒂𝒏−𝟏 + 𝒂𝒏−𝟐 + 𝒂𝒏−𝟑
Prove that entries in the sequence are such that:
𝒂𝒏 ≤ 𝟑𝒏
Proof:
P a g e | 44
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Indirect:
𝒏
Problem: Define a sequence S(1)=1, S(n)=2S⌊𝟐⌋:
Find 𝑺(𝟕𝟑)
P a g e | 45
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Solution:
73
S(73)= 2S⌊ 2 ⌋
36
=2*2*S(36)=4*⌊ 2 ⌋
18
=4*2*S(18)=8*⌊ 2 ⌋
9
=8*S(9)=16*⌊2⌋
=16*S(4)=32*S(2)=64
P a g e | 46
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Proof:
Basis step is proved using Demorgans Law
Induction step proof:
P a g e | 47
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Basis Step:
For n=1, LHS=12=1
1(2.1+1)(2.1−1)
RHS= =3/3=1
3
Hence basis step is proved
Induction step:
Assume the equation is true for some ‘k’. Means
𝑘(2𝑘+1)(2𝑘−1)
12 + 32 + 52 + ⋯ . +(2k − 1)2 = 3
To prove for k+1:
(𝑘+1)(2𝑘+3)(2𝑘+1)
RHS= 3
LHS=12 + 32 + 52 + ⋯ . +(2k − 1)2+(2k + 1)2
=𝑘(2𝑘+1)(2𝑘−1) + (2k + 1)2
3
(2𝑘+1)(𝑘(2𝑘−1)+3(2𝑘+1)
=
3
(2𝑘+1)(2𝑘 2 −𝑘+6𝑘+3)
=
3
(2𝑘+1)(2𝑘+3)(𝑘+1)
= =RHS
3
P a g e | 48
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
=(4+4-1)C4=7C4=35
=(3+7-1)C7=9C7=36
=(3+5-1)C5=7C5=21
Case(iii) Fourth container has 5 marbles, n=3 r=3
Then number of selections=(n+r-1)Cr
=(3+3-1)C3=5C3=10
Case(iv) Fourth container has 7 marble, n=3 r=1
Then number of selections=(n+r-1)Cr
P a g e | 49
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
=(3+1-1)C1=3C1=3
Hence, total cases=36+21+10+3=70 ways
How many positive integers n can we form using the digits 3,4,4,5,5,6,7 if we
want n to exceed 5,000,000?
Induction Step
Assume statement is true for some k
k!>= 2k-1
To prove for k+1
RHS=2(k+1)-1=2k+2-1=2k+1
LHS=(k+1)!
=k+1(k!)
>(k+1)(2k-1)
>(2k2-k+2k-1)
>(2k+1)(2k-1/2)
>(2k+1)=RHS
Prove that every positive integer n≥24 can be written as a sum of 5’sand/or 7’s.
We can prove that each integer n ≥ 24 can be expressed as a sum of 5's and 7's using
strong induction. For n = 24, we can write it as 5 + 5 + 7 + 7, which is a sum of 5's and 7's.
P a g e | 50
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
Assume that every integer k with 24 ≤ k ≤ n can be expressed as a sum of 5's and 7's. Now
we need to prove that n+1 can also be expressed as a sum of 5's and 7's.
Since we can write n as a sum of 5's and 7's, we have two cases:
If n is a multiple of 5, then n+1 is equal to (n-5) + 6. Since n-5 and 6 can be expressed as a
sum of 5's and 7's, n+1 can also be expressed as a sum of 5's and 7's.
If n is not a multiple of 5, then n+1 is equal to (n-7) + 8. Since n-7 and 8 can be expressed as
a sum of 5's and 7's, n+1 can also be expressed as a sum of 5's and 7's.
By the principle of strong induction, we have proven that each integer n ≥ 24 can be expressed
as a sum of 5's and 7's.
How many positive integers 𝑛 , can we form using the digits 3,4,4,5,5,6,7, if
we want 𝑛 to exceed 5,000,000.
Basis Step:
For n=1, LHS=1.3=4
RHS=1(1+1)(2+7)/6=18/6=3
Hence LHS=RHS and basis step is proved
Induction Step:
Assume it is true for some k.
k(k+1)(2k+7)
Means: 1.3+2.4+3.5+……+k(k+2)= 6
P a g e | 51
DISCRETE MATHEMATICAL STRUCTURES, DEPT. OF AIML
k(k+1)(2k+7)
= +(k+1)(k+3)
6
k(k+1)(2k+7)+6(k+1)(k+3)
= 3
(k+1)(2k2 +7k)+6k+18)
= 6
(k+1)(2k2 +13k+18)
= 6
(k+1)(𝑘+2)(2k+9)
= 6
=RHS
To find the number of permutations of the letters in the word MASSASAUGA, we need to count the
number of total arrangements. The word MASSASAUGA has 11 letters, and there are 3 S's and 4
A's, so there are a total of 10!/ (3!4!) = 25200 permutations of the letters.
To find the number of arrangements where all four A's are together, we can treat the group of four A's
as a single object. So, now we have 8 objects to arrange: M, S, S, S, G, U, A (the group of 4 A's), and
another A. The number of arrangements of these 8 objects is 7!/3! = 840.
To find the number of arrangements that begin with S, we fix the letter S in the first position. Now we
have 10 objects to arrange: S, M, A, S, A, S, A, U, G, A. The number of arrangements of these 10
objects is 9!/3!4! = 7560.
Therefore, there are 840 arrangements in which all four A's are together and 7560 arrangements that
begin with S.
P a g e | 52