a, b

DISCRETE MATHEMATICS
J.K.Pati
LECTURE NOTES
BSCM-1211
Lecturer note-1
Logic, Proposition and related concepts
The truth value of P is denoted by T and False value is denoted by F. Statements
that are not propositions include questions and commands.
Example:
Answer: (a) Not proposition
(b) A proposition with truth value (T)
(c) A proposition with truth value (F)
(d) Not a proposition.
Compound proposition:
Single statement connected by two or more statement. Connectives like AND or
OR etc are required to form a compound proposition.
In logic, a conjunction is a compound sentence formed by using the word
and to join two simple sentences. The symbol for this is Λ. (whenever you see Λ
read 'and') When two simple sentences, p and q, are joined in a conjunction
statement, the conjunction is expressed symbollically as p Λ q.
Disjunction (or as it is sometimes called, alternation) is a connective which forms
compound propositions which are false only if both statements (disjuncts) are false.
The truth table shows the relationship between the truth value of the propositions
The truth value of Pconjuction q and p disjunction q
Let p and q be two propositions. The exclusive or of pand q denoted
the truth table is
The Conditional statement
In logic, a conditional statement is compound stentence that is usually expressed
with the key words 'If....then...'. Using the variables p and q to represent two
simple sentences, the conditional "If p then q" is expressed symbollically as p⇒q
The Bi conditional statement
When a conditional statement and its converse are both true, you can write them as one
statement called a biconditional statement.
Logical Equivalence of statements:
Two propositions are said to be logically equivalence to each other if they have the
same truth values
Tautology:
The compound statement which is always true known as Tautology
Contrapositive:
The compound statement which is always false known as contradiction.
Related problems:
Example: Show that
Solution.
Example: Show that the statement is a tautology
Solution.
Lecturer note-2
Related problems on conditional and biconditional statement:
Example: Find the truth table of p⇒qor p→q.
Solution:
Example: Show that
Solution:
Converse, Inverse, Contrapositive of implication statement
Statement
If p, then q.
Converse
If q, then p.
Inverse
If not p, then not q.
Contrapositive If not q, then not p.
If the statement is true, then the contrapositive is also logically true. If the converse
is true, then the inverse is also logically true.
Example: Find the converse,inverse, contrapositive of implication statement
“If today is Thursday then I have a test today”
Solution: Converse: If I have a test today then today is thurs day
Inverse: If today is not Thursday then I donot have a test today
Contrapositive: If I donot have a test today then today is not Thursday
Example: Show that
Solution: Using Demorgan’s law
biconditional statement:
The biconditional proposition of p and q is denoted by
The truth table of biconditional statement is
Lecturer note-3
Predicates and Quantifiers:
The statement “X is a student” has two parts, the first part, the variable X is the
subject of the statement. The second part of the predicate “is a student” refers to
a property that the subject of the statement can have.
We can denote the statement X is a student by S(X) where S denotes the
predicate “is a student” and X is the variable.
Once a value has been assigned to the variable X the statement S(X) has a truth
value.
In general any statement of the type “Pis Q” where Q is the predicate and P is the
subject can be denoted by Q(P).
If we write S(X) for “x is the student” then S(a),S(b), S(c) and other having same
form can be obtained from S(X) by replacing X by an appropriate name.
Note that S(X) is not a statement, but it results in a statement when X is replaced
by the name of an object.
Some restriction can be introduced by limiting the class of objects under
consideration. This limitation means that the variables which are mentioned
stand for only those objects which are members of a particular set or class. Such a
restricted class is called universe of discourse or the domain of individuals or
simply the Universe.
If the discussion refers to human beings only then the universe of discourse is the
class of human beings.
Quantifiers:
Certain statements involve words that indicate quantity such as ‘all’, ‘some’,
‘none’ or ‘one’. They answer the question ‘How many?’
Since such words indicate quantity they are called Quantifiers. The quantifier ‘all’
is the Universal quantifier. We denote it by the symbol "∀(x)”
The symbol "∀(x)” represents each of the following phrases, all have essentially
the same meaning.
For all x, For every x, For each x, Everything x is such that.
The quantifier ‘Some’ is existential quantifier. We denote by the symbol “∃(x)”
The symbol “∃(x)” represents each of the following phrases all have
essentially the same meaning.
For some x, Some x such that, There exists an x such that.
Equivalences involving Quantifiers
Quantifier Negation laws:
¬∃x P(x) is equivalent to ∀x ¬P(x)
¬∀x P(x) is equivalent to ∃x ¬P(x)
Quantifier Commutative laws:
∀x ∀y P(x,y) is equivalent to ∀y ∀x P(x,y)
∃x ∃y P(x,y) is equivalent to ∃y ∃x P(x,y)
Quantifier Distributive laws:
Universal Distributive Laws (note only for ∀ with ∧)
∀x (P(x) ∧ Q(x)) is equivalent to ∀x P(x) ∧ ∀x Q(x)
Existential Distributive Laws (note only for ∃ with ∨)
∃x (P(x) ∨ Q(x)) is equivalent to ∃x P(x) ∨ ∃x Q(x)
Lecturer note-4
Nested quantifiers and rules of inference
Propositional functions with ≥2 variables can have ≥2 quantifiers:
Consider the propositional function "x > y":
By itself, this is a propositional function (an "open sentence"), not a
proposition
(it has no truevalue)
It can become a proposition (it can gain a truevalue) by:
assigning constant values to both variables: "3 > 2"
or by quantifying ("binding") both variables i.e ∀x∀y[x > y]
Rules of inferential logic:
The main concern of logic is how the truth of some propositions is connected
with the truth of another. An argument is a set of two or more propositions
related to each other in such a way that all but one of them (the premises) are
supposed to provide support for the remaining one (the conclusion).
The transition from the premises to conclusion is the inference upon which the
argument relies.
Related problems:
Example: Translate the sentence into logical form and verify the validity of the
conclusion.
Mark is a lawyer, so Mark went to law school since all lawyers have gone to law
school.
Solution: The above argument can be represented as follows.
Let p: Mark is a lawyer.
q: All lawyers have gone to law school.
r: Mark went to law school. Then we have
The symbol
is to indicate the inference conclusions.
Now, suppose that the premises of an argument are all true. Then the conclusion
may be either true or false. When the conclusion is true then the argument is said to
be valid. Otherwise invalid.
Rules to check validity of the argument.
(1) Modus ponens or the method of affirming.
(2) Modus tollens or the method of denial:
(3) Disjunctive addition.
(4) Conjuctive addition.
(5) Disjunctive syllogism
(6) Hypothetical syllogism.
Related problems. Show that the argument
is valid.
Solution: Using truth table we can prove it.
Second row shows validity.
Lecturer note-5.
Argument with Quantified premises:
In this section we discuss three types of valid arguments that involve the
Universal quantifier.
(1) Universal instantiation.
(2) Universal modus ponens.
(3) Universal modus Tollens.
Related problems:
Use the rule of universal modus ponens to find the valid conclusion of the
following argument.
Solution:
So 0= 2.0
Hence 0 is even.
Introduction to proof methods and Strategies:
In this section we discuss some common methods of proof and the standard
terminology that accompanies them.
(1) Direct method of proof: In this method we conclude that if p(x) is true
for x  D then Q(x) is also true.
Related problems:
Example: For all n;m ∈ 𝑍, if m and n are even then so is m + n:
Solution.
Let m and n be two even integers. Then there exist integers k1 and k2 such
that n = 2k1 and m = 2k2: We must show that m + n is even, that is, an
integer multiple of 2. Indeed,
m + n = 2k1 + 2k2
= 2(k1 + k2)
= 2k
where k = k1 + k2 ∈ 𝒁 Thus, by the definition of even, m + n is even
(2) Method of Vacuous proof:
This is a proof of an implication p→ 𝑞 in which it is shown that p is false
(3) Trivial proof:
A trivial proof of an implication p→ 𝑞 is one in which q is shown to be true
without any reference to p
(4) Method of proof by cases:
This is a direct method of proving the conditional proposition p1∨p2∨-----pn→
𝑞. The method consists of proving the conditional propositions p1→ 𝑞,----pn→ 𝑞.
(5) Method of indirect proofs:
Recall that in a direct proof one starts with the hypothesis of an implication
and then proves that the conclusion is true. Any other method of proof
will be referred to as an indirect proof. In this section we study two
methods of indirect proof namely contradiction and contrapositive.
Proof by contradiction. We want to show in the implication p→ 𝑞, p is
true. We assume it is not and therefore ~𝑝 is true and then derive a
contradiction.
Proof by contrapositive. We already know that p→ 𝑞 ≡ ~𝑞 → ~𝑝. So
to prove p→ 𝑞 we sometimes instead prove ~𝑞 → ~𝑝.
Related problems.
Example: If n2 is even integer so is n.
Solution. Suppose the contrary. That is suppose n is odd . Then there is an
integer k such that n=2k+ 1. In this case , n2= 2(2k2+ 2k)+1 is odd and this
contradicts the assumption that n2 iseven. Hence n must be even.
Example: If n is an integer such that n2 is odd then n is also odd.
Solution. Suppose that n is an integer that is n is even. Then there exist an
integer k such that n=2k. But then n2= 2(2k2) which is even.
Example:
Solution:
Note: Now a given real number x the largest integer n such that n≤ 𝑥 <
𝑛 + 1 is called the floor of x and is denoted by
The smallest integer n such that n-1< 𝑥 ≤ 𝑛 is called the ceiling of x and is
denoted by
Related problems:
Example:
Lecturer note-6
Sequence and summations:
A sequence is a function whose domain is the natural numbers. Instead of using the
f(x) notation, however, a sequence is listed using the an notation. There are infinite
sequences whose domain is the set of all positive integers, and there are finite
sequences whose domain is the set of the first n positive integers.
When you define a sequence, you must write the general term (nth term or an).
There are sometimes more than one sequence that is possible if just the first few
terms are given.
Defining a Sequence
There are two common ways to define a sequence by specifying the general term.
General Term, an
The first is to use a form that only depends on the number of the term, n. To find
the first five terms when you know the general term, simply substitute the values 1,
2, 3, 4, and 5 into the general form for n and simplify.
Consider the sequence defined by the general term an = 3n-2
The first five terms are found by plugging in 1, 2, 3, 4, and 5 for n.
1. 3(1) - 2 = 1
2. 3(2) - 2 = 4
3. 3(3) - 2 = 7
4. 3(4) - 2 = 10
5. 3(5) - 2 = 13
Therefore, the first five terms of the sequence are 1, 4, 7, 10, 13
Now consider the sequence defined by the general term an = 1 / n.
The first five terms are 1/1, 1/2, 1/3, 1/4, and 1/5.
Fibonacci Sequence
One famous example of a recursively defined sequence is the Fibonacci Sequence.
The first two terms of the Fibonacci Sequence are 1 by definition. Every term after
that is the sum of the two preceding terms.
The Fibonacci Sequence is 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... a n+1 = an + an-
Sigma/Summation Notation
Often mathematical formulae require the addition of many variables Summation or
sigma notation is a convenient and simple form of shorthand used to give a concise
expression for a sum of the values of a variable.
Let x1, x2, x3, …xn denote a set of n numbers. x1 is the first number in the set. xi
represents the ith number in the set.
Summation notation involves:
The summation sign
This appears as the symbol, , which is the Greek upper case letter, S. The
summation sign, , instructs us to sum the elements of a sequence. A typical
element of the sequence which is being summed appears to the right of the
summation sign.
The variable of summation, i.e. the variable which is being summed
The variable of summation is represented by an index which is placed beneath the
summation sign. The index is often represented by i. (Other common possibilities
for representation of the index are j and t.) The index appears as the expression i =
1. The index assumes values starting with the value on the right hand side of the
equation and ending with the value above the summation sign.
The starting point for the summation or the lower limit of the summation
The stopping point for the summation or the upper limit of summation
Lecturer note-7
Properties of summation and introduction to Mathematical induction:
Properties of Summation
The following properties of summation apply no matter what the lower and upper
limits are for the index. For simplicity sake, I will not write the k=1 and n, but
know that your index of summation is k in the following examples.
You can factor a constant out of a sum.
∑cak = c∑ak
Notice the ak has a subscript of k while the c doesn't. This means that the c is a
constant and the a is function of k. The sum of a constant times a function is the
constant times the sum of the function.
The sum of a sum is the sum of the sums
The summation symbol can be distributed over addition.
∑(ak + bk) = ∑ak + ∑bk
The sum of a difference is the difference of the sums
The summation symbol can be distributed over subtraction.
∑(ak - bk) = ∑ak - ∑bk
Aren't those just beautiful sounding? Those should certainly be placed on a note
card to help you remember them.
Related problems
Find
Mathematical Induction:
Principle (Proof by Mathematical Induction) let P(n) be the statement (The
idea is that P(n) should be an assertion that for any n is verifiably either true or
false.) The steps of mathematical induction are as follows.
(1) Basis of induction, Show that p(n0) is true.
(2) Induction hypothesis, Assume p(n) is true.
(3) Induction step, Show that p(n+1) is true.
Related problems
Example:
Use mathematical induction to prove that
1 + 2 + 3 + ... + n = n (n + 1) / 2
for all positive integers n.
Solution:
 Let the statement P (n) be
