Discrete Mathematics: Mu Lti Te CH
Discrete Mathematics: Mu Lti Te CH
MATHEMATICS 231MA202
For I year II Semester B.E/CSE
ech
lti T
Mu
DEPARTMENT OF MATHEMATICS
h
ENGINEERING COLLEGE
42, VEL TECH ROAD, VEL NAGAR, AVADI,
CHENNAI, TAMILNADU, 600062.
Vel
Dr. K. SIVA
Dr. R. ARASU
Contents
2 COMBINATIONS 24
ech
2.1 Mathematical Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.2 The Pigeonhole Principle . . . . . . . . . . . . . . . . . . . . . . . . . . .
lti T 28
2.3 Permutation and Combinations . . . . . . . . . . . . . . . . . . . . . . . 29
2.4 Recurrence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.5 Linear Recurrence Relations . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.6 Generating Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Mu
2.7 Inclusion and Exclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
h
Tec
Vel
1
Chapter 1
LOGIC AND PROOFS
☞ Logical Connectives
☞ Propositional Equivalences
☞ Law of Logic
☞ Minterms, Maxterms
ech
☞ Rules of Inference
English mathematician George Boole discussed new propositions from those that we
already have, in his book "The Laws of Thought" in 1854.
Many mathematical statements are constructed by combining one or more propo-
sitions. New propositions called compound propositions, are formed from existing
Vel
1.1.2 Propositions
Denition 1. A proposition (statement) is a declarative sentence that is either true or
false, but not both.
Example:
▶ Chennai is the capital of Tamil Nadu [True]
▶ 1+5=6 [True]
▶ 2 + 7 = 10 [False]
1
2
Notation :
P, Q, R, S . . . are used to denote propositions.
English
Logical Type of
language Symbols
connectives operator
usages
ech
1. and conjunction binary ∧
2. or
lti T
disjunction
negation (or)
binary ∨
3. not unary ¬
denial
Mu
implication
conditional
Tec
ech
P
T F
F lti T T
P Q P →Q
Tec
T T T
T F F
F T T
F F T
Vel
P Q P → Q ¬ Q ¬ P ¬ Q → ¬ P (P → Q) ↔ (¬ Q → ¬ P)
T T T F F T T
T F F T F F T
F T T F T T T
F F T T T T T
Tautology :
A statement that is true for all possible values of its propositional variables is called
a tautology or universally valid formula or a logical truth.
Contradiction :
A statement that is always false is called a contradiction or absurdity.
Note :
h
Tec
1. The negation of a contradiction is a Tautology.
T F F
T F T
P Q ¬P ¬Q P ∧ ¬Q ¬P ∧ ¬Q Q ∨ (P ∧ ¬Q) S
T T F F F F T T
T F F T T F T T
F T T F F F T T
F F T T F T F T
Since the truth value in the last column is T, the given formula is a tautology.
Solution :
5
P Q P ∧Q P ∨Q ¬(P ∨ Q) (P ∧ Q) ∧ ¬(P ∨ Q)
T T T T F F
T F F T F F
F T F T F F
F F F F T F
All the entries in the last column are F therefore the given proposition is a contra-
diction.
P Q R P → Q Q → R (P → Q) ∧ (Q → R) P → R A
T T T T T T T T
T T F T F F F T
ech
T F T F T F T T
T F F F T F F T
F T T T T lti T T T T
F T F T F F T T
F F T T T T T T
F F F T T T T T
Mu
1.2 Law of Logic
h
Tec
P ∨F ⇔P
P ∨T ⇔T Domination laws
P ∧F ⇔F
P ∨P ⇔P Idempotent laws
P ∧P ⇔P
¬(¬P ) ⇔ P Double negation law
P ∧Q⇔Q∧P
6
(P ∨ Q) ∨ R ⇔ P ∨ (Q ∨ R) Associative laws
(P ∧ Q) ∧ R ⇔ P ∧ (Q ∧ R)
P ∨ (Q ∧ R) ⇔ (P ∨ Q) ∧ (P ∨ R) Distributive laws
P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)
(P ∨ Q) ∧ R ⇔ (P ∧ R) ∨ (Q ∧ R)
(P ∧ Q) ∨ R ⇔ (P ∨ R) ∧ (Q ∨ R)
¬(P ∧ Q) ⇔ ¬P ∨ ¬Q De Morgan's law
¬(P ∨ Q) ⇔ ¬P ∧ ¬Q
ech
P ∨ (P ∧ Q) ⇔ P Absorption laws
P ∧ (P ∨ Q) ⇔ P
P ∨ ¬P ⇔ T (or)
lti T
¬P ∨ P ⇔ T Negation laws
P ∧ ¬P ⇔ F (or) ¬P ∧ P ⇔ F
h Mu
Tec
P → Q ⇔ ¬P ∨ Q
P → Q ⇔ ¬Q → ¬P
P ∨ Q ⇔ ¬P → Q
P ∧ Q ⇔ ¬(P → ¬Q)
¬(P → Q) ⇔ P ∧ ¬Q
(P → Q) ∧ (P → R) ⇔ P → (Q ∧ R)
(P → R) ∧ (Q → R) ⇔ (P ∨ Q) → R
(P → Q) ∨ (P → R) ⇔ P → (Q ∨ R)
(P → R) ∨ (Q → R) ⇔ (P ∧ Q) → R
7
(i) ¬P ∧ (¬Q ∧ R)
⇔ (¬P ∧ ¬Q) ∧ R Associative law
h
⇔ ¬(P ∨ Q) ∧ R DeMorgan's law
Tec
(ii) (Q ∧ R) ∨ (P ∧ R)
⇔ (Q ∨ P ) ∧ R Distributive law
ulti
⇔ (P ∨ Q) ∧ R Commutative law
⇔T ∧R Negation law
Tec
[¬P ∨ P ⇔ T ]
⇔R Identity law
Vel
Example 6. Show that ¬(P ∨ (¬P ∧ Q)) and ¬P ∧ ¬Q are logically equivalent.
Solution :
¬(P ∨ (¬P ∧ Q)) Reasons
⇔ ¬P ∧ ¬Q Identity law
8
Example 7. Show that ¬(P ∧ Q) → (¬P ∨ (¬P ∨ Q)) ⇔ (¬P ∨ Q) (use only the laws)
Reasons
¬P ∨ (¬P ∨ Q)
(i)
⇔ (¬P ∨ ¬P ) ∨ Q Associative law
⇔ ¬P ∨ Q Idempotent law P ∨P ⇔P
¬(P ∧ Q) → (¬P ∨ (¬P ∨ Q)) Given
⇔ ¬(P ∧ Q) → (¬P ∨ Q) by (i)
⇔ (P ∧ Q) ∨ (¬P ∨ Q) P → Q ⇔ ¬P ∨ Q
Distributive law
⇔ (P ∨ (¬P ∨ Q)) ∧ (Q ∨ (¬P ∨ Q))
(P ∧ Q) ∨ R ⇔ (P ∨ R) ∧ (Q ∨ R)
Associative law &
⇔ ((P ∨ ¬P ) ∨ Q) ∧ (Q ∨ (Q ∨ ¬P ))
Commutative law
⇔ (T ∨ Q) ∧ ((Q ∨ Q) ∨ ¬P ) Negation law & Associative law
⇔ T ∧ (Q ∨ ¬P ) Domination law & Idempotent law
ech
⇔ Q ∨ ¬P Identity law
⇔ ¬P ∨ Q Commutative law
⇔P ∨R→Q since ¬P ∨ Q ⇔ P → Q
(ii) (P ∨ ¬P ) → R Reason
⇔T →R Negation law
⇔ ¬T ∨ R P → Q ⇔ ¬P ∨ Q
⇔ ¬(T ∧ ¬R) De Morgan
⇔ ¬(T ) Dominative law
⇔F
9
(iii) ((¬P ∨ Q) ∧ Q) → F
⇔ ¬((¬P ∨ Q) ∧ Q) ∨ F
⇔ (¬(¬P ∨ Q) ∨ ¬Q) ∨ F
⇔ ((¬(¬P ) ∧ ¬Q) ∨ ¬Q) ∨ F
⇔ ((P ∧ ¬Q) ∨ ¬Q) ∨ F
ech
1.3 Normal Forms [DNF & CNF] lti T
Disjunctive Normal Form (DNF)
♦ Denition
A formula which is equivalent to a given formula and which consists of a sum of elementary
Mu
products is called a disjunctive normal form (DNF) of the given formula.
Procedure to obtain DNF
h
2. Apply negation to the formula or to a part of the formula and not to the variables.
Solution :
10
⇔ ¬P ∨ [(¬P ∧ (Q ∧ P )) ∨ (Q ∧ (Q ∧ P ))]
[∵ Distributive law]
⇔ ¬P ∨ [(¬P ∧ (Q ∧ P ))] ∨ [Q ∧ (Q ∧ P )]
⇔ ¬P ∨ [¬P ∧ (Q ∧ P )] ∨ [(Q ∧ Q) ∧ P ]
[∵ Associative law]
⇔ ¬P ∨ [¬P ∧ (Q ∧ P )] ∨ [Q ∧ P ]
[∵ Q ∧ Q ⇔ Q]
ech
Example 11. Obtain a conjunctive normal form of the formula.
Solution :
lti T
P → ((P → Q) ∧ ¬(¬Q ∨ ¬P ))
Mu
P → ((P → Q) ∧ ¬(¬Q ∨ ¬P )) Reasons
⇔ ¬P ∨ ((P → Q) ∧ ¬(¬Q ∨ ¬P )) P → R ⇔ ¬P ∨ R
⇔ ¬P ∨ ((¬P ∨ Q) ∧ ¬(¬Q ∨ ¬P )) P → R ⇔ ¬P ∨ R
h
(iv) Each minterm has the truth value T for exactly one combination of the truth values
of the variables P and Q.
ech
(ii) to use De Morgan's laws and distributive laws.
(v) to delete identical minterms keeping only one, that appear in the disjunctions.
Maxterms
Mu
For a given number of variables, the maxterm consists of disjunctions in which each
variable or its negation, but not both, appears only once.
h
♦ Remarks:
Tec
(ii) Either from the duality principle or directly from the truth tables, it can be ascer-
Vel
tained that each of the maxterms has the truth value F for exactly one combination
of the truth values of the variables.
(iii) Dierent maxterms have the truth value F for dierent combinations of the truth
values of the variables.
ech
Let A = (¬P ∧ R) ∨ (Q ∧ R)
F F F F F F F F P ∨Q∨R
Tec
Example 14. Without constructing the truth table obtain the product of sums canonical
Vel
T T T F T T T P ∧Q∧R
T T F F T T T P ∧ Q ∧ ¬R
T F T F T F F ¬P ∨ Q ∨ ¬R
F T T T T F F P ∨ ¬Q ∨ ¬R
T F F F T F F ¬P ∨ Q ∨ R
F F T T T T T ¬P ∧ ¬Q ∧ R
F T F T F F F P ∨ ¬Q ∨ R
F F F T F T F P ∨Q∨R
ech
PCNF (S) = (¬P ∨ Q ∨ ¬R) ∧ (P ∨ ¬Q ∨ ¬R) ∧ (¬P ∨ Q ∨ R) ∧ (P ∨ ¬Q ∨ R) ∧ (P ∨ Q ∨ R)
Example 15. Obtain the principal disjunctive and conjunctive normal forms
lti T
[P → (Q ∧ R)] ∧ [¬P → (¬Q ∧ ¬R)]
Solution :
Mu
Let S ⇔ [P → (Q ∧ R)] ∧ [¬P → (¬Q ∧ ¬R)]
A ⇔ P → (Q ∧ R)
B ⇔ ¬Q ∧ ¬R
C ⇔ ¬P → (¬Q ∧ ¬R)
h
i.e., S ⇔ A ∧ C
Tec
TTT T F F F F T T T P ∧Q∧R
TTF F F F T F T F F - ¬P ∨ ¬Q ∨ R
TFT F F T F F T F F - ¬P ∨ Q ∨ ¬R
FTT T T F F F F T F - P ∨ ¬Q ∨ ¬R
TFF F F T T T T F F - ¬P ∨ Q ∨ R
FTF F T F T F F T F - P ∨ ¬Q ∨ R
FFT F T T F F F T F - P ∨ Q ∨ ¬R
FFF F T T T T T T T ¬P ∧ ¬Q ∧ ¬R
P Q R ¬P ¬Q → R ¬P ∧ (Q ∨ (¬Q → R)) f
T T T F T F T
T T F F T F T
T F T F T F T
T F F F F F T
F T T T T T T
F T F T T T T
F F T T T T T
F F F T F F F
The P.D.N.F. consists of the disjunction of minterms where f is True:
1.5 Quantiers
h
Example 17. 1. Symbolise : For every x, there exists a y such that x2 + y2 ≥ 100.
matics book".
(i) Solution : (∀x)(∃y)(x2 + y2 ≥ 100) Tec
2. Give the symbolic form of the statement "every book with a blue cover is a mathe-
ulti
(ii) Solution :
hM
∀x(S(x)) → P (x)
where S(x) = x is every book with a blue cover
P (x) = Mathematics book
Tec
ech
This means that a2 is even, implying that a is even. Further more, since a is even,
a = 2c for some integer c. Thus,
2b2 = 4c2
lti T
So,
b2 = 2c2
This means that b2 is even. Hence, b must be even as well.
Mu
√
It has been shown that ¬P implies that 2 = ab , where a and b have no common
factors, and 2 divides a and b. This is a contradiction since we have shown that ¬P
implies both r and ¬r , where r is the statement that a and b are integers with no
√
h
I1 P ∧Q⇒P Simplication
I2 P ∧Q⇒Q
I3 P ⇒P ∨Q Addition
I4 Q⇒P ∨Q
I5 ¬P ⇒ P → Q
I6 Q⇒P →Q
I7 ¬(P → Q) ⇒ P
I8 ¬(P → Q) ⇒ ¬Q
I9 P, Q ⇒ P ∧ Q
ech
I10 ¬P, P ∨ Q ⇒ Q (disjunctive syllogism)
E3 P ∨Q⇔Q∨P
E4 (P ∧ Q) ∧ R ⇔ P ∧ (Q ∧ R) Associative laws
Vel
E5 (P ∨ Q) ∨ R ⇔ P ∨ (Q ∨ R)
E6 P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R) Distributive laws
E7 P ∨ (Q ∧ R) ⇔ (P ∨ Q) ∧ (P ∨ R)
E8 ¬(P ∧ Q) ⇔ ¬P ∨ ¬Q DeMorgan's laws
E9 ¬(P ∨ Q) ⇔ ¬P ∧ ¬Q
E10 P ∨P ⇔P
E11 P ∧P ⇔P
E12 R ∨ (P ∧ ¬P ) ⇔ R
E13 R ∧ (P ∨ ¬P ) ⇔ R
17
E14 R ∨ (P ∨ ¬P ) ⇔ T
E15 R ∧ (P ∧ ¬P ) ⇔ F
E16 P → Q ⇔ ¬P ∨ Q
E17 ¬(P → Q) ⇔ P ∧ ¬Q
E18 P → Q ⇔ ¬Q → ¬P
E19 P → (Q → R) ⇔ (P ∧ Q) → R
E20 ¬(P ↔ Q) ⇔ P ↔ ¬Q
E21 P ↔ Q ⇔ (P → Q) ∧ (Q → P )
E22 (P ↔ Q) ⇔ (P ∧ Q) ∨ (¬P ∧ ¬Q)
h
¬H, ¬H → (A ∧ ¬B) and (A ∧ ¬B) → (R ∨ S).
Tec
Solution:
{1} (1) (C ∨ D) → ¬H P
ulti
{2} (2) ¬H → (A ∧ ¬B) P
{6} (6) C ∨D P
P → (Q → S), ¬R ∨ P and Q.
{1} (1) ¬R ∨ P P
ech
{1} (1) E→S P
{2} (2) S→H P
{1, 2} E→H T, (1), (2) and I13
{4}
{4}
(3)
(4)
(5)
lti T
A → ¬H
H → ¬A
P
T, (4), E18
{1, 2, 4} (6) E → ¬A T, (3), (5), I13
{1, 2, 4} (7) ¬E ∨ ¬A T, (6), E16
Mu
{1, 2, 4} (8) ¬(E ∧ A) T, (7), E8
{9} (9) E∧A P
{1, 2, 4, 9} (10) (E ∧ A) ∧ ¬(E ∧ A) T, (8), (9), I9
h
Tec
B : He will go bankrupt.
V → L, L → B, M → ¬B, V ∧ M
19
Hence it is inconsistent.
Example 24. 1. Show the following argument is valid.
"My father praises me only if I can be proud of myself. Either I do well in sports
or I cannot be proud of myself. If I study hard, then I cannot do well in sports.
Therefore, if father praises me, then I do not study well"
h
2. Show that the hypothesis (P ∧ Q) ∨ R and R → S imply the conclusion P ∨ S
(i) Solution : Let
A : My father praises me.
Tec
ulti
B : I can be proud of myself.
C : I do well in sports.
hM
D : I study hard.
(ii) Solution :
1. (P ∧ Q) ∨ R Rule : P
2. (P ∨ R) ∧ (Q ∨ R) Distributive laws
3. P ∨R Simplication
4. R→S Rule P
5. ¬R ∨ S T by E16
6. P ∨S T from (3) and (5)
20
(i)
Solution : The desired result is R. Include ¬R as a new premise.
ech
[1, 2, 4, 6] (7) R Rule T, (5), (6)
[1, 2, 4, 6] (8) R ∧ ¬R Rule T, (2), (7), Contradiction
(ii)
Solution :
lti T
To use the indirect method, we will include
premise and prove a contradiction.
¬¬P ⇔ P as an additional
Mu
1. P Rule P
2. P →Q Rule P
4. R → ¬Q P
5. S → ¬Q P
7. R∨S P
Example 26. Show that the following sets of premises are inconsistent.
P → Q, P → R, Q → ¬R, P
Solution :
21
(1) P →Q Rule P
(2) Q → ¬R Rule P
(4) P Rule P
(6) P →R Rule P
(8) P ∧ ¬P Rule T
Thus the given set of premises leads to a contradiction and hence it is inconsistent.
Example 27. Show that (∃x)M (x) follows logically from the premises
(x)(H(x) → M (x)) and (∃x)H(x)
ech
Solution : lti T
{1} (1) (∃x)H(x) P
Note that in step 2 the variable y is introduced by ES. Therefore a conclusion such as
(x)M (x) could not follow from step 5 because it would violate the rules given for UG.
Vel
Example 28. Example 5. Prove that (∃x)(P (x) ∧ Q(x)) ⇒ (∃x)P (x) ∧ (∃x)Q(x)
Solution :
{1} (1) (∃x)(P (x) ∧ Q(x)) P
Step Reason
1. ∃x (P (x) ∧ ¬Q(x)) Premise
ech
8. R(a) ∧ ¬Q(a) Conjunction from (6) and (7)
n2 = (2k + 1)2
= 4k 2 + 4k + 1
= 2(2k 2 + 2k) + 1
∴ n2 is not divisible by 2.
n2 is an odd integer.
i.e., P →Q is true.
2. Analysis : 1
x
is rational.
⇒ 1
x
= pq , q ̸= 0 [If p = 0, 1 = (0)(x) which is absurd]
1
⇒ x
cannot be zero.
⇒ 1
x = (1/x) 1
= (p/q) = pq (p ̸= 0)
ech
lti T
h Mu
Tec
Vel
Chapter 2
COMBINATIONS
☞ Mathematical Induction
☞ Recurrence Relations
ech
☞ Generating Functions
Let
6
Tec
6
1=1
So P (1) is true.
k(k + 1)(2k + 1)
(i.e.,) 12 + 22 + 32 + · · · + k 2 =
6
(k + 1)(k + 2)(2k + 3)
(i.e.,) To prove P (k + 1) =
6
24
25
2 2 2 2 2 k(k + 1)(2k + 1)
[1 + 2 + 3 + · · · + k ] + (k + 1) = + (k + 1)2
6
k(k + 1)(2k + 1) + 6(k + 1)2
=
6
2
(k + 1)[2k + k + 6k + 6]
=
6
(k + 1)[2k 2 + 7k + 6]
=
6
(k + 1)(k + 2)(2k + 3)
=
6
which is P (k + 1).
ech
By the principle of mathematical induction P (n) is true for all positive integer n.
Example 33. Prove by mathematical induction that 2n > n for all n ∈ N. (or) n < 2n
lti T
for all positive integers n.
Solution : Let P (n) : n < 2n
Step 1 : To prove P (1) is true.
Mu
1 < 21
⇒1<2
h
(i.e., ) k < 2k
Vel
which is P (k + 1)
That is P (k + 1) is true whenever P (k) is true.
1−1=0 is divisible by 3.
(i.e.,) (k 3 − k) is divisible by 3.
(k + 1)3 − (k + 1) is divisible by
(i.e.,) To prove 3.
(k + 1)3 − (k + 1) = (k 3 + 3k 2 + 3k + 1) − (k + 1)
= (k 3 − k) + 3(k 2 + k)
ech
which is divisible by 3.
Hence P (k + 1) is true.
lti T
This completes the inductive step.
(ii) Solution : n n
Let P (n) : (a − b ) is divisible by (a − b)
Step 1 : To prove P (1) is true.
Mu
(a1 − b1 ) = (a − b) is divisible by (a − b)
h
⇒ ak = bk + c(a − b) . . . (1)
Vel
Now,
ak+1 − bk+1 = ak a − bk b
= a[bk + c(a − b)] − bk b by (1)
k k
= ab + ac(a − b) − b b
= bk (a − b) + ac(a − b)
= (a − b)(bk + ac)
which is divisible by (a − b)
(i.e., ) That is P (k + 1) is true whenever P (k) is true.
∴ By the principle of mathematical induction, P (n) is true for all n ∈ N.
Example 35. Prove by mathematical induction that 6n+2 + 72n+1 is divisible by 43 for
each positive integer.
27
61+2 + 72(1)+1 = 63 + 73
= 216 + 343
= 559
= (43)(13)
ech
Step 3 : To prove P (k + 1) is true.
k
X 3k+1 − 1
3r =
r=0
2
28
k+1 k
!
X X
3r = 3r + 3k+1
r=0 r=0
k+1
3 −1
= + 3k+1 (by hypothesis)
2
3k+1 − 1 + 2(3k+1 )
=
2
3(3k+1 ) − 1
=
2
k+2
3 −1
=
2
Hence P (k + 1) is true whenever P (k) is true.
By the principle of mathematical induction P (n) is true for all positive integer
n ≥ 0.
ech
Example 37. 1.
lti T
2. Any positive integer n ≥ 2 is either a prime or a product of primes. To prove this
we use the principle of strong mathematical induction.
(ii) Solution : Let P (n) : n ≥ 2 is either a prime or a product of primes.
Mu
Step 1 : To prove P (2) is true. 2=2 is a prime.
Hence P (2) is true.
Step 2 :
h
Example 39. Seven members of a family have total Rs. 2,886 in their pockets. Show
that atleast one of them must have atleast Rs. 413 in his pocket.
29
members → pigeonholes
Rupees → pigeons
k−1
(i.e.,) +1 where k = 2886, n = 7
n
2886 − 1
∴ + 1 = 413.14... ≈ 413
7
Hence, there are 413 rupees in one member's pocket.
ech
Permutation
A permutation of a set of distinct objects is an ordered arrangement of these objects.
lti T(or)
1. nP0 = 1
2. nP1 = n
3. nPn = n!
Vel
Combinations
A combinations is a selection of objects without regard to order.
Notation : nCr (or) C(n, r)
n!
nCr =
r!(n − r)!
Results:
1. nC0 = 1
2. nCn = 1
3. nCr = nC − n − r
Example 40. Suppose that there are eight runners in a race. The winner receives rst
prize, the second-place nisher receives second prize, and the third place nisher receives
third prize. How many dierent ways are there to receive these prizes, if all possible
outcomes of the race can occur and there are no ties ?
30
Solution : The number of ways to pick the three prize winners in the number of ordered
selections of three elements from 8.
Example 41. Suppose that there are 9 faculty members in the mathematics department
and 11 in the computer science department. How many ways are there to select a com-
mittee to develop a discrete mathematics course at a school if the committee is to consist
of three faculty members from the mathematics department and four from the computer
science department ?
Solution : By the product rule, the answer is the product of the number of 3-combinations
of a set with nine elements and the number of 4-combinations of a set with 11 elements.
By theorem, the number of ways to select the committee is
9! 11!
C(9, 3) · C(11, 4) = · = (84)(330) = 27, 720.
3!6! 4!7!
ech
Example 42. A computer password consists of 2 letters of the English alphabet followed
by 3 digits. Find the following: lti T
(i) The total number of passwords that can be used.
(ii) The number of passwords in which no digit repeats.
Solution:
Mu
The password structure consists of 5 slots: L1 L2 D1 D2 D3 .
(i) Total number of passwords In this case, repetition is allowed for both letters and
digits. Each letter slot has 26 possibilities, and each digit slot has 10 possibilities.
h
Tec
Total Passwords = 26 × 26 × 10 × 10 × 10
= 262 × 103
= 676 × 1, 000
Vel
= 676, 000
(ii) Number of passwords with no repeating digits In this case, letters can still
repeat (as no restriction was placed on them), but the digits must be unique.
Total Passwords = 26 × 26 × 10 × 9 × 8
= 676 × 720
= 486, 720
Example 43. Analyze the structure of bit strings of length 12 and determine the number
of bit strings that contain:
(i) Exactly three 1's.
(ii) At most three 1's.
31
Solution: For a bit string of length n = 12, each position can be either a 0 or a 1.
(i) Number of bit strings containing exactly three 1's
To nd the number of strings with exactly three 1's, we choose 3 positions out of 12
to place the 1's. The remaining 9 positions will automatically be lled with 0's. Using
the combination formula
n!
nCr =
r!(n − r)!
:
12!
12C3 =
3!(12 − 3)!
12 × 11 × 10
=
3×2×1
= 2 × 11 × 10
= 220
ech
There are
(ii) Number of bit strings containing at most three 1's
"At most three 1's" means the string can contain zero, one, two, or three
lti T 1's. We sum
the combinations for each case:
Example 44. Examine the placement of digits 1, 2, 3, 4, and 5 and analyze the number
Tec
Example 45. Analyze the repetition of letters and obtain the number of distinct permu-
tations that can be formed from the letters of each of the following words:
1. RADAR
2. MATHEMATICS
Solution:
1. RADAR
The word RADAR consists of n = 5 letters. The counts of repeating letters are: R
are 2 times, A are 2 times and D is one time
The number of distinct permutations is given by:
5! 120
P = = = 30
2! · 2! · 1! 4
2. MATHEMATICS
The word MATHEMATICS consists of n = 11 letters. The counts of repeating
letters are: M are 2 times, A are 2 times and T are two times others one time.
ech
The number of distinct permutations is given by:
6C4 + 7C4 = 15 + 35 = 50
(iv) 4 persons of both genders
Total combinations minus single-gender combinations:
Example 47. How many ways are there for eight men and ve women to stand in a line
so that no two women stand next to each other?
Solution:
To ensure no two women are adjacent, we rst arrange the men and then place the
women in the "gaps" created between them.
1. Arrange the 8 Men: The 8 men can be arranged among themselves in 8! ways.
8! = 40, 320
2. Identify the Gaps: When 8 men stand in a line, they create 8+1 = 9 possible
positions (gaps) where women can stand (including the ends of the line).
ech
3. We must choose 5 gaps out of the 9 available and arrange
9
the 5 women in them. This is represented by the permutation P5 :
9 9! lti T
P5 = = 9 × 8 × 7 × 6 × 5 = 15, 120
(9 − 5)!
an = 3an−1
r =3
an = a1 rn−1
ech
∴ an = 2(3)n−1
Example 49. Solve the recurrence relation an = 6an−1 − 9an−2 if a0 = 1, a1 = 6
lti T
Solution:
an = 6an−1 − 9an−2 a0 = 1, a1 = 6
an − 6an−1 + 9an−2 = 0
Mu
The C.E is
r2 − 6r + 9 = 0
h
(r − 3)(r − 3) = 0
Tec
r = 3, r=3
The roots are equal
an = (C1 + C2 n)rn
∴ an = (C1 + C2 n)(3)n
Vel
(1)
a0 = 1, a1 = 6
F or n = 0 :
a0 = (C1 + C2 (0))30
1 = C1
∴ C1 = 1
F or n = 1 :
a1 = (C1 + C2 )(3)1
6 = (1 + C2 )3
2 − 1 = C2
∴ C2 = 1
∴ an = (1 + n)(3)n
35
a1 = 21 + (5)(31 ) = 2 + (5)(3) = 17
a2 = 22 + (5)(32 ) = 4 + (5)(9) = 49
(b) Given : an = 2n + 5(3n )
a3 = 23 + 5(33 ) = 8 + 5(27) = 143
To prove : a4 = 5a3 − 6a2
ech
L.H.S. = a4 = 24 + 5(34 ) = 16 + 5(81) = 421
= 715 − 294
Mu
= 421
L.H.S. = R.H.S. Hence the proof.
Example 51.
h
Tec
A sequence is dened by the recurrence relation an = −3an−1 −3an−2 −an−3 with initial
conditions a0 = 5, a1 = −9, a2 = 15. Evaluate the solution of this recurrence relation by
solving it using an appropriate method and justify the validity of the obtained solution
Vel
Soln;
an = −3an−1 − 3an−2 − an−3
a0 = 5, a1 = −9, a2 = 15
C.E (Characteristic Equation):
r3 + 3r2 + 3r + 1 = 0
(r + 1)3 = 0
∴ r = −1
Roots are equal:
an = (C1 + C2 n + C3 n2 )rn
an = (C1 + C2 n + C3 n2 )(−1)n
Applying initial conditions:
36
For a0 = 5:
For a1 = −9:
−9 = (C1 + C2 + C3 )(−1)1
9 = 5 + C2 + C 3
C2 + C3 = 4 . . . (1)
For a2 = 15:
ech
Divide by 2: C2 + 2C3 = 5 ... (2)
O
Mu
Substitute C3 = 1 in 1 :
C2 + 1 = 4
h
∴ C2 = 3
Tec
Final Solution:
an = (5 + 3n + n2 )(−1)n
Example 52. A factory makes custom sports cars at an increasing rate, in the rst
Vel
month only one car is made; in the second month two cars are made, and so on, with n
cars made with nth month.
i) Set up recurrence relation for the number of cars produced in the rst n months by
the factory.
ii) How many cars are produced in the rst year.
Soln:
i) Cars produced:
Month 1=1
Month 2=2
Month 3=3
Recurrence relation:
an = an−1 + n for n≥2
37
a12 = 1 + 2 + 3 + · · · + 12
n(n + 1)
an =
2
12(13)
a12 =
2
∴ a12 = 78
ech
c0 an + c1 an−1 + c2 an−2 + · · · + ck an−k = f (n)
1. Iteration
Tec
2. Characteristic roots
3. Generating functions.
numbers.
h
1+ 5 1− 5
f1 = 1 ⇒ f1 = α1 + α2 =1
Tec
2 2
√ √
5)α1 + (1 − 5)α2
(1 + =2 (5)
√ √ √
(4) × (1 + 5) ⇒ (1 + 5)α1 + (1 + 5)α2 =0
ulti
(6)
√ √
(5) × 1 ⇒ (1 + 5)α1 + (1 − 5)α2 =2 (7)
√
(6) − (7) ⇒ 2 5α2 = −2
hM
−1
α2 = √
5
1
(4) ⇒ α1 = √
Tec
5
√ !n √ !n
1 1+ 5 1 1− 5
(3) ⇒ fn = √ −√ (8)
5 2 5 2
Vel
(i.e.,) a0 = 5, a1 = 5, a2 = 5, a3 = 5, . . .
(i.e.,) 5, 5, 5, 5, . . .
The generating function of 5, 5, 5, 5, . . . is
5 + 5x + 5x2 + . . . = 5[1 + x + x2 + . . . ]
= 5[1 − x]−1
5
=
1−x
5
∴ G(x) = 1−x
which is the G.F. of the given sequence.
39
ech
n=0 n=1
1
G(x) − a0 = 3xG(x) + 2 −1
1−x
lti T
Using a0 = 1:
1
G(x) − 3xG(x) = 1 + 2 −1
1−x
Mu
1−1+x
G(x)[1 − 3x] = 1 + 2
1−x
2x
G(x)[1 − 3x] = 1 +
h
1−x
1 − x + 2x 1+x
Tec
G(x)[1 − 3x] = =
1−x 1−x
1+x
⇒ G(x) = . . . (2)
(1 − x)(1 − 3x)
Vel
1 + 1 = A(1 − 3) 1=A+B
2 = −2A 1 = −1 + B
A = −1 B=2
2 1
G(x) = −
1 − 3x 1 − x
∞
X ∞
X X∞
n n n
an x = 2 3 x − xn
n=0 n=0 n=0
Hence an = 2(3 ) − 1 which is the required solution.
n
40
Soln:
yn+2 − 6yn+1 + 5yn = 0
ech
y0 = 2, y1 = 6
Generating function:
G(x) =
lti T
∞
X
yn xn
n=0
∞
G(x) − y0
Mu
X
yn+1 xn =
n=0
x
∞
h
X G(x) − y0 − y1 x
yn+2 xn =
Tec
n=0
x2
∞
X ∞
X ∞
X
n n
yn+2 x − 6 yn+1 x + 5 yn xn = 0
n=0 n=0 n=0
Vel
G(x) − y0 − y1 x G(x) − y0
2
−6 + 5G(x) = 0
x x
Multiplying by x2 :
Generating function:
2 − 6x
G(x) =
1 − 6x + 5x2
1 − 6x + 5x2 = (1 − x)(1 − 5x)
2 − 6x
G(x) =
(1 − x)(1 − 5x)
41
Partial fraction:
2 − 6x A B
= +
(1 − x)(1 − 5x) 1 − x 1 − 5x
2 − 6x = A(1 − 5x) + B(1 − x) (1)
A = 1, B=1
1 1
∴ G(x) = +
1 − x 1 − 5x
X X
G(x) = xn + 5n xn
X
G(x) = (1 + 5n )xn
ech
∴ yn = 1 + 5n
|J| = 25
|O| = 28
|J ∪ O| = 40 − 7 = 33
Vel
|J ∩ O| = |j| + |O| − |J ∪ O|
|J ∩ O| = 25 + 28 − 33 = 20.
Example 59. A total of 1232 students have taken a course in Tamil, 879 have taken
a course in English and 114 have taken a course in Telugu. Further, 103 have taken
courses in both Tamil and English, 23 have taken courses in both Tamil and Telugu and
14 have taken courses in both English and Telugu. If 2092 students have taken at least
one of Tamil, English and Telugu, how many students have taken a course in all three
languages?
Solution : Let
|T ∪ E ∪ R| = |T | + |E| + |R| − |T ∩ E| − |T ∩ R| − |E ∩ R| + |T ∩ E ∩ R|
2092 = 1232 + 879 + 114 − 103 − 23 − 14 + |T ∩ E ∩ R|
|T ∩ E ∩ R| = 7
Therefore, there are 7 students who have taken courses in Tamil, English and Telugu.
ech
Let
|B| = = 142
7
Tec
1000
|C| = = 111
9
1000
Vel
|A ∩ B| = = 28
5×7
1000
|A ∩ C| = = 22
5×9
1000
|B ∩ C| = = 15
7×9
1000
|A ∩ B ∩ C| = =3
5×7×9
The number of integers divisible by 5, 7 and 9.
Example 61. Analyse the integers from 1 to 250 by examining the divisibility properbes
with respect to 2, 3, 5, and 7, and day persist the inchesion-extusten principle
Solution:
Let S = {x ∈ Z | 1 ≤ x ≤ 250}. We seek the cardinality of the union of sets
A2 , A3 , A5 , and A7 , where An is the set of integers divisible by n.
1. Individual Set Cardinalities
|A2 | = ⌊ 250
2
⌋ = 125
250
|A3 | = ⌊ 3 ⌋ = 83
|A5 | = ⌊ 250
5
⌋ = 50
|A7 | = ⌊ 250
7
⌋ = 35
ech
2 3 6
= 41
|A ∩ A | = ⌊
2 5
250
10
⌋ = 25
|A ∩ A | = ⌊
2 7
250
14
⌋ = 17
lti T
|A ∩ A | = ⌊
3 5
250
15
⌋ = 16
|A ∩ A | = ⌊ 250
⌋
Mu
3 7 21
= 11
|A ∩ A | = ⌊
5 7
250
35
⌋ =7
|A2 ∩ A3 ∩ A5 | = ⌊ 250
30
⌋=8
250
|A2 ∩ A3 ∩ A7 | = ⌊ 42 ⌋ = 5
|A2 ∩ A5 ∩ A7 | = ⌊ 250
Vel
70
⌋=3
250
|A3 ∩ A5 ∩ A7 | = ⌊ 105 ⌋ = 2
S3 = 8 + 5 + 3 + 2 = 18.
250
Sum of quadruples (S4 ): |A2 ∩ A3 ∩ A5 ∩ A7 | = ⌊ ⌋ = 1.
210
4. Final Calculation By the Principle of Inclusion-Exclusion:
|A2 ∪ A3 ∪ A5 ∪ A7 | = S1 − S2 + S3 − S4
250 − 193 = 57
Vel
Tec
h Mu
lti T
ech
44