1 + 2 + 3 + ... + n = n (n + 1) / 2
 STEP 1: We first show that p (1) is true.
Left Side = 1
Right Side = 1 (1 + 1) / 2 = 1
 Both sides of the statement are equal hence p (1) is true.
 STEP 2: We now assume that p (k) is true
1 + 2 + 3 + ... + k = k (k + 1) / 2
 and show that p (k + 1) is true by adding k + 1 to both sides of the above
statement
1 + 2 + 3 + ... + k + (k + 1) = k (k + 1) / 2 + (k + 1)
= (k + 1)(k / 2 + 1)
= (k + 1)(k + 2) / 2
 The last statement may be written as
1 + 2 + 3 + ... + k + (k + 1) = (k + 1)(k + 2) / 2
 Which is the statement p(k + 1).
Example:
Prove that
1 2 + 2 2 + 3 2 + ... + n 2 = n (n + 1) (2n + 1)/ 6
For all positive integers n.
Solution :

Statement P (n) is defined by
1 2 + 2 2 + 3 2 + ... + n 2 = n (n + 1) (2n + 1)/ 2

STEP 1: We first show that p (1) is true.
Left Side = 1 2 = 1
Right Side = 1 (1 + 1) (2*1 + 1)/ 6 = 1

Both sides of the statement are equal hence p (1) is true.

STEP 2: We now assume that p (k) is true
1 2 + 2 2 + 3 2 + ... + k 2 = k (k + 1) (2k + 1)/ 6

and show that p (k + 1) is true by adding (k + 1) 2 to both sides of the above
statement
1 2 + 2 2 + 3 2 + ... + k 2 + (k + 1) 2 = k (k + 1) (2k + 1)/ 6 + (k + 1) 2

Set common denominator and factor k + 1 on the right side
= (k + 1) [ k (2k + 1)+ 6 (k + 1) ] /6

Expand k (2k + 1)+ 6 (k + 1)
= (k + 1) [ 2k 2 + 7k + 6 ] /6

Now factor 2k 2 + 7k + 6.
= (k + 1) [ (k + 2) (2k + 3) ] /6

We have started from the statement P(k) and have shown that
1 2 + 2 2 + 3 2 + ... + k 2 + (k + 1) 2 = (k + 1) [ (k + 2) (2k + 3) ] /6

Which is the statement P(k + 1).
Example: Using induction to prove that 3 n > n 2 for n a positive integer greater
than 2.

Solution: Statement P (n) is defined by
3n > n2

STEP 1: We first show that p (1) is true. Let n = 1 and calculate 3 1 and 1 2
and compare them
31 = 3
12 = 1

3 is greater than 1 and hence p (1) is true.

Let us also show that P(2) is true.
32 = 9
22 = 4

Hence P(2) is also true.

STEP 2: We now assume that p (k) is true
3k > k2

Multiply both sides of the above inequality by 3
3 * 3k > 3 * k2

The left side is equal to 3 k + 1. For k >, 2, we can write
k 2 > 2 k and k 2 > 1

We now combine the above inequalities by adding the left hand sides and
the right hand sides of the two inequalities
2 k2 > 2 k + 1

We now add k 2 to both sides of the above inequality to obtain the inequality
3 k2 > k2 + 2 k + 1

Factor the right side we can write
3 * k 2 > (k + 1) 2

If 3 * 3 k > 3 * k 2 and 3 * k 2 > (k + 1) 2
then 3 * 3 k > (k + 1) 2

Rewrite the left side as 3 k + 1
3 k + 1 > (k + 1) 2

Which proves that P(k + 1) is true
Lecturer note-8
Recursive definition and structural induction:
Recursive Definition
The second way is to recursively define a sequence. A recursive
definition uses the current and/or previous terms to define the next term.
You can think of ak+1 being the next term, ak being the current term, and
ak-1 being the previous term.
Consider the sequence where a1 = 5 and ak+1 = 2 ak - 1.
You can read that last part as "the next term is one less than twice the
current term"
The first five terms are:
1.
2.
3.
4.
5.
5 (by definition),
2(5) - 1 = 9 (twice the first term of 5 minus 1),
2(9) - 1 = 17 (twice the second term of 9 minus 1),
2(17) - 1 = 33 (twice the third term of 17 minus 1),
2(33) - 1 = 62 (twice the fourth term of 33 minus 1)
Now consider the sequence defined by a1 = 2, a2 = 1, and ak+2 = 3ak - ak+1
You can read that last part as "the next term is 3 times the last term
minus the current term"
The first five terms are:
1. 2 (by definition),
2. 1 (by definition),
3. 3(2) - 1 = 5 (3 times first term minus second term), Note that when
k = 1, the sequence gets written as a1+2 = 3a1 - a1+1 which becomes
a3 = 3a1 - a2. Since a1 = 2 and a2 = 1, this is where the 3(2) - 1 = 5
comes from.
4. 3(1) - 5 = -2 (3 times second term minus third term),
5. 3(5) - (-2) = 17 (3 times third term minus fourth term)
Structural induction
This is a proof method that is used in mathematical logic, computer
science, graph theory, and some other mathematical fields. It is a
generalization of mathematical induction.
In general, the idea is that one wishes to prove some proposition
P(x), where x is any instance of some sort of recursively-defined
structure such as lists or trees. A well-founded partial order is
defined on the structures. The structural induction proof is a proof
that the proposition holds for all the minimalstructures, and that if
it holds for the substructures of a certain structure S, then it must
hold for S also.
A proof of P(x) by structural induction over the elements of
a recursively defined set X is analogous to those by mathematical
and strong induction, except:
1. its basis step proves P(x0) for every element x0 in the basis set of
X, and
2. its inductive step proves that for every recursive rule from x1, x2,
… , xn to x, if P(x1), P(x2), … , P(xn) then P(x).
As with mathematical and strong induction proofs, a structural
inductive proof of P(x) can be thought of as a recipe for
constructing a proof for any specific element y of the set. If y is an
element of the set, there is a sequence of rule applications that
begins from one or more elements of the basis set and ends with y,
and the specific proof of P(y) begins with the basis step(s) for the
basis elements that were used, continues with the inductive steps
for the rules that were used, and concludes with P(y).
Lecturer note-9
Program correction and introduction to recurrence relation
An approach to detection and repair of application level semantic errors in deployed
software includes inferring aspects of correct operation of a program. For instance, a
suite of examples of operations that are known or assumed to be correct are used to
infer correct operation.
Further operation of the program can be compared to results found during correct
operation and the logic of the program can be augmented to ensure that aspects of
further examples of operation of the program are sufficiently similar to the examples
in the correct suite.
In some examples, the similarity is based on identifying invariants that are satisfied
at certain points in the program execution, and augmenting (e.g., “patching”) the
logic includes adding tests to confirm that the invariants are satisfied in the new
examples.
In some examples, the logic invokes an automatic or semi-automatic error handling
procedure if the test is not satisfied. Augmenting the logic in this way may prevent
malicious parties from exploiting the semantic errors, and may prevent failures in
execution of the programs that may have been avoided.
Recurrence relation is an equation that recursively
defines a sequence or multidimensional array of values, once one or more
initial terms are given
Recurrence relation:
Each further term of the sequence or array is defined as a function of the
preceding terms.
Fibonacci numbers are the archetype of a linear, homogeneous recurrence
relation with constant coefficients (see below). They are defined using the linear
recurrence relation
with seed values:
Explicitly, recurrence yields the equations:
etc.
We obtain the sequence of Fibonacci numbers which begins:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
Linear homogeneous recurrence relations with constant coefficients
The term linear means that each term of the sequence is defined as a linear
function of the preceding terms.
The general form of a linear recurrence relation of order is as follows:
where and (for all ) are allowed to depend on , but (for all ) is not. If
a constant (for all ) then the recurrence relation has constant coefficients.
Additionally, if
then the recurrence relation is homogeneous.
In order to obtain a unique solution to the linear recurrence there must be some
initial conditions, as the first number in the sequence can not depend on other
numbers in the sequence and must be set to some value.
Solving recurrence relation :
General methods
is
For order 1, the recurrence
has the solution an = rn with a0 = 1 and the most general solution is an = krn with
a0 = k. The characteristic polynomial equated to zero (the characteristic equation)
is simply t − r = 0.
Solutions to such recurrence relations of higher order are found by systematic
means, often using the fact that an = rn is a solution for the recurrence exactly when
t = r is a root of the characteristic polynomial. This can be approached directly or
using generating functions (formal power series) or matrices.
Consider, for example, a recurrence relation of the form
When does it have a solution of the same general form as an = rn? Substituting this
guess in the recurrence relation, we find that
must be true for all n > 1.
Dividing through by rn−2, we get that all these equations reduce to the same thing:
which is the characteristic equation of the recurrence relation. Solve for r to obtain
the two roots λ1, λ2: these roots are known as the characteristic roots or eigenvalues
of the characteristic equation. Different solutions are obtained depending on the
nature of the roots: If these roots are distinct, we have the general solution
Related problems:
1.
Example: Solve an+2+an+1-6an=2n for n
Solution
0.
First we observe that the homogeneous problem
un+2 + un+1 -6un=0
has the general solution un=A 2n +B(-3)n for n 0 because the associated
characteristic equation 2+ -6 =0 has 2 distinct roots 1=2 and 2=-3. Since the
r.h.s. of the nonhomogeneous recurrence relation is 2n, if we formally follow the
strategy in the previous lecture we would try vn=C2n for a particular solution. But
there is a difficulty: C2n fits into the format of un which is a solution of the
homogeneous problem. In other words it can't be a particular solution of the
nonhomogeneous problem. This is really because ``2'' happens to be one of the 2
roots 1 and 2. However, we suspect that a particular solution would still have to
have 2n as a factor, so we try vn=Cn2n. Substituting it to vn+2+vn+1 -6vn=2n, we
obtain
C(n+2)2n+2+C(n+1)2n+1-6Cn2n = 2n ,
i.e. 10C2n=2n or C=1/10. Hence a particular solution is vn=(n/10)2n and the
general solution of our nonhomogeneous recurrence relation is
an=A2n+B(-3)n + 2n , n 0 .
Example: Find the general solution of an+1-an=n2n+1 for n 0.
Solution
(a)The general solution for homogeneous problem is un=A because the only root
of the characteristic equation is 1=1.
(b) Since n2n+1 = 2n n +1n is of the form 1n(b1n+b0)+ n2 c0 and 2=1 is a
simple root of the characteristic equation, we try the similar form vn = 2n(B+Cn)
+ Dn for a particular solution. Substiting vn into the recurrence relation, we have
n2n+1 = vn+1-vn = 2n+1(B+C(n+1)) + D(n+1) - 2n(B+Cn) - Dn
= 2n(Cn+B+2C) + D ,
i.e.
2n ( (C-1)n + (B+2C) ) + (D-1) = 0 .
In order the above equation be identically 0 for all n 0, we require all its
coefficients to be 0, i.e.
C-1=0 , B+2C=0 , D-1=0 .
Hence B=-2, C=1 and D=1 and the particular solution vn =2n(n-2)+n.
(c) The general solution is un+vn and thus reads
an = 2n(n-2)+n+A , n 0 .
Lecturer note-10
Generating Function:
A generating function
is a formal power series
whose coefficients give the sequence
.
Generating functions giving the first few powers of the nonnegative integers are
given in the following table.
Series
1
Ordinary generating function
The ordinary generating function of a sequence an is
When the term generating function is used without qualification, it is usually taken
to mean an ordinary generating function.
If an is the probability mass function of a discrete random variable, then its
ordinary generating function is called a probability-generating function.
Exponential generating function
The exponential generating function of a sequence an is
Exponential generating functions are generally more convenient than ordinary
generating functions for combinatorial enumeration problems that involve labelled
objects
Polynomials are a special case of ordinary generating functions, corresponding to
finite sequences, or equivalently sequences that vanish after a certain point. These
are important in that many finite sequences can usefully be interpreted as
generating functions, such as the Poincaré polynomial, and others.
A key generating function is the constant sequence 1, 1, 1, 1, 1, 1, 1, 1, 1, ..., whose
ordinary generating function is
The left-hand side is the Maclaurin series expansion of the right-hand side.
Alternatively, the right-hand side expression can be justified by multiplying the
power series on the left by 1 − x, and checking that the result is the constant power
series 1, in other words that all coefficients except the one of x0 vanish. Moreover
there can be no other power series with this property. The left-hand side therefore
designates the multiplicative inverse of 1 − x in the ring of power series.
Expressions for the ordinary generating function of other sequences are easily
derived from this one. For instance, the substitution x → ax gives the generating
function for the geometric sequence 1, a, a2, a3, ... for any constant a:
(The equality also follows directly from the fact that the left-hand side is the
Maclaurin series expansion of the right-hand side.) In particular,
One can also introduce regular "gaps" in the sequence by replacing x by some
power of x, so for instance for the sequence 1, 0, 1, 0, 1, 0, 1, 0, .... one gets the
generating function
By squaring the initial generating function, or by finding the derivative of both
sides with respect to x and making a change of running variable n → n-1, one sees
that the coefficients form the sequence 1, 2, 3, 4, 5, ..., so one has
and the third power has as coefficients the triangular numbers 1, 3, 6, 10, 15, 21, ...
whose term n is the binomial coefficient
, so that
More generally, for any positive integer k, it is true that
Note that, since
one can find the ordinary generating function for the sequence 0, 1, 4, 9, 16, ... of
square numbers by linear combination of binomial-coefficient generating
sequences
Lecturer note-11
Application of generating function to solve the recurrence relation:
We also use the concept of generating function to solve a recurrence relation.
Related problems with example
Example. Solve the recurrence relation an= an-1+n using generating function by
taking a0=1.
So lution: Let
Multiply both sides of the recurrence by xn and sum
over n≥ 1. This gives
Note that
Thus in terms of A(X) we have
Rearranging terms , we get
So we have
We can now get an by expanding A(x) as a series
This gives an for n≥ 0 as
Example. Solve
function.
an= an-1+ an-2 for n≥ 2, with a0=0, a1=1 by the generating
Solution: Let we have
Multiply the recurrence by xn and sum over n≥ 2, we have
In terms of A(x) we have for n≥ 2
This leads to
We have to expand using powerseries to identify an
Factorising we have
Where
Finally for n≥ 1 we have
For n=1 , we find a1=1 what was to be expected, and obviously a0=0
Application of generating function towards combinatorial problems:
Many combinatorial problems can be solved with the help of generating functions.
In particular , let’s consider the problem of finding the number of partitions of a
natural number.
Definition: A partition of a natural number n is a way to write n as a sum of natural
numbers, without regard to the ordering of the numbers.
Lecturer note-12
Principle of Inclusion and Exclusion:
inclusion–exclusion principle is a counting technique which generalizes the
familiar method of obtaining the number of elements in the union of two finite sets.
symbolically expressed as
where A and B are two finite sets and |S| indicates the cardinality of a set S (which
may be considered as the number of elements of the set, if the set is finite).
The formula expresses the fact that the sum of the sizes of the two sets may be too
large since some elements may be counted twice.
The double-counted elements are those in the intersection of the two sets and the
count is corrected by subtracting the size of the intersection.
The principle is more clearly seen in the case of three sets, which for the sets A, B
and C is given by
This formula can be verified by counting how many times each region in the Venn
diagram figure is included in the right-hand side of the formula.
In this case, when removing the contributions of over-counted elements, the
number of elements in the mutual intersection of the three sets has been subtracted
too often, so must be added back in to get the correct total.
Related problems:
Example: How many integers in {1,...,100} are not divisible by 2, 3 or 5?
Let S = {1,...,100} and P1 the property that an integer is divisible by 2, P2 the
property that an integer is divisible by 3 and P3 the property that an integer is
divisible by 5.
Letting Ai be the subset of S whose elements have property Pi we have by
elementary counting: |A1| = 50, |A2| = 33, and |A3| = 20.
There are 16 of these integers divisible by 6, 10 divisible by 10 and 6 divisible by
15. Finally, there are just 3 integers divisible by 30,
so the number of integers not divisible by any of 2, 3 or 5 is given by:
100 − (50 + 33 + 20) + (16 + 10 + 6) − 3 = 26.
Example: In a discrete mathematics class every student is a major in
computerscience or mathematicsor both. The number of students having
computerscience as a major (possibly along withmathematics) is 25; the number of
students having mathematics as a major (possibly along withcomputer science) is
13; and the number of students majoring in both computer science and
mathematics is 8. How many students are in this class?
Solution: Let A be the set of students in the class majoring in computer science and
B be the setof students in the class majoring in mathematics. Then A ∩ B is the set
of students in the classwho are joint mathematics and computer science majors.
Because every student in the class
is majoring in either computer science or mathematics (or both), it follows that the
number of
students in the class is |A ∪ B|. Therefore,
|A ∪ B| = |A| + |B| − |A ∩ B|
= 25 + 13 − 8 = 30.
Therefore, there are 30 students in the class.
Example: How many positive integers not exceeding 1000 are divisible by 7 or
11?
Solution let A be the set of positive integers not exceeding 1000 that are
divisible by 7, and
let B be the set of positive integers not exceeding 1000 that are divisible by 11.
Then A ∪ B is the set of integers not exceeding 1000 that are divisible by either 7
or 11, and A ∩ B is the set of integers not exceeding 1000 that are divisible by both
7 and 11. Using inclusion and exclusion principle we have the result is
So there are 220 positive integers not exceeding 1000 that are divisible by either 7
or 11.
Example: Suppose that there are 1807 freshmen at your school , of these 453 are
taking a course in computer science, 567 are taking a course in mathematics. 299
are taking courses in both computer science and mathematics. How many are
taking a course either in compsc or math.
Solution: To find the number of freshmen who are not taking a course in either
mathematicsor computer science, subtract the number that are taking a course in
either of these subjectsfrom the total number of freshmen.
Let A be the set of all freshmen taking a course in computerscience, and let B be
the set of all freshmen taking a course in mathematics. It followsthat |A| = 453, |B|
= 567, and |A ∩ B| = 299.
The number of freshmen taking a course in either computer science or
mathematics is
|A ∪ B| = |A| + |B| − |A ∩ B| = 453 + 567 − 299 = 721.
Consequently, there are 1807 − 721 = 1086 freshmen who are not taking a course
in computerscience or mathematics.
Lecturer note-13
Relation and their properties:
Let A be a given set. (a; b) is called an ordered pair
Where a,b are the elements of
A
If A and B are sets, we let A × B denote the set of all ordered pairs (a; b)
where a ∈ A and b ∈ B: We call A × B as the Cartesian product of A and B.
Note: If a set A have m elements , and the set B have n elements then the set A×B
has mn elements.
Example:
Solution.
A binary relation R from a set A to set B is a subset of A×B . If (a,b) ∈ R we write
aRb and we say that a is related to b. In case A=B we call R is a binary relation on
A.
The set
Is called domain of R .
The set
Is called range of R.
Example a. Let A={2,3,4} and B={3,4,5,6,7}
Define the relation R by aRb if and only if a divides b. Find R, domR, ranger
Solution:
Function: A function is a special case of arelation. A function from ato B denoted
by f : A→B , is a relation from A to B such that for every x∈A there is a unique
y∈B such that (x,y) ∈f. The element y is called the image of x and we write y=f(x).
Example let A= {1,2,3,6} and B={1,2,3,4,5} and R={(2,2), (1,5),
(1,3),(2,5),(2,1)} represent R pictorically and find the digraph.
Solution.
Properties of relation:
Reflexive relation:
A relation R on a set A is called reflexive if (a, a) ∈ R for every element a ∈ A.
Remark: Using quantifiers we see that the relation R on the set A is reflexive if ∀
a((a, a) ∈ R),
where the universe of discourse is the set of all elements in A.
We see that a relation on A is reflexive if every element of A is related to itself.
Example: Consider the following relations on {1, 2, 3, 4}:
R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
Solution: R1 is not reflexive.
Symmetric relation:
ArelationR on a set Ais called symmetric if (b, a) ∈ R whenever (a, b) ∈ R, for all
a, b ∈ A.
A relation R on a set A such that for all a, b ∈ A, if (a, b) ∈ R and (b, a) ∈ R, then a
= b is called antisymmetric.
The terms symmetric and antisymmetric are not opposites,
because a relation can have both of these properties or may lack both of them
Example:
Is the “divides” relation on the set of positive integers symmetric? Is it
antisymmetric?
Solution:
This relation is not symmetric because 1| 2, but 2 does not divide 1.
It is antisymmetric, for if a and b are positive integers with a |b and b |a, then a =
b
Transitive Relation:
A relation R on a set A is called transitive if whenever (a, b) ∈ R and (b, c) ∈ R,
then (a, c) ∈ R, for all a, b, c ∈ A.
Example: Is the “divides” relation on the set of positive integers transitive?
Solution: Suppose that a divides b and b divides c. Then there are positive integers
k and l such that b = ak and c = bl. Hence, c = a(kl), so a divides c. It follows that
this relation is transitive.
Composition of relation: Let R be a relation from a set A to a set B and S a
relation from B to a set C. The composite of R and S is the relation consisting of
ordered pairs (a, c), where a ∈ A, c ∈ C, and for
which there exists an element b ∈ B such that (a, b) ∈ R and (b, c) ∈ S.
We denote the composite of R and S by S °R.
Example:
What is the composite of the relationsR and S, whereR is the relation
from {1, 2, 3} to {1, 2, 3, 4}
with R = {(1, 1), (1, 4), (2, 3), (3, 1), (3, 4)} and S is the relation from {1, 2, 3, 4} to
{0, 1, 2}
with S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)}?
Solution: S°R = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3, 1)}.
Lecturer note-14
Closure of relation:
let R be a relation on a set A. R may or may not have some property P, such as
reflexivity, symmetry, or transitivity.
If there is a relation S with property P containing R such
that S is a subset of every relation with property P containing R, then S is called the
closure of R with respect to P
Reflexive closure: Given a relation R on a set A, the reflexive closure of R can
be formed by adding to R all pairs of the form (a, a) with a ∈ A, not already in R.
The addition of these pairs produces a new relation that is reflexive, contains R,
and is contained within any reflexive relation containing R. We see that the
reflexive closure of R equals R ∪ R1 where
R1 = {(a, a) | a ∈ A} is the diagonal relation on A.
Example: What is the reflexive closure of the relation R = {(a, b) | a < b} on the
set of integers?
Solution: The reflexive closure of R is
R ∪ R1 = {(a, b) | a < b} ∪ {(a, a) | a ∈ Z} = {(a, b) | a ≤ b}.
Symmetric closure: The symmetric closure of a relation R can be constructed by
adding all ordered pairs of the form (b, a), where (a, b) is in the relation, that are
not already present in R.
Adding these pairs produces a relation that is symmetric, that contains R, and that
is contained in any symmetric relation that contains R.
The symmetric closure of a relation can be constructed by taking the union of a
relation with its inverse that is, R ∪ R-1 is the symmetric closure of R, where
R-1={(b, a) | (a, b) ∈ R}
Paths in a directed graph: A path from a to b in the directed graph G is a
sequence of edges (x0, x1), (x1, x2),(x2, x3), . . . , (xn-1, xn) in G, where n is a
nonnegative integer, and x0 = a and xn = b,that is, a sequence of edges where the
terminal vertex of an edge is the same as the initial vertex in the next edge in the
path.
This path is denoted by x0, x1, x2, . . . , xn-1, xn and has length n.
We view the empty set of edges as a path of length zero from a to a.
A path of length n ≥ 1 that begins and ends at the same vertex is called a circuit or
cycle.
A path in a directed graph can pass through a vertex more than once.
Path also represents Relation: Let R be a relation on a set A. There is a path of
length n, where n is a positive integer, from a to b if and only if (a, b) ∈ Rn.
Transitive closure:
Let R be a relation on a set A. The connectivity relation R* consists of the pairs
(a, b) such that there is a path of length at least one from a to b in R.
Let cardinality of the set A is m. transitive closure of the relation R on A is
R*= R∪R2∪-------∪Rm
Transitive closure by using zero one matrix representation:
LetMR be the zero–one matrix of the relation R on a set with n elements.
Then the zero–one matrix of the transitive closure R *= MR∪---- MRn
Example: Find the zero one matrix of the transitive closure of the relation R
where
Solution: the zero one matrix of R* is
So it follows that
Transitive closure by Warshall’s algorithim:
Warshall’s algorithm is based on the construction of a sequence of zero one
matrices. These matrices are W0, W1, ------,Wn, where W0=MR is the zero one
matrix of this relation.
If there is a path from vi to vj such that all the interior vertices of path are in the set
{v1,-----,vk} by considering first k vertices in the list and 0 otherwise. Continue this
process till all the n number of vertices are considered as intermediate vertices to
have a path.
At last Wn=MR* which is nothing but the transitive closure of the relation R.
Example: Let R be the relation {(a,d), (b,a),(b,c),(c,d),(d,c),(c,a)}. Find MR* i.e the
transitive closure of R.
Solution: Let v1=a, v2=b,v3=c, v4=d Now W0 is the matrix of the relation as
Now letting a is the intermediate vertex we have only one possible path from b to
d, namely b,a,d. So the next matrix W1 is
Taking b as the intermediate vertex along with a we don’t have any new paths
possible.So W2=W1.
Taking c as the intermediate vertex along with a,b we now have paths from d to a
namely d,c,a and from d to d namely d,c,d. Hence
Taking d as the intermediate vertex along with a,b,c we have the next matrix using
the possible paths, we have the next matrixis
Since no vertices left to be taken as intermediate vertex so W4=MR* which is the
matrix of transitive closure of relation R.
Lecturer note-15
Equivalence relations:
A relation that is reflexive, symmetric, and transitive on a set A is called
an equivalence relation on A..
For example, the relation “=” is an equiv-alence relation on R on the set A:
Note:
Two elements a and b that are related by an equivalence relation are
called equivalent. The notation a ∼ b is often used to denote that a and b are
equivalent elements with respect to a particular equivalence relation.
Example: Let R be the relation on the set of real numbers such that aRb if and
only if a − b is an integer. Is R an equivalence relation?
Solution: Because a −a = 0 is an integer for all real numbers a, aRa for all real
numbers a.
Hence, R is reflexive. Now suppose that aRb. Then a −b is an integer, so b−a is
also an integer. Hence, bRa.
It follows that R is symmetric.
If aRb and bRc, then a −b and b−c are integers. Therefore, a −c = (a −b) + (b−c) is
also an integer. Hence, aRc.
Thus, R is transitive.
Consequently, R is an equivalence relation.
Example: Congruence modulo m relation.
Let m be an integer withm > 1. Show that the relation
R = {(a, b) | a ≡ b (mod m)}
is an equivalence relation on the set of integers.
Solution:
a ≡ b (mod m) if and only if m divides a − b. Note that a − a = 0 is
divisible by m, because 0 = 0 ・ m.
Hence, a ≡ a (mod m), so congruence modulo m is reflexive. Now suppose that a ≡
b (mod m). Then a − b is divisible by m, so a − b = km, where k is an integer. It
follows that b − a = (−k)m, so b ≡ a (mod m).
Hence, congruence modulo m is symmetric.
Next, suppose that a ≡ b (mod m) and b ≡ c (mod m).
Thenm divides both a − b and b − c.
Therefore, there are integers k and l with a − b = km and b − c = lm.
Adding these two equations shows that a − c = (a − b) + (b − c) = km + lm =(k +
l)m. Thus, a ≡ c (mod m).
Therefore, congruence modulo m is transitive.
It follows that congruence modulo m is an equivalence relation.
Equivalence classes and partitions of a set:
Let R be an equivalence relation on A. For each a ∈ A we have
[a]={x∈A such that xRa} is called equivalence class monitored by the element a.
The equivalence classes partitions the set A into disjoint subsets. We represent
partitions of the set A under the relation R as A/R={[a] such that a∈A}
Then the union of all the elements of A/R is equal to A and the intersection
of any two distinct members of A/R is the empty set. That is, the family A/R forms a
partition of A:
Note: Let R be an equivalence relation on a set A. These statements for elements a
and b of A are equivalent:
(i) aRb (ii) [a] = [b] (iii) [a] ∩ [b] = ∅
Example: Suppose that S = {1, 2, 3, 4, 5, 6}. The collection of sets A1 = {1, 2, 3},
A2 = {4, 5}, and A3 = {6} forms a partition of S, because these sets are disjoint and
their union is S.
Lecturer note-16
Partial orderings:
A relation R on a set A is called a partial order if R is reflexive, antisymmetric, and transitive. In this case we call A a poset.
Example: Show that the set Z of integers together with the relation of inequality ≤ is
a poset.
Solution: ≤ is reexive: For all x ∈Z we have x ≤x since x = x:
≤ is antisymmetric: By the trichotomy law of real numbers, which says for a
given pair of numbers x and y only one of the following is true: x < y; x = y; or x > y:.
So if x ≤ y and y ≤x then we must have x = y:
≤ is transitive: By the transitivity property of < in IR if x < y and y < z then x < z:Thus,
if x ≤y and y ≤ z then the definition of ≤ and the above property imply that x ≤ z:
Hence Z with this relation is partially order.
Example: Show that the inclusion relation ⊆ is a partial ordering on the power
set of a set S.
Solution: BecauseA ⊆ AwheneverAis a subset of S,⊆is reflexive.
It is antisymmetric because A ⊆ B and B ⊆ A imply that A = B.
Finally, ⊆ is transitive, because A ⊆ B and B ⊆ C imply that A ⊆ C.
Hence, ⊆ is a partial ordering on P(S),
So (P (S),⊆) is a poset
Note:
The elements a and b of a poset (S, ≤) are called comparable if either a
≤ b or b ≤ a. When a and b are elements of S such that neither a ≤ b nor b ≤ a,
a and b are called incomparable.
Example: In the poset (Z+, |), are the integers 3 and 9 comparable? Are 5 and 7
comparable?
Solution: The integers 3 and 9 are comparable, because 3 | 9. The integers 5 and 7
are incomparable, because 5
does not divide
7 and 7 does not divide 5.
Note:
If (S, ≤) is a poset and every two elements of S are comparable, S is
called a totally ordered or linearly ordered set, and ≤is called a total order or a
linear order. A totally ordered set is also called a chain.
Example:
The poset (Z,≤) is totally ordered, because a ≤ b or b ≤ a whenever a
and b are integers.
Note: (S, ≤) is a well-ordered set if it is a poset such that ≤ is a total ordering
and every nonempty subset of S has a least element.
Lexicographic ordering:
we will show how to construct a partial ordering on the Cartesian
product of two posets, (A1, ≤1) and (A2, ≤ 2).
The lexicographic ordering ≤ on A1 × A2 is defined by specifying that one pair is
less than a second pair if the first entry of the first pair is less than(in A1) the first
entry of the second pair, or if the first entries are equal, but the second entry of
this pair is less than (in A2) the second entry of the second pair.
In other words, (a1, a2) is less than (b1, b2), that is, (a1, a2) ≺ (b1, b2),
either if a1 ≺1 b1 or if both a1 = b1 and a2 ≺2 b2..
Example:
Determine whether (3, 5) ≺ (4, 8), whether (3, 8) ≺ (4, 5), and
whether (4, 9) ≺ (4, 11) in the poset (Z × Z, ≤), where ≤ is the lexicographic
ordering constructed from the usual ≤ relation on Z.
Solution:
Because 3 < 4, it follows that (3, 5) ≺ (4, 8) and that (3, 8) ≺ (4, 5).
We have (4, 9) ≺ (4, 11), because the first entries of (4, 9) and (4, 11) are the
same but 9 < 11.
Lecturer note-17
Hasse diagram: This is nothing but pictorial representation of a poset
followed by a partial order relation.
Hasse diagram comes from directed graph of the relation by avoiding the reflexive
pairs and establishing the precedence relationship by the transitive pair.
In the Hasse diagram if there is a directed path from vertex x to vertex y then x<y.
Hasse diagram of a poset need not be connected.
Procedure to find Hasse diagram: Find the directed graph corresponds to the
partially ordered relation.
Avoid the reflexive pair i.e loops.
Avoid the edges which are coming directly by the transitive relation. For example
no edge is required inbetween a and c directly when there is an edge between a to b
and b to c.
Assuming all the edges are pointing upwards so that we don’t have to put the
direction of the edges.
Cancelling the unnecessary edges as per the restriction we find the Hassediagram.
Related problems:
Example: Construct the Hasse diagram corresponds to the poset ({1,2,3,4},≤)
Solution:
The following figures are representing the corresponding steps to
obtain the Hasse diagram.
In step-1 we plot the directed graph corresponds to the relation.
In step-2 we avoid the edges coming through reflexive and transitive
relations.
In step-3 we obtain the Hasse diagram corresponds to the poset.
Step-1
Step-2
Step-3
Example:
Draw the Hasse diagram for the partial ordering {(A,B)| A⊆B} on the power set
P(s) where S={a,b,c}
Solution:
The element ∅ is at the bottam since empty set is the subset of every set
For a given poset a Hasse diagram is not unique.
Lecturer note-18
Maximal and minimal elements and other elements of a poset:













The element y∈A is called a minimal member of A relative to a partial
ordering ≤ if for no x ∈A such that x<y. Where A is a poset.
Similarly for no x ∈A s.t y<x then y is the maximal element.
Maximal and minimal members corresponds to a poset are not unique.
Distinct minimal or maximal members corresponds to a poset are
incomparable.
Let A is a poset, if for y ∈A such that y≤x for all x ∈A. Then y is the least
element of A relative to the partial ordering.
Similarly for x≤y for all x ∈A, y is the greatest element of A.
Corresponds to a poset if the least or greatest member exist then it is
unique.
In every simple ordering or chain the least and greatest member always
exist.
Any element x ∈A is an upperbound for B, where B is the subset of A , if for
all a ∈B, a≤x.
Any element x ∈A is a lower bound for B, if for a ∈B, x≤a.
Upper and lower bound of a subset are not necessarily unique.
Least among the upperbounds is known as least upper bound denoted by
LUB or SUP.
Greatest among the lower bound is the greatest lower bound denoted by
GLB or INF.
Related problems:
Example: Draw the hasse diagram and find the maximal and minimal elements
of the poset ({2,4,5,10,12,20,25},|)
Solution : The required Hasse diagram is given below
The maximal elements are 12,20,25 and the minimal elements are 2,5
Example:Is there a greatest element and least element in the poset (Z+, |)
Solution: The integer 1 is the least element because 1|n whenever n is a positive
integer. Since there is no integer that is divisible by all positive integers, there is no
greatest element.
Example: Find the lower and upperbounds of the subsets{a,b,c}, {j,h} and
{a,c,d,f} in the poset with following Hasse diagram.
Solution: The upper bounds of {a,b,c} are e,f,j,and h and the lb is a
No upper bounds of {j,h} but the lowerbounds are a,b,c,d,e,f.
The upper bounds for {a,c,d,f} are f,h,and j and its lowerbound is a.
Example: Find the greatest lower bound and the least upperbound of {b,d,g} if
they exist in the above Hassediagram.
Solution: The upperbounds of {b,d,g} are g and h. Since g<h, so g is the least
upperbound. The lowerbounds of {b,d,g} are a and b. Since a<b, so b is the
greatest lower bound.
Example: Find the greatest lower bound and the least upperbound of the
sets{3,9,12} and {1,2,4,5,10} if they exist in the poset (Z+,|).
Solution: An integer is a lower bound of {3,9,12} if 3,9,12 are divisible by this
integer. Such integers are 1 and 3. Since 1|3, 3 is the greatest lowerbound of
{3,9,12}. The only lower bound for the set {1,2,4,5,10} with respect to | is the
element 1. Hence 1 is the greatest lower bound for {1,2,4,5,10}
Example:
Let S be a set. Determine whether there is a greatest element and a
least element in the poset (P (S),⊆).
Solution: The least element is the empty set, because ∅ ⊆ T for any subset T of S.
The set S is the greatest element in this poset, because T ⊆ S whenever T is a
subset of S.
Lecturer note-19
Lattices:
A poset (A;≤) with the property that for any two elements a and b,
a∨b and a∧_b always exist, is called a lattice.
So a lattice is a partially ordered set (L, ≤) in which every pair of elements a,b ∈ L has a
greatest lower bound and a least upperbound.
a∨b is the LUB of {a,b} or also a⊕b i.e join or sum of a and b.
a∧_b is the GLB of {a,b} or also a*b i.e meet or product of a and b.
A totally ordered set is trivially a lattice.
A lattice is called complete if each of its nonempty subset has a LUB and GLB.
The least and the greatest elements of a lattice are called bounds of the lattice and are
denoted by 0 and 1.
Every finite lattice must be complete.
Every complete lattice must have a least and greatest element.
Related problems:
Example: Determine whether the posets represented by each of the Hasse
diagrams are lattices.
Solution: The posets represented by the Hasse diagrams in (a) and (c) are both
lattices because in each poset every pair of elements has both a least upperbound
and a greatest lower bound.
The poset with the Hasse diagram in(b) is not a lattice, because the elements b and
c have no least upperbound.
Example: Show that (N,|) is a lattice with usual operation.
Solution
Let m and n be natural numbers. Then in (N, |), m∧n and m∨n always
exist, and moreover
m∧n = GCD(m;n) and
m∨n = LCM(m;n). Hence (N,|) is a
lattice with usual operation of GCD and LCM.
Example: Determine whether (P (S),⊆). Is a lattice where s is a set.
Solution: Let A and B be two subsets of S. The least upperbound and the greatest
lower bound of A and B are A∪B and A∩B. So (P (S),⊆) is a lattice.
Notes: The element b∈L is called complement of a ∈L provided a*b=0 and a⊕b=1.
A lattice (L,*,⊕,0,1) is said to be complemented lattice if every element of L has
at least one complement.
A lattice (L,*,⊕,) is called a distributive lattice if for any a,b,c∈L, we have
a*(b⊕c)= (a*b)⊕(a*c)
Every chain is a distributive lattice.
Lecturer note-20
Introduction to graph theory:



















Graph is a set of vertices and edges
A number of different diagrams may represent the same graph
Any pair of vertices which are connected by an edge in a graph is called
adjacent vertices.
A graph where every edge is directed is known as directed graph or
digraph.
Every edge is undirected called undirected graph.
An edge of a graph which joins a vertex to itself is called a loop.
Graph involves parallel edges and loops known as multigraph.
Simple graph involves no parallel edges and loops.
A graph in which weights are assigned to every edge is called a weighted
graph.
The number of edges that are incident to a vertex V refers the degree of
vertex V.
In any graph the number of vertices of odd degree is even.
Let G be an undirected graph with E number of edges and V number of
vertices, then ∑ deg(𝑣)=2E
If G is a directed graph then sum of in degree is same with sum of out
degree and same with number of edges corresponds to a graph with vertex
V and E is the edges.
The sum of indegrees and the sum of outdegrees of all vertices in a directed
graph are same.
We define 𝛿(G) = min{degV} and ∆(G)= max{degV} corresponds to a graph
G.
A graph G is said to be K regular if 𝛿(G)= ∆(G)=K.
A simple graph in which every pair of vertices are adjacent called a
complete graph.
A complete graph with n vertices denoted by Kn.
If G is a simple graph with n vertices then 0≤ deg(v) ≤n-1

A vertex of degree zero is called isolated vertex. A vertex is pendant if and
only if it has degree one.
Examples: Draw the graph K4
Solution:
Note:
Handshaking Theorem. Let G=(V,E) be an undirected graph with m
edges , then 2m=∑𝑣∈𝑉 deg(𝑣). This also applies to a graph having multiple edges
and loops.
Related problems:
Example: How many edges are there in a graph with 10 vertices each of degree 6.
Solution: Since the sum of the degrees of the vertices is 6.10=60, it follows that
2m=60, m=30 the number of edges.
Note: An undirected graph has an even number of vertices of odd degree.
Let V1 and V2 be the set of vertices of even degree and the set of vertices of odd
degree. The number of edges is m.
Then 2m= ∑𝑣∈𝑉 deg(𝑣)= Sum of the vertices of even degree+ Sum of the vertices
of odd degree.
Now the sum of the vertices of evendegree is obviously even so the proof follows
since 2m is even.
Lecturer note-21
Graph terminology and special kind of graphs:
* A cycle graph of order n is a connected graph whose edges form a cycle of
length n denoted by Cn.* A null graph of order n is a graph with n vertices and no
edges, denoted by Nn.
* A wheel graph of order n is obtained by joining a new vertex called Hub to each
vertex of a cycle graph of order n-1 denoted by Wn.
*A bipartite graph is an undirected graph whose set of vertices can be partitioned
into two sets p and q in such a way that each edge joins a vertex in p to a vertex in
q and no edge joins either two vertices in p or in q.
Example: Following are the example of bipartite graph
Example: Show that the graph K3 is not bipartite.
Solution: Any two sets of vertices of K3 will have one set with at least two vertices.
Thus, according to the de_nition of bipartite graph, K3 is not bipartite.
complete bipartite graph Km,n;This is the graph that has its vertex set partitioned into
two disjoint subsets of m and n vertices, respectively. More-over, there is an edge
between two vertices if and only if one vertex is in the first set and the other vertex is in
the second set.
Example: Draw K2,3 and K3,3
Representing Graphs and Graph Isomorphism
One way to represent a graph without multiple edges is to list all the edges of this
graph. Another way to represent a graph with no multiple edges is to use adjacency
lists, which specify the vertices that are adjacent to each vertex of the graph.
Graphs can be represented using matrices. The adjacency matrix of a graph
G with n vertices is an n×n matrix AG such that each entry aij is the number
of edges connecting vi and vj. Thus, aij = 0 if there is no edge from vi to vj :
0 1 1 0 
1 0 0 1 

Example: Draw a graph with the adjacency matrix 
1 0 0 1 


0 1 1 0 
Use an adjacency matrix to represent the graph
Solution:
When (u; v) is an edge in a directed graph G then u is called the initial vertex and v is called the terminal vertex. In a directed graph,
the in-degree of a vertex v; denoted by deg�(v);
When (u; v) is an edge in a directed graph G then u is called the initial vertex and v is called the terminal vertex. In a directed graph,
the in-degree of a vertex v; denoted by deg -(v);
Lecturer note-22
Graph Isomerphism:
The simple graphs G1 = (V1,E1) and G2 = (V2,E2) are isomorphic if there exists a onetoone and onto function f from V1 to V2 with the property that a and b are adjacent in G1 if
and only if f (a) and f (b) are adjacent inG2, for all a and b in V1. Such a function f is
called an isomorphism. Two simple graphs that are not isomorphic are called
nonisomorphic.
Or Two simple graphs G1 and G2 are isomorphic, in symbol, G1 ≈G2; if there
is one-to-one onto function, f : V (G1) → V (G2) and (u; v) ∈ EG1 if and only
if (f(u); f(v)) ∈ EG2
Note: The number of vertices, the number of edges, and the degrees of
the vertices are all invariants under isomorphism. If any of these quantities
differ in two graphs, these graphs cannot be isomorphic. However, when these
invariants are the same, it does not necessarily mean that the two graphs are
isomorphic.
Example: The following graphs are not isomorphic.
Example: Verify the following graphs are isomorphic
Solution: Both G and H have six vertices and seven edges. Both have four vertices of
degree two and two vertices of degree three. It is also easy to see that the subgraphs of
G and H consisting of all vertices of degree two and the edges connecting them are
isomorphic. Because G and H agree with respect to these invariants, it is reasonable to
try to find an isomorphism f .
Now the adjacency matrix corresponds to G and H i.e A(G), A(H) are
The adjacency matrix of H with the rows and columns labeled by the images of the
corresponding vertices in G,
Because A(G) = A(H), it follows that f preserves edges. We conclude that f is an
isomorphism, so G and H are isomorphic.
Complement of a graph Let G is the graph then G the complement of G is the
graph involving the adjacent vertices which are not adjacent in G
Self complementary graph
A simple graph G is called self-complementary if G and G are isomorphic.
Note: A simple graph G is self complementary if it has 4n or 4n+1 vertices, where n is a
nonnegative integer.
A graph G with n vertices is isomorphic to its complement, where n or n-1 is a multiple
of 4 and the number of edges in G =n(n+1)/4
Example: Can a graph with seven vertices be isomorphic to its complement
Solution: Hence n=7 and n-1=6
Neither 7 or 6 is a multiple of 4 so the graph is not isomorphic to its complement
Lecturer note-23
Graph connectivity:
Path: In an undirected graph G a sequence P of the form v0e1v1e2 _ _ _ vn-1envn
with no edge repeated is called a path of length n or a path connecting v0
to vn
Circuit: A path of length ≥1 with no repeated edges and whose end vertices are same
is called a circuit.
A circuit may have repeated vertices other than the end vertices or If P is a path such
that v0 = vn then it is called a circuit or a cycle.
A path or circuit is simple if it does not contain the same vertex more than
once. So a cycle is a simple circuit.
Note:A loop is a cycle of length 1, In a graph a cycle that is not a loop must have length
atleast 3
A graph that does not contain any circuit is called acyclic.
Example: In the graph below, determine whether the following sequences are paths,
simple paths, circuits, or simple circuits.
Solution: a. a path (no repeated edge), not a simple path (repeated vertex v1), not a
circuit
b. a simple path
c. a simple circuit
d. a circuit, not a simple circuit (vertex v4 is repeated)
Directed path
A directed path is a directed walk in which the arrows a1 , ----- ,ak are
all different.
Directed circuit
A directed circuit is a directed path from a node to itself
An undirected graph is called connected if there is a path
between every pair of distinct vertices of the graph. A graph that is not connected is
said to be disconnected.
Connected graph:
Note:
A connected component of a graph G is a connected subgraph
ofG that is not a proper subgraph of another connected subgraph ofG. That is, a
connected component of a graphG is a maximal connected subgraph ofG.
A graphG that is not connected has two or more connected components that are
disjoint and have G as their union.
Connectedness in Directed Graphs
A simple digraph is said to be unilaterally connected if for any pair of vertices of the
graph at least one of the vertices of the pair is reachable from the other vertex.
If for any pair of vertices of the graph both the vertices of the pair are reachable from
one another, then the graph is called strongly connected.
A directed graph is weakly connected if there is a path between every two vertices in
the underlying undirected graph.
That is, a directed graph is weakly connected if and only if there is always a path
between two vertices when the directions of the edges are disregarded. Clearly, any
strongly connected directed graph is also weakly connected.
Note: For a simple diagraph , a maximal strongly connected subgraph is called a strong
component. Similarly a maximal unilaterally connected or maximal weakly connected
subgraph is called a unilateral or weak component respectively.
Note: A unilaterally connected digraph is weakly connected but a weakly connected
digraph is not necessarily unilaterally connected.
A strongly connected digraph is both Unilaterally and weakly connected.