Discrete Structures
Discrete Structures
GUIDE
CIT 206
DISCRETE STRUCTURES
Course Team
Lagos Office
14/16 Ahmadu Bello Way
Victoria Island, Lagos
e-mail: [email protected]
URL: www.nou.edu.ng
Printed 2022
ISBN: 978-058-851-5
All rights reserved. No part of this book may be reproduced, in any form
or by any means, without permission in writing from the publisher.
ii
CONTENTS PAGE
Introduction ………………………...……………………………….. iv
What You Will Learn in This Course ………………………………. iv
Course Aims …………………………………………..…………….. iv
Course Objectives …………………………..………………………. . v
Working through This Course …………….………………………… v
Course Materials ……………………………..……………………… vi
Study Units …………………………….……………………………. vi
Textbooks and References …………………..……………………… vii
Presentation Schedule ……………………………….……………… vii
Assessment…………………………………………….……………. vii
Tutor-Marked Assignments (TMAs) ………………..……………… viii
Final Examination and Grading ……………………….……………. viii
Course Marking Scheme ……………………………………………. viii
Course Overview …………………………………….……………… viii
How to Get the Most from This Course …………….………………. ix
Facilitators/Tutors and Tutorials …………………….…………….. .. ix
Summary …………………………………………………………… . x
iii
INTRODUCTION
The course, Discrete Structures, is a 3- credit unit course for students studying towards acquiring
the Bachelor of Science in Computer Science. In this course we will study about discrete objects
and the relationship between them and introduce the applications of discrete mathematics in the
field of Computer Science. This course also covers sets, logic, proving techniques, combinatorics,
functions, relations, graph theory and Boolean algebra.
The overall aims of this course are to introduce you to basic concepts of sets, logic, functions,
matrices and graph theory.
In structuring this course, we commence with the introduction to discrete structures and move to
the Boolean algebra and lattices.
Course Aims
The overall aims and objectives of this course will help you to:
iv
Course Objectives
2. Write an argument using logical notation and determine if the argument is valid or not;
3. Demonstrate the ability to write and evaluate a proof using mathematical induction;
5. Recognize the use of Karnaugh map to construct and minimize the canonical sum of
products of Boolean expressions and transform it into an equivalent Boolean expression;
7. Discriminate between a Eulerian graph from a Hamiltonian graph for use in solving
mathematical problems;
In order to have a thorough understanding of the course units, you will need to read and understand
the contents, practice the steps and techniques involved. This course is designed to cover
approximately thirteen weeks, and requires your devoted attention, answering the exercises in the
tutor-marked assignments and gets them submitted to your tutors.
v
Course Materials
These include:
1. Course Guide
2. Study Units
3. Recommended Texts
4. A file for your assignments and for records to monitor your progress.
Study Units
There are three (3) Modules and eight (8) Units in this course:
Unit 1: Matrices
Unit 2: Applications to Counting
Unit 3: Discrete Probability Generating Function
From the preceding, the content of the course can be divided into three major blocks:
Module one describes the Set Theory, a mathematical theory that underlies all of modern
mathematics
Module two explain in details the Boolean algebra and graph theory
Module three discusses matrices, application to counting and discrete probability
vi
Textbooks and References
Presentation Schedule
The Presentation Schedule included in your course materials gives you the important dates for the
completion of Tutor-Marked assignments and attending tutorials. Remember, you are required to
submit all your assignments by the due date. You should guard against lagging behind in your
work.
Assessment
There are two types of assessment for this course. The first one is the tutor-marked assignment and
the second is a written examination. In tackling the assignments, you are expected to apply
vii
information and knowledge acquired during this course. The tutor-marked assignments must be
submitted to your tutor, for formal assessment in accordance with the deadlines stated in the
assignment file.
The work you submit to your tutor for assessment will count for 30% of your total course mark.
At the end of the course, you will need to sit for a final three-hour examination. This also accounts
for 70% of your total course mark.
viii
1. Read this course guide thoroughly.
2. Organise a study schedule. Refer to the “course overview‟ for more details. Note the time
you are expected to spend on each unit and how the assignments relate to the units.
Whatever method you choose to use, you should decide on it and write in your own date,
for working on each unit.
3. Once you have created your own study schedule, do everything you can, to stick to it. The
major reason that students fail is that, they lag behind in their course work.
4. Turn to unit 1 and read the introduction and objectives for the unit.
5. Assemble the study materials. Information about what you need for a unit is given in the
“overview‟ at the beginning of each unit. You will almost always need both the study unit
you are working on and one of your set of books on your desk at the same time.
6. Work through the unit. The content of the unit itself has been arranged, to provide a
sequence for you to follow. As you work through the unit, you will be instructed to read
sections from your set of books or other articles. Use the unit to guide your reading.
7. Review the objectives for each study unit to confirm that you have achieved them. If you
are not sure about any of the objectives, review the study material or consult your tutor.
8. When you are confident that you have achieved a unit’s objectives, you can then start on
the next unit. Proceed unit by unit through the course and try to pace your study, so that
you can keep yourself on schedule.
9. When you have submitted an assignment to your tutor for marking, do not wait for its return
before starting on the next unit. Keep to schedule. When the assignment is returned, pay
particular attention to your tutor’s comments, both on the tutor-marked assignment form
and also on the assignment. Consult your tutor as soon as possible, if you have any question
or problem.
10. After completing the last unit, review the course and prepare yourself for the final
examination. Check that you have achieved the unit objectives (listed at the beginning of
each unit) and the course objectives (listed in this course guide).
Facilitation
There are 12 hours of tutorials provided in support of this course. You will be notified of dates,
times and locations of these tutorials, together with the name and phone number of your tutor, as
soon as you are allocated a tutorial group.
ix
Your tutor will mark and comment on your assignments, keep a close watch on your progress and
on any difficulty you might encounter, and provide assistance to you during the course. You must
mail or submit your tutor-marked assignments to your tutor well before the due date (at least two
working days are required). They will be marked by your tutor and returned to you as soon as
possible.
Do not hesitate to contact your tutor by telephone, or e-mail if you need help. The following might
be circumstances in which you would find help necessary. Contact your tutor if:
• you do not understand any part of the study units or assigned reading
• you have difficulty with the self-test or exercises
• you have a question or problem with an assignment, with your tutor’s comments on an
assignment or with the grading of an assignment.
You should try your best to attend the tutorials. This is the only chance to have face to face contact
with your tutor and ask questions, which are answered instantly. You can raise any problem
encountered in the course of your study. To gain the maximum benefit from course tutorials,
prepare a question list before attending them. You will learn a lot from participating in discussions
actively.
Summary
The course, Discrete Structures is intended to get student acquainted with the basic principles of
sets and operations in sets and to enable them prove basic set equalities. This course also provides
you with knowledge on how to write an argument using logical notation and determine if the
argument is valid or not.
We hope that you will find the course enlightening and that you will find it both interesting and
useful. In the longer term, we hope you will get acquainted with the National Open University of
Nigeria and we wish you every success in your future
x
CONTENTS PAGE
Unit 1: Sets……….………………………………………………....…. 1
Unit 2: Proofs and Induction ….…………………………………......... 12
Unit 3: Logic …….………………………………………………......... 18
xi
MODULE 1 INTRODUCTION TO DISCRETE STRUCTURES
Unit 1: Set Theory
Unit 2: Proofs and Induction
Unit 3: Logic
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Introduction to Mathematical Statements
3.1.1 Statement Definition
3.1.2 Logical Connectives
3.2 Sets
3.2.1 Definition of Set
3.2.2 Notations
3.2.3 Operations on Set
3.2.4 Rules of Set theory
3.2.5 Disjoint Set
3.2.6 Power Set
3.2.7 Venn Diagram
3.3 Relations
3.3.1 Definition of Relations
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Reading
1.0 Introduction
This unit describes Set Theory, a mathematical theory that underlies all of modern
mathematics. The best way to understand mathematics is to talk and write about
mathematics. Mathematics is not all about finding solutions to given tasks. Therefore, as
we tackle a more advanced and abstract mathematics in this unit, your basic
understanding of it will be helped by how well you can read, write and talk about
mathematical statements.
2.0 Objectives
By the end of this Unit, you will be able to:
• explain basic properties of sets and operations of sets
• work with sets precisely define the number of elements of a finite set
• discuss the essentials of mathematics
• describe what a declarative statement is.
2
This example of a molecular statement can also be broken down into smaller statements
which were only connected by an “and”. Obviously, molecular statements are still
statements, therefore, they must be either true or false. The five connectives we can
consider are “and”, “or”, “if… then”, “if and only if”, and “not.
“and” - I am a boy and my sister is a girl.
“or” - Delight is a boy or a girl.
“if… then” - If you register then you can write the exam.
“if and only if”- You can register if and only if you were admitted.
“not - You are not admitted.
The connectives, “and”, “or”, “if… then”, “if and only if”, connects two statements and are
called binary connectives while the connective “not” applies to only a single sentence and
is called a unary connective.
In order to determine the truth values of molecular statements, the key observation to make
is to completely determined the truth values of the parts and the type of connective(s). We
do not necessarily need to know what the individual parts actually say, we however, only
need to know whether those parts are true or false. Therefore, in order to analyse logical
connectives, we use propositional variables (also called sentential variables) which are
the letters found in the middle of the English alphabet represented in capital: P, Q, R, S, …
to represent each atomic statements in the molecular statement. These variables can only
have two values, true or false. The logical connectives: “and”, “or”, “if… then”, “if and
only if”, and “not” can be represented by these symbols , , →, ↔, and ¬ respectively.
3
• P ∧ Q is true when both P and Q are true
• P ∨ Q is true when P or Q or both are true.
• P → Q is true when P is false or Q is true or both.
• P ↔ Q is true when P and Q are both true, or both false.
• ¬P is true when P is false and vice versa.
3.2 Sets
Sets are the most fundamental objects in all of mathematics.
3.2.1 Definition of Set: An informal definition of set is that a set is an unordered
collections of objects. The objects that comprises of the set are called elements. The
number of objects in a set can be finite or infinite.
3.2.2 Notations
A single set, A can be expressed with the following notations:
A = {1, 2}; A = {2, 1}; A = {1, 2, 1, 2}; A = {x | x is an integer, 1 ≤ x ≤ 2}
The notation, A = {1, 2} is read as, “A is the set containing the elements 1 and 2.”
The curly braces “{ }” is used to enclose the elements of a set and the comma “,” is used
to separate the elements inside the braces.
The symbol “|” (or “:” or “”), implies “such that”. Therefore, the notation, {x | x is an
integer, 1 ≤ x ≤ 2} is read as “the set of all x such that x is an integer between 1 and 2 (1
and 2 inclusive)”.
Considering the notation:
5 ∈ {1, 2, 5}
The symbol “∈” implies “is in” or “is an element of.” Therefore, the notation is read as 5
is an element of a set containing 1,2, and 5. This is a true statement. We can also write
another true statement if we say that 3 “is not” an element of the set containing 1,2, and 5.
This can be written as:
3 ∉ {1, 2, 5}
Some other notations
⊆: A ⊆ B asserts that A is a subset of B | every element of A is also an element of B.
If A is {2, 3, 4}, B is {2, 3, 4, 5}. Then A ⊆ B.
If A is {2, 3, 4}, B is {2, 3, 4}. Then A ⊆ B and B ⊆ A.
4
If A is {2, 3, 4, 5}, B is {2, 3, 4, 6, 7}. Then B ⊈ A.
⊂: A ⊂ B asserts that A is a proper subset of B | every element of A is also an element
of B, but every element of B is not an element of A.
Let A = {2, 3, 4} and B = {1, 2, 3, 4, 5}. Then, A ⊂ B.
If A is {2, 3, 4}, B is {2, 3, 4}. Then A ⊄ B (read as A is a NOT a proper subset of B).
U: A fixed set which contains all other sets under investigation is called universal set.
In other words, all other sets under investigation are subsets of the universal set and it is
denoted by U.
Example: Considering human population, the universal set consist of all people in the
world.
∩: A ∩ B is the intersection of A and B: the set containing all elements which are
elements of both A and B.
If A is {1, 2, 4, 5}, B is {2, 3, 4}. Then A ∩ B = {2, 4}
\: A \ B is A minus B: the set containing all elements of A which are not elements of
B.
Let A = {1, 2, 4, 5, 6}, B = {2, 3, 4}. Then A \ B = {1, 5, 6}.
5
×: A × B is the Cartesian product of two non-empty sets A and B: the set of all
ordered pairs (a, b) with a ∈ A and b ∈ B.
Let A be a set. A × A is the set of ordered pairs (x, y) where x, y ∈ A.
The expression A × A × · · · × A (n times) can also be denoted as An which is the set of all
ordered subsets (with repetitions) of A of size n.
Examples
i. {0, 1}n the set of all “strings” of 0 and 1 of length n.
ii. Let A = {1, 2}, B = {3, 4, 5}. Then A × B = {(1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5)}.
Example 3.2.3.1
Prove that A × B = B × A, only if A = B.
Solution 3.2.3.1
Proof: Let A × B = B × A. then, A ⊆ B and B ⊆ A. Therefore, A = B.
6
• ℝ+ The positive reals
• P(A) The power set of any set A is the set of all subsets of A.
3.2.5 Disjoint Set
Sets X and Y are said to be disjoint sets, if they have no element in common, that is, no
element of X is in Y and no element of Y is in X.
Example 3.2.5.1:
i. Given 𝑋 = {1,2,3} and 𝑌 = {4,5,6}, then 𝑋 and 𝑌 are disjoint sets.
ii. If 𝑃 = {𝑎, 𝑏, 𝑐, 𝑑} and 𝑄 = {𝑑, 𝑒, 𝑓, 𝑔}, then 𝑃 and 𝑄 are not disjoint sets, since 𝑑 is
in both sets.
3.2.6 Power Set
We call the set of all subsets of A, the power set of A, and write it as P(A)
Example 3.2.6.1 Let A = {1, 2, 3}. Find P(A).
Solution 3.2.6.1 P(A) is a set of sets, all of which are subsets of A.
So, P(A) = {∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}.
Note: The power set of a set A is normally, 2n, where n is the cardinality of the set A.
Therefore, since |A| = 3, the cardinality of the power set of A, |P(A)| = 23 = 8.
Note: Although 2 ∈ A, it will be wrong to say that 2 ∈ P(A) because none of the elements
in P(A) are numbers. However, we can say that {2} ∈ P(A) because {2} ⊆ A.
We can relate the symbols of union and intersect to resemble the logic symbols of “or” and
“and”. Remember that the statement x ∈ A ∪ B is read as x is an element of A or x is an
element of B. Therefore,
x ∈ A ∪ B ↔ x ∈ A ∨ x ∈ B.
Similarly,
x ∈ A ∩ B ↔ x ∈ A ∧ x ∈ B.
Also,
x ∉ A ↔ ¬(x ∈ A)
Example 3.2.6.2
Let A = {2, 4, 6}, B = {1, 2, 3, 4, 5, 6}, C = {1, 2, 3}, D = {1, 3, {4, 5}, x}, and
E = {7, 8, 9}.
7
Determine each statement to be either true, false, or meaningless.
1. A ⊂ B. 2. B ⊂ A. 3. A ∈ C. 4. ∅ ∈ B. 5. ∅ ⊂ A.
6. A < E. 7. 3 ∈ C. 8. x ⊂ D. 9. {9} ⊂ E.
Solution 3.2.6.2
1. True. Every element in A is an element in B.
2. False. For example, 1 ∈ B but 1 ∉ A.
3. False. The elements in C are 1, 2, and 3. The set A is not equal to 1, 2, or 3.
4. False. The set B has exactly 6 elements, and none of them is an empty set.
5. True. Everything in the empty set (nothing) is also an element of A. Notice that the
empty set is a subset of every set.
6. Meaningless. A set cannot be less than another set.
7. True. 3 is one of the elements of the set C.
8. Meaningless. x is not a set, so it cannot be a subset of another set.
9. True. 9 is the only element of the set {9}, and is an element of E, so every element in
{9} is an element of E.
8
3.3 Relations
3.3.1 Definition 3.3.1: A relation on a single set S is a subset of S × S. A relation on sets
S and T is a subset of S × T. Now, let’s consider relationships among sets. For example,
we can say that X is married to Y and they both have a child, Z. In our daily lives, we deal
a lot with talks about relationships. For example, if we consider two human beings (A, B),
“taller-than”, “smarter-than” are relations between them. That is (A, B) ∈ “taller-than” if
person A is taller than person B. “≥” is a relation on R; “≥” = {(x, y) | x, y ∈ R, x ≥ y}.
3.3.2 Definition: A relation R on a set S is:
i. Reflexive if for all x ∈ S, (x, x) ∈ R.
ii. Symmetric if for all x, y ∈ S, whenever (x, y) ∈ R, (y, x) ∈ R.
iii. Transitive if for all x, y, z ∈ S, whenever (x, y) ∈ R and (y, z) ∈ R, then (x, z) ∈ R.
Example 3.3.1.1
i. “≤” is reflexive, but “<” is not.
ii. “sibling-of” is symmetric, but “≤” and “sister-of” is not.
iii. “sibling-of”, “≤”, and “<” are all transitive, but “parent-of” is not (however, “ancestor-
of” is transitive).
9
A relation that is reflexive, symmetric and transitive is called an Equivalence relation and
is denoted by the symbol “≡”.
Let “≡” be an equivalence relation on the set S. An equivalence class is a maximal subset
E of the set S such that any two elements in the set E is related. There can be multiple
equivalence class corresponding to the relation ≡.
4.0 Conclusion
The bulk of work in this unit is on how set theory (a branch of mathematical logic gives
insight into how Discrete Structure are viable in Computer Science. Emphasis were made
on a set being a collection of objects or groups of objects. The unit further highlighted on
the rules of set theory and its power set.
5.0 Summary
In this unit we learnt that Sets are the most fundamental objects in all of mathematics. That,
a set is a collection of objects or groups of objects. A statement can be an Atomic Statement
if it cannot be divided into smaller statements, otherwise it is called a Molecular Statement.
There are rules governing the set and Venn diagram is a great tool used to visualize and
represent operations on sets.
10
3. Using a Venn Diagram, determine if the representation A ∩ B¯ is equivalent to A \ B.
4. Using the sets W = {2, a, {u, v, w}, ∅}, X = {∅, a}, Y = {1, 2, 4} and Z = {2, 4, 8}.
Determine if the following statements are true, false or meaningless. State your reasons for
each.
i. wA ii. B A iii. D > C iv. {2, a} A
5. Find the cardinality of each set below (show cardinality check):
i. A = {23, 24, . . . , 37, 38}
ii. B = {1, {2, 3, 4}, 5, ∅}
iii. P(K L) K = {n ℕ : n ≤ 19} and L = { n ℕ : n is prime}
iv. P(C) C = {a, b, c, d}
6. Let A = {1, 2, 3}, B = {4, 5, 6, 7}. Find B × A.
7. If |A| = 5 and |B| = 8 and |A ∪ B| = 11 what is the size of A ∩ B?
8. If |Ac ∩ B| = 10 and |A ∩ Bc | = 8 and |A ∩ B| = 5 then how many elements are there is A ∪
B?
Bunday, BD and Mulholland, H. (2014). Pure Mathematics for Advanced Level. Second edition.
Published by Elsevier science. ISBN: 1483106136, 9781483106137
James, H. (2017). Discrete Structures, Logic and Computability. Published by Jones and
Bartlett. Fourth Edition. ISBN:978-284-07040-8.
Seymour, L. S. (1964). Outline Series: Theory and Problems of Set Theory and Related Topics,
pp. 1-133.
Stroud, KA. (2013) Engineering Mathematics. 7th edition. www.pdffiller.com/448950026--
ENGINEERING-MATHEMATICS-7TH-EDITION-by-KA-Stroud.
11
UNIT 2 PROOFS AND INDUCTION
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Basic Proof Techniques
3.2 Direct Proof
3.3 Proof by Induction
3.4 Indirect Proofs
3.4.1 Proof by Contrapositive
3.4.2 Proof by Contradiction
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Reading
1.0 Introduction
Mathematical Induction is an elegant and powerful technique that is used to prove certain types of
mathematical statements and propositions which assert that for all positive integers something is
true or that for all positive integers from some point on. There are many forms of mathematical
proofs. In this unit, we will introduce several basic types of proofs, with special emphasis on a
technique called induction that is invaluable to the study of discrete mathematics.
2.0 Objectives
12
Proof techniques can either be direct, indirect or by induction. The choice of a proof
technique depends on the problem or task at hand. Therefore, it is important to realize that
there is no single method applicable to solving all tasks. This implies that your level of
ingenuity, skills and implementation of common sense must be applied to every task. In
this Unit, we will discuss the direct, proof by induction and indirect proofs (proof by
contrapositive and proof by contradiction).
In order to prove a mathematical statement, we have to show that for a given premise, the
conclusion given can be derived. Considering any given task: such that we are given a
premise X, how do we show that a conclusion Y holds? One way to achieve this is by
giving a Direct Proof. In this form of proof, we start with a premise X, and directly deduce
the conclusion Y through a series of logical steps.
Example 3.2.1. Let n be an integer. If n is even, then n2 is even. If n is odd, then n2 is odd.
Solution 3.2.1
Firstly, prove that the proposition is true for n = 1. If the claim is that the proposition is
true for n ≥ a, first prove it for n = a.
13
Inductive step
Prove that if the proposition is true for n = k, then it must also be true for n = k + 1. This is
the difficult step and we will break it down into steps.
Step 1: Here we perform Inductive Hypothesis by writing down what the proposition
asserts for the case n = k.
Step 2: Now, write down what the proposition asserts for the case n = k + 1. Clearly
remember that this is what you have to prove.
Step 3: By using the assumption made in Step 1, try and prove the statement in Step 2.
Have in mind that this stage varies from problem to problem depending on the
mathematical contents, therefore, there is no single way to solve all problems. The main
aim here is to apply your skills and determine how you get from Step1 to Step2.
After the initial and inductive steps have been successfully performed, we then conclude
immediately that the proposition is true for all n ≥ 1.
1
Example 3.3.1. The sum of the first n positive integers is 2n(n + 1).
1 1
Now, for n = 1, 2n (n + 1) = 2× 1 × 2=1. So, the result is true for n = 1.
Inductive step:
1
1+2+3+ ··· + k = 2k(k + 1).
1 1
1+2+3+ ··· + (k + 1) = 2 (k + 1)[(k + 1) + 1] = 2 (k + 1)(k + 2).
The answer here is that we get the left-hand side of stage 2 from the left-hand side of stage
1 by adding (k + 1). So, 1+2+3+ ··· + (k + 1) = 1 + 2 + 3 + ··· + k + (k + 1)
14
1
= 2 k(k + 1) + (k + 1) using the inductive hypothesis
1
= (k + 1)( 2k + 1) factorising
1
= 2 (k + 1)(k + 2) which is what we wanted to prove.
This completes the inductive step. Hence, the result is true for all n ≥ 1.
Example 3.3.2. If a and b are consecutive integers, then the sum a + b is odd.
Solution 3.3.2
Proof. We have to define the propositional form F(x) to be true when the sum of x and its
successor is odd.
Step 1: Let’s consider the proposition F(1). The sum 1 + 2 = 3 is odd because we can
demonstrate there exists an integer k such that 2k + 1 = 3. That is, 2(1) + 1 = 3. Thus, F(x)
is true when x = 1.
Step 2: Assume that F(x) is true for some x. Thus, for some x we have that x + (x + 1) is
odd. We add one to both x and x + 1 which gives the sum (x+1) + (x+2). We can make
claim to two things: firstly, the sum (x+1) + (x+2) = F(x+1). Secondly, we claim that the
addition of two (2) to any integer does not change the evenness or oddness of that integer
(e.g., 1 + 2 = 3, 2 + 2 = 4). With these two observations we claim that F(x) is odd implies
F(x + 1) is odd.
Step 3: By the principle of mathematical induction, we thus claim that F(x) is odd for all
integers x. Thus, the sum of any two consecutive numbers is odd.
This proof starts by assuming that the conclusion Y is false, and through a series of logical
steps deduce that the premise X must also be false.
15
b. Assume ¬Q is true.
c. Show that ¬P must be true.
d. Observe that P → Q by contraposition
Solution 3.4.1.1
Proof by contrapositive: Suppose that n is not even. Then by solution 3.2.1, n2 is not even
as well. Yes, that all!
This form of proof assumes both that the premise X is true and the conclusion Y is false,
and reach a logical fallacy.
a. Assume P is true.
b. Assume ¬Q is true.
c. Demonstrate a contradiction.
Solution 3.4.2.1
Proof by contradiction: Suppose that n2 is even, but n is odd. Applying solution 3.2.1, we
see that n2 must be odd. But n2 cannot be both odd and even at the same time.
4.0 Conclusion
You have learnt from this unit that proof techniques can either be direct, indirect or by
induction. That the choice of a proof technique depends on the problem or task at hand.
You should note that there is no single method applicable to solving all tasks. This means
that your level of ingenuity, skills and implementation of common sense must be applied
to every task.
16
5.0 Summary
In this Unit, we have discussed the direct, indirect proofs, and proof by induction (proof by
contrapositive and proof by contradiction). We also performed Inductive Hypothesis and
applied necessary skills.
Bunday, BD and Mulholland, H. (2014). Pure Mathematics for Advanced Level. Second
edition. Published by Elsevier science. ISBN: 1483106136, 9781483106137
James, H. (2017). Discrete Structures, Logic and Computability. Published by Jones and
Bartlett. Fourth Edition. ISBN:978-284-07040-8.
Seymour, L. S. (1964). Outline Series: Theory and Problems of Set Theory and Related
Topics, pp. 1-133.
Stroud, KA. (2013) Engineering Mathematics. 7th edition. www.pdffiller.com/448950026--
ENGINEERING-MATHEMATICS-7TH-EDITION-by-KA-Stroud.
17
UNIT 3 LOGIC
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Proposition Logic
3.1.1 Logical Equivalence
3.1.2 De’ Morgan’s law
3.2 First Order Logic
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Reading
1.0 Introduction
Logic is a formal study of mathematics; it is the study of mathematic reasoning and proofs itself.
In this unit we cover some basic forms of logic. The propositional logic, where we will consider
the logical connectives such as “and”, “or”, and “not”. In the first-order logic, we will additionally
include tools to reason. It contains predicates, quantifiers and variables.
2.0 Objectives
By the end of this Unit, you will be able to:
• discuss some mathematical reasoning and proofs
• explain some basic forms of logic
• use logical connectives
• apply some tools to reason.
As stated earlier, propositional variables (also called sentential variables) which are the
letters found in the middle of the English alphabet represented in capital: P, Q, R, S, … to
18
represent each atomic statements in the molecular statement. These variables can only have
two values, true or false. The logical connectives: “and”, “or”, “if… then”, “if and only if
( or if)”, and “not” represented by these symbols , , →, ↔, and ¬ respectively. The
atomic statements: “It is raining” and “I need an umbrella” can be represented by the letters
P and Q respectively.
Solution 3.1.1. I solving such exercises, you will have to be careful as to knowing the exact
position of the ¬. Note that this statement is not ¬(P ∨ Q), the negation belongs only to P
(i.e. ¬P). Here is the truth table:
P Q ¬P ¬P ∨ Q
T T F T
T F F F
F T T T
F F T T
Example 3.1.2. Analyze the statement, “if you get more doubles than any other player you
will lose, or that if you lose you must have bought the most properties,” using truth tables.
Solution 3.1.2. Let’s start by breaking down the molecular statement into atomic
statements. Let P be the statement “you get more doubles than any other player,”; Q be the
statement “you will lose,” and R be the statement “you must have bought the most
properties.” Now let’s construct a truth table to represent the statement as this symbol
(P → Q) ∨ (Q → R).
19
The truth table needs to contain 8 rows in order to account for every possible combination
of truth and falsity among the three statements. Here is the full truth table:
P Q R (P → Q) (Q → R) (P → Q) ∨ (Q → R)
T T T T T T
T T F T F T
T F T F T T
T F F F T T
F T T T T T
F T F T F T
F F T T T T
F F F T T T
This is a true statement about monopoly, such that it is regardless of how many properties
you own, how many doubles you roll, or whether you win or lose, the outcome is true for
all 8 possible combinations.
Two molecular statements P and Q are logically equivalent provided P is true precisely
when Q is true. That is, P and Q have the same truth value under any assignment of truth
values to their individual atomic parts. Then we symbolize it as P ≡ Q. In order to verify
that two or more statements are logically equivalent, you may have to make a truth table
for each and check whether the columns for the statements are identical.
20
P Q ¬P ¬P ∨ Q P → Q
T T F T T
T F F F F
F T T T T
F F T T T
Since the statements ¬P ∨ Q and P → Q either both true or both false for whatever values
of P and Q. We therefore say these statements ¬P ∨ Q and P → Q are logically equivalent.
Exercise 3.1.4. Make a truth table to determine whether the statement ¬(P∨Q) is logically
equivalent to ¬P ∧ ¬Q.
Solution 3.1.4.
Try it yourself.
The solution to exercise 3.1.4 will show that both statements are logically equivalent. It
also shows that we can distribute a negation over a disjunction (“or”). Likewise, the
distribution of negation over a conjunction (“and”) is also possible.
De Morgan’s Laws
1. ¬(P ∧ Q) is logically equivalent to ¬P ∨ ¬Q
2. ¬(P ∨ Q) is logically equivalent to ¬P ∧ ¬Q
Example 3.1.5. Without using truth tables prove that the statements ¬(P → Q) and P ∧ ¬Q
are logically equivalent.
Solution 3.1.5. Let’s start with one of the statements, and transform it into the other through
a sequence of logically equivalent statements.
Start with ¬(P → Q).
We can rewrite the implication as a disjunction this is logically equivalent to
¬(¬P ∨ Q). (Solution 3.1.3 shows that P → Q is logically equivalent to ¬P ∨ Q)
21
By applying DE Morgan’s law we get
¬¬P ∧ ¬Q. (the double negation ¬¬P is logically equivalent to P)
Finally, use double negation to arrive at
P ∧ ¬Q.
Deduction Rule
An argument is valid provided the conclusion must be true given that the premises are true.
This means that for all times the premises are found to be true, the conclusion must be true
for the argument to be a valid deduction rule, else it is invalid.
P→Q
P
Example 3.1.6. Determine if the argument is a valid deduction rule.
Q
Our premises are P → Q and P. From the truth table we can see that row 1 where both of
the premises are true, our condition Q is also true. Therefore, if P → Q and P are both true,
we see that Q must be true as well. This implies that the argument is a valid deduction rule.
P→Q
¬P ∨ Q
Exercise 3.1.6. Decide whether is a valid deduction rule.
Q
Solution 3.1.6.
Try it yourself.
P→Q
Q→R
R
Example 3.1.7. Decide whether is a valid deduction rule.
P ∨ Q
Solution 3.1.7.
P Q R P→Q Q→R P∨Q
T T T T T T
T T F T F T
22
T F T F T T
T F F F T T
F T T T T T
F T F T F T
F F T T T F
F F F T T F
The premises P → Q, Q → R and R are all true in rows 1, 5, and 7. However, the
conclusion P ∨ Q is not always true when the premises are all true as seen in row 7. Hence
this is not a valid deduction rule.
23
statement about every single wall, one cannot make the general statement about all
walls.
ii. “When you take the vaccine, all the chances of contracting the disease dies.” In first
order logic, we can talk about all the bacteria without naming them explicitly.
4.0 Conclusion
With the overview of proposition logic and, given a few mathematical statements, we
were able to draw some conclusions that logic is the study of consequences. We were
also able to apply De Morgan’s law and logical equivalence.
5.0 Summary
At the end of this unit you have learnt some mathematical reasoning and proofs. Some
basic forms of logic were highlighted using logical connectives. There was some
applications of reasoning tools.
a. Translate the above statement into symbols. Clearly state which statement is P and
which is Q.
c. Assuming the statement is true, what (if anything) can you conclude if there will be
cake?
d. Assuming the statement is true, what (if anything) can you conclude if there will not
be cake?
e. Suppose you found out that the statement was a lie. What can you conclude?
3. Using a truth table, determine if the following statements are logically equivalent.
i. (P ∨ Q) → R and (P → R) ∨ (Q → R).
24
ii. (P Q) P, (P Q) and (P Q) (P Q) (P Q).
iii. “I will not eat or drink” and “I will not eat and I will not drink”. Hint: First translate to
statement into a logical expression.
4. Simplify the following statements (so that negation only appears right before variables).
a. ¬(P → ¬Q).
b. (¬P ∨ ¬Q) → ¬(¬Q ∧ R).
c. ¬((P → ¬Q) ∨ ¬(R ∧ ¬R)).
d. It is false that if Sam is not a man then Chris is a woman, and that Chris is not a
woman.
P→Q
Q→R
5. Show that is a valid deduction rule.
P → R
Bunday, B and Mulholland, H. (2014). Pure Mathematics for Advanced Level. Second edition.
Published by Elsevier science. ISBN: 1483106136, 9781483106137
Pass, R., & Tseng, W. L. D (2019). A Course in Discrete Structures. Wei-Lung Dustin Tseng, Site
Internet: www.freechbooks.com(2019)
Haggard, G., Schlipf J., Whitesides, S., (2006). Discrete Mathematics for Computer Science.
Thomson Brooks/Cole.
25
MODULE 2 BOOLEAN ALGEBRA AND GRAPH THEORY
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Lattice
3.2 Boolean Algebra
3.3 Self-study Questions
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Reading
1.0 Introduction
In this unit, you will acquire the skills to distinguish a partially ordered set, in which a pair
of elements has both a least upper bound and greatest lower bound. To achieve this, you
will learn from this unit, the types of relations and Boolean algebra.
2.0 Objectives
By the end of this unit, you will be able to:
• manipulate symbolic logic
• distinguish a partially ordered set
• explain operations that have logical significance.
3.0 Main Content
3.1 LATTICES
3.1.1 Partially Ordered Sets
We begin the study of lattices and Boolean algebras by generalizing the idea of inequality.
Recall that a relation on a set X is a subset of X×X. A relation P on X is called a partial
order of X if it satisfies the following axioms:
26
i. The relation is reflexive: (a, a) ∈ P for all a ∈ X.
ii. The relation is antisymmetric: if (a, b) ∈ P and (b, a) ∈ P, then a = b.
iii. The relation is transitive: if (a, b) ∈ P and (b, c) ∈ P, then (a, c) ∈ P.
We usually write a ≼ b to mean (a, b) ∈ P unless some symbol is naturally associated with
a particular partial order, such as a≼ b with integers a and b, or A ⊂ B with sets A and B. A
set X together with a partial order ≼ is called a partially ordered set, or poset.
A partially ordered set (L, ≼) is called a lattice if every pair of elements a and b in L has
both a Least Upper Bound (LUB) or Supremum and a Greatest Lower Bound (GLB)
or Infimum.
The least upper bound is also called the join of a and b, denoted by a ∨ b. The greatest
lower bound is called the meet of a and b, and is denoted by a ∧ b.
If (L, ≼) is a lattice and a, b, c, d ∈ L, then the meet and join have the following order
properties:
i. a ∧ b ≼ {a, b} ≼ a ∨ b,
ii. a ≼ b if and only if a ∧ b = a,
iii. a ≼ b if and only if a ∨ b = a,
iv. if a ≼ b, then a ∧ c ≼ b ∧ c and a ∨ c ≼ b ∨∧ c
v. if a ≼ b and c ≼ d, then a ∧ c ≼ b ∧ d and a ∨ c ≼ b ∨ d
Therefore, by the definitions of LUB and GLB, this implies that if the join and meet exist,
they are unique.
Example 3.1.1 The set of integers (or rationals or reals) is a poset where a ≤ b has the usual
meaning for two integers a and b in ℤ.
27
Example 3.1.2 Let X be any set. We will define the power set of X to be the set of all
subsets of X. We denote the power set of X by P(X). For example, let X = {a, b,
c}. Then P(X) is the set of all subsets of the set {a, b, c}:
∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}.
On any power set of a set X, set inclusion, ⊂, is a partial order. We can represent the order
on {a, b, c} schematically by a diagram such as the one in Figure 3.1.
Example 3.3 Let G be a group. The set of subgroups of G is a poset, where the partial order
is set inclusion.
Example 3.4 There can be more than one partial order on a particular set. We can form a
partial order on ℕ by a ≼ b if a | b. The relation is certainly reflexive since a | a for all a ∈
N. If m | n and n | m, then m = n; hence, the relation is also antisymmetric. The relation is
transitive, because if m | n and n | p, then m | p.
Example 3.5 Let X = {1, 2, 3, 4, 6, 8, 12, 24} be the set of divisors of 24 with the partial
order defined in Example 3.4. Figure 3.2 shows the partial order on X.
Example 3.6 Let Y = {2, 3, 4, 6} be contained in the set X of Example 3.5. Then Y has
upper bounds 12 and ,24, with 12 as a least upper bound. The only lower bound
is 1; hence, it must be a greatest lower bound.
28
Theorem 3.1 Let Y be a nonempty subset of a poset X. If Y has a least upper bound,
then Y has a unique least upper bound. If Y has a greatest lower bound, then Y has a unique
greatest lower bound.
Proof: It is possible to define binary operations on many posets by using the greatest lower
bound and the least upper bound of two elements. A lattice is a poset L such that every pair
of elements in L has a least upper bound and a greatest lower bound.
Example 3.7 Let X be a set. Then the power set of X, P(X), is a lattice. For two
sets A and B in P(X), the least upper bound of A and B is A ∪ B. Certainly A ∪ B is an
upper bound of A and B, since A ⊂ A ∪ B and B ⊂ A ∪ B. If C is some other set containing
both A and B, then C must contain A ∪ B; hence, A ∪ B is the least upper bound
of A and B. Similarly, the greatest lower bound of A and B is A ∩ B.
Axiom 3.1 Principle of Duality: Any statement that is true for all lattices remains true
when ≼ is replaced by ≽ and ∨ and ∧ are interchanged throughout the statement.
Theorem 3.2 If L is a lattice, then the binary operations ∨ and ∧ satisfy the following
properties for a, b, c ∈ L.
i. Commutative laws: a ∨ b = b ∨ a and a ∧ b = b ∧ a
ii. Associative laws: a ∨ (b ∨ c) = (a ∨ b) ∨ c and a ∧ (b ∧ c) = (a ∧ b) ∧ c.
iii. Idempotent laws: a ∨ a = a and a ∧ a = a.
iv. Absorption laws: a ∨ (a ∧ b) = a and a ∧ (a ∨ b) = a.
Proof
By the Principle of Duality, we need only prove the first statement in each part.
i. By definition a ∨ b is the least upper bound of {a, b}, and b ∨ a is the least upper bound
of {b, a}; however, {a, b} = {b, a}.
ii. We will show that a ∨ (b ∨ c) and (a ∨ b) ∨ c are both least upper bounds of {a, b, c}. Let d
= a ∨ b. Then c ≼ d ∨ c = (a ∨ b) ∨ c.
We also know that
a ≼ a ∨ b = d ≼ d ∨ c = (a ∨ b) ∨ c.
29
A similar argument demonstrates that b ≼ (a ∨ b) ∨ c. Therefore, (a ∨ b) ∨ c is an upper
bound of {a, b, c}. We now need to show that (a ∨ b) ∨ c is the least upper bound of {a, b,
c}. Let u be some other upper bound of {a, b, c}. Then a ≼ u and b ≼ u hence, d = a ∨ b ≼
u. Since c ≼ u, it follows that (a ∨ b) ∨ c = d ∨ c ≼ u. Therefore, (a ∨ b) ∨ c must be the
least upper bound of {a, b, c}. The argument that shows a ∨ (b ∨ c) is the least upper bound
of {a, b, c} is the same. Consequently, a ∨ (b ∨ c) = (a ∨ b) ∨ c.
iii. The join of a and a is the least upper bound of {a}; hence, a ∨ a = a.
iv. Let d = a ∧ b. Then a ≼ a ∨ d. On the other hand, d = a ∧ b ≼ a, and so a ∨ d ≼
a. Therefore, a ∨ (a ∧ b) = a.
Given any arbitrary set L with operations ∨ and ∧, satisfying the conditions of the previous
theorem, it is natural to ask whether or not this set comes from some lattice. The following
theorem says that this is always the case.
Theorem 3.3 Let L be a nonempty set with two binary operations ∨ and ∧ satisfying the
commutative, associative, idempotent, and absorption laws. We can define a partial order
on L by a ≼ b if a ∨ b = b. Furthermore, L is a lattice with respect to ≼ if for all a, b ∈ L, we
define the least upper bound and greatest lower bound of a and b by a ∨ b and a ∧
b, respectively.
Proof
Firstly, let’s show that L is a poset under ≼. Since a ∨ a = a, a ≼ a and ≼ is reflexive. To
show that ≼ is antisymmetric, let a ≼ b and b ≼ a. Then a ∨ b = b and b ∨ a = a. By the
commutative law, b = a ∨ b = b ∨ a = a. Finally, we must show that ≼ is transitive. Let a ≼
b and b ≼ c. Then a ∨ b = b and b ∨ c = c. Thus,
a ∨ c = a ∨ (b ∨ c) = (a ∨ b) ∨ c = b ∨ c = c,
or a ≼ c.
Now, to show that L is a lattice, we need to prove that a ∨ b and a ∧ b are, respectively, the
least upper and greatest lower bounds of a and b. Since a = (a ∨ b) ∧ a = a ∧ (a ∨ b), it
follows that a ≼ a ∨ b. Similarly, b ≼ a ∨ b. Therefore, a ∨ b is an upper bound for a and b.
Let u be any other upper bound of both a and b. Then a ≼ u and b ≼ u. But a ∨ b ≼ u since
(a ∨ b) ∨ u = a ∨ (b ∨ u) = a ∨ u = u.
30
Exercise 3.1: Prove that a ∧ b is the greatest lower bound of a and b.
A Boolean algebra is a lattice B with a greatest element I and a smallest element O such that B is
both distributive and complemented. The power set of X, P(X), is our prototype for a Boolean
algebra. As it turns out, it is also one of the most important Boolean algebras. The following
theorem allows us to characterize Boolean algebras in terms of the binary
relations ∨ and ∧ without mention of the fact that a Boolean algebra is a poset.
Theorem 3.5 A set B is a Boolean algebra if and only if there exist binary
operations ∨ and ∧ on B satisfying the following axioms.
i. a ∨ b = b ∨ a and a ∧ b = b ∧ a for a, b ∈ B.
ii. a ∨ (b ∨ c) = (a ∨ b) ∨ c and a ∧ (b ∧ c) = (a ∧ b) ∧ c for a, b, c ∈ B.
iii. a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c) and a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c) for a, b, c ∈ B.
iv. There exist elements I and O such that a ∨ O = a and a ∧ I = a for all a ∈ B.
v. For every a ∈ B there exists an a′ ∈ B such that a ∨ a′ = I and a ∧ a′ = O.
Proof
Let B be a set satisfying (i) – (v) in the theorem. One of the idempotent laws is satisfied since
a =a∨O
= a ∨ (a ∧ a′)
= (a ∨ a) ∧ (a ∨ a′)
= (a ∨ a) ∧ I
= a ∨ a.
Notice that
I ∨ b = (b ∨ b′) ∨ b = (b′ ∨ b) ∨ b = b′ ∨ (b ∨ b) = b′ ∨ b = I.
Consequently, the first of the two absorption laws holds, since
32
a ∨ (a ∧ b) = (a ∧ I) ∨ (a ∧ b)
= a ∧ (I ∨ b)
=a∧I
= a.
The other idempotent and absorption laws are proven similarly. Since B also satisfies (i)–(iii), the
conditions of Theorem 3.3 are met; therefore, B must be a lattice. Condition (iv) tells us that B is
a distributive lattice.
For, a ∈ B, O ∨ a = a; hence, O ≼ a and O is the smallest element in B. To show that I is the largest
element in B, we will first show that a ∨ b = b is equivalent to a ∧ b = a. Since a ∨ I = a for all a ∈
B, using the absorption laws we can determine that
a ∨ I = (a ∧ I) ∨ I = I ∨ (I ∧ a) = I or a ≼ I
for all a in B. Finally, since we know that B is complemented by (v), B must be a Boolean algebra.
Conversely, suppose that B is a Boolean algebra. Let I and O be the greatest and least elements
in B, respectively. If we define a ∨ b and a ∧ b as least upper and greatest lower bounds of {a,
b}, then B is a Boolean algebra by Theorem 3.3 and Theorem 3.4.
Some of these identities in Boolean algebras are listed in the following theorem.
Theorem 3.6 Let B be a Boolean algebra. Then,
i. a ∨ I = I and a ∧ O = O for all a ∈ B.
ii. If a ∨ b = a ∨ c and a ∧ b = a ∧ c for a, b, c ∈ B then, b = c.
iii. If a ∨ b = I and a ∧ b = O, then b = a′.
iv. (a′)′ = a for all a ∈ B.
v. I′ = O and O′ = I.
vi. (a ∨ b)′ = a′ ∧ b′ and (a ∧ b)′ = a′ ∨ b′ (De Morgan's Laws).
Proof
We will prove only (ii). The rest of the identities are left as your exercises.
For a ∨ b = a ∨ c and a ∧ b = a ∧ c, we have
b = b ∨ (b ∧ a)
= b ∨ (a ∧ b)
= b ∨ (a ∧ c)
33
= (b ∨ a) ∧ (b ∨ c)
= (a ∨ b) ∧ (b ∨ c)
= (a ∨ c) ∧ (b ∨ c)
= (c ∨ a) ∧ (c ∨ b)
= c ∨ (a ∧ b)
= c ∨ (a ∧ c)
= c ∨ (c ∧ a)
= c.
Lemma 3.1 Let B be a finite Boolean algebra. If b is an element of B with b ≠ O, then there is an
atom a in B such that a ≼ b.
Proof
If b is an atom, let a = b. Otherwise, choose an element b1, not equal to O or b, such that b1 ≼
b. We are guaranteed that this is possible since b is not an atom. If b1 is an atom, then we are done.
If not, choose, b2, not equal to O or b1, such that b2 ≼ b1. Again, if b2 is an atom, let a =
b2. Continuing this process, we can obtain a chain
O ≼ … ≼ b3 ≼ b2 ≼ b1 ≼ b.
34
Since B is a finite Boolean algebra, this chain must be finite. That is, for some k, bk is an atom.
Let a=bk.
Lemma 3.2 Let a and b be atoms in a finite Boolean algebra B such that a ≠ b. Then a ∧ b = O.
Proof
Since a ∧ b is the greatest lower bound of a and b, we know that a ∧ b ≼ a. Hence, either a ∧ b =
a or a ∧ b = O. However, if a ∧ b = a, then either a ≼ b or a = O. In either case we have a
contradiction because a and b are both atoms; therefore, a ∧ b = O.
Lemma 3.3 Let B be a Boolean algebra and a, b ∈ B. The following statements are equivalent.
i. a ≼ b,
ii. a ∧ b′ = O,
iii. a′ ∨ b = I.
Proof
(i) ⇒ (ii). If a ≼ b, then a ∨ b = b. Therefore,
a ∧ b′ = a ∧ (a ∨ b)′
= a ∧ (a′ ∧ b′)
= (a ∧ a′) ∧ b′
= O ∧ b′
= O.
(ii) ⇒ (iii). If a ∧ b′ = O, then a′ ∨ b = (a ∧ b′)′ = O′ = I.
(iii) ⇒ (i). If a′ ∨ b = I, then
a = a ∧ (a′ ∨ b)
= (a ∧ a′) ∨ (a ∧ b)
= O ∨ (a ∧ b)
= a ∧ b.
Thus, a ≼ b.
Lemma 3.4 Let B be a Boolean algebra and b and c be elements in B such that b ⋠ c. Then there
exists an atom a ∈ B such that a ⪯ b and a ⋠ c.
Proof
35
By Lemma 3.3, b ∧ c′ ≠ O. Hence, there exists an atom a such that a ≼ b ∧ c′. Consequently, a ≼
b and a ⋠ c.
Lemma 3.5 Let b ∈ B and a1,…,an be the atoms of B such that ai ⪯ b. Then b = a1 ∨⋯∨
an. Furthermore, if a, a1,…,an are atoms of B such that, a ≼ b, ai ≼ b, and b = a ∨ a1 ∨⋯∨ an, then a
= ai for some i = 1,…,n.
Proof
Let b1 = a1 ∨⋯∨ an. Since ai ≼ b for each i, we know that b1 ≼ b. If we can show that b ≼ b1, then
the lemma is true by antisymmetry. Assume b ≼ b1. Then there exists an atom a such that a ≼
b and a ⋠ b1. Since a is an atom and a ≼ b, we can deduce that a = ai for some ai. However, this is
impossible since a ≼ b1. Therefore, b ≼ b1.
Now suppose that b = a1∨⋯∨an. If a is an atom less than b,
a = a ∧ b = a ∧ (a1 ∨⋯∨ an) = (a ∧ a1) ∨⋯∨ (a ∧ an).
But each term is O or a with a ∧ ai occurring for only one .ai. Hence, by Lemma 3.2, a = ai for
some i.
Theorem 3.6 Let B be a finite Boolean algebra. Then there exists a set X such that B is isomorphic
to P(X).
Proof
We will show that B is isomorphic to P(X), where X is the set of atoms of B. Let a ∈ B. By Lemma
3.5, we can write a uniquely as a = a1 ∨⋯∨ an for a1, …, an ∈ X. Consequently, we can define a
map ϕ: B → P(X) by
ϕ(a) = ϕ(a1 ∨⋯∨ an) = {a1, …, an}.
Clearly, ϕ is onto.
Now let a = a1 ∨⋯∨ an and b = b1 ∨⋯∨ bm be elements in B, where each ai and each bi is an atom.
If ϕ(a) = ϕ(b), then {a1,⋯, an} = {b1,⋯,bm} and a = b.
Consequently, ϕ is injective.
The join of a and b is preserved by ϕ since
ϕ(a ∨ b) = ϕ(a1 ∨⋯∨ an ∨ b1 ∨⋯∨ bm)
= { a1,⋯, an, b1,⋯,bm}
= { a1,⋯, an} ∪ { b1,⋯,bm}
36
= ϕ(a1 ∨⋯∨ an) ∪ ϕ(b1 ∨⋯∨ bm)
= ϕ(a) ∪ ϕ(b).
Similarly, ϕ(a ∧ b) = ϕ(a) ∩ ϕ(b).
Study Questions
1. Describe succinctly what a poset is. Do not just list the defining properties, but give a
description that another student of algebra who has never seen a poset might understand. For
example, part of your answer might include what type of common algebraic topics a poset
generalizes, and your answer should be short on symbols.
2. How does a lattice differ from a poset? Answer this in the spirit of the previous question.
3. How does a Boolean algebra differ from a lattice? Again, answer this in the spirit of the
previous two questions.
4. Give two (perhaps related) reasons why any discussion of finite Boolean algebras might center
on the example of the power set of a finite set.
5. Describe a major innovation of the middle twentieth century made possible by Boolean
algebra.
4.0 Conclusion
In conclusion, the unit dwelt extensively on partially ordered sets, principle of duality and
Boolean algebra. A poset is short for partially ordered set which is a set whose elements
are ordered but not all pairs of elements are required to comparable in the order. A Boolean
algebra is a finite Boolean algebra if it contains a finite number of elements as a set. Finite
Boolean algebras are particularly nice since we can classify them up to isomorphism The
power set is a lattice that is ordered by inclusion.
5.0 Summary
In the unit you have learnt that:
• A relation P on X is called a partial order of X if it satisfies the axioms of
reflective, antisymmetric and transitive.
37
• lattices and Boolean algebras are generalizing by the idea of inequality
• A Boolean algebra is a finite Boolean algebra if it contains a finite number of
elements as a set.
• power set is a lattice that is ordered by inclusion.
• Finite Boolean algebras are particularly nice since we can classify them up to
isomorphism.
1. Draw the lattice diagram for the power set of X = {a, b, c, d} with the set inclusion
relation, ⊂.
2. Draw the diagram for the set of positive integers that are divisors of 30. Is this poset a
Boolean algebra?
3. Let B be the set of positive integers that are divisors of .210. Define an order on B by a ≼
b if a | b. Prove that B is a Boolean algebra. Find a set X such that B is isomorphic to P(X).
4. Prove or disprove: ℤ is a poset under the relation a ≼ b if a | b.
5. Draw the switching circuit for each of the following Boolean expressions.
i. (a ∨ b ∨ a′) ∧ a
ii. (a ∨ b)′ ∧ (a ∨ b)
iii. a ∨ (a ∧ b)
iv. (c ∨ a ∨ b) ∧ c′ ∧ (a ∨ b)′
6. Draw a circuit that will be closed exactly when only one of three switches a, b, and c are
closed.
7. Prove or disprove: The set of all nonzero integers is a lattice, where a ≼ b is defined by a |
b.
38
UNIT 2 GRAPH THEORY
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Graphs
3.1.1 Vertices and Edges
3.1.2 Directed Graph
3.1.3 Undirected Graph
3.1.4 Isomorphic Graphs
3.1.5 Subgraphs
3.1.6 Bipartite Graphs
3.1.7 Union and Intersection of a Graph
3.1.8 Complement of a Graph
3.2 The Handshaking Problem
3.3 Euler Paths and Circuits
3.4 Adjacency Matrices
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Reading
1.0 Introduction
Graphs are simple, however, they are extremely useful mathematical objects. They are universal
in the practical applications of Computer Science. For example:
i. In a computer network, we can use graphs to represent how computers are connected to each
other. We use the nodes to represent the individual computers and the edges to represent the
network connections. Such a graph can then be used to route messages as quickly as possible.
ii. In a digitalized map, nodes represent intersections (or cities), and edges represent roads (or
highways). We may use directed edges to capture one-way traffic on streets, and weighted
edges to capture distance. Such a graph can be used for generation directions (e.g., in GPS
units).
iii. On the internet, nodes represent web pages, and (directed) edges represent links from one web
page to another. Such a graph can be used to rank each web page in the order of importance
when displaying search results (e.g., the importance of a web page can be determined by the
39
amount of other web pages that are referencing it or pointing to it, and recursively how
important those web pages are).
iv. In a social network, nodes represent people, and edges represent friendships. One hot research
topic currently is the understanding social networks. For example, how does a network
achieve “x-degrees of separation”, where everyone is approximately x number of friendships
away from anyway else?
2.0 Objectives
By the end of this Unit, you will be able to:
• design complex network connections
• analyse traffic routes and determine the shortest path to any location
• discuss more on rating of web sites through referencing or site visits.
• Definition 3.1.2. A directed graph G is a pair (V, E) where V is a set of vertices (or
nodes), and E ⊆ V × V is a set of edges. The order of the two connected vertices is
important.
• Definition 3.1.3. An undirected graph additionally has the property that (u, v) ∈ E if
and only if (v, u) ∈ E.
Example 3.1.1.1 In a school social gathering, Abel, Bill, Clair, Dan, and Eve were assigned
to a group. In that group, all members are allowed to “discuss” with each other. However,
it turns out that the discussions were between Abel and Clair, Bill and Dan. While Eve
discussed with everyone. Represent this situation with a graph.
40
Solution 3.1.1.1 Each person will be represented by a vertex and each discussion will be
represented by an edge. That is, two vertices will be adjacent (there will be an edge between
them) if and only if the people represented by those vertices discussed.
A B
C D
E
From definition 3.1.1, a graph could be G = (V, E) = ({a, b, c, d}, {{a, b}, {a, c}, {b, c},
{b, d}, {c, d}}). This graph has four vertices (a, b, c, d) and five edges (the pairs {a, b},
{a, c}, {b, c}, {b, d}, {c, d}).
Exercise 3.1.1.2 Draw the graph ({a, b, c, d}, {{a, b}, {a, c}, {b, c}, {b, d}, {c, d}}).
In directed graphs, edge (u, v) (starting from node u, ending at node v) is not the same as
edge (v, u). We also allow “self-loops” or “recursive-loops”, i.e., edges of the form (v, v).
Since the edge (u, v) and (v, u) must both be present or missing, we often treat a non-self-
loop edge as an unordered set of two nodes (e.g., {u, v}). A common extension is a
weighted graph, where each edge additionally carries a weight (a real number). The weight
can have a variety of meanings in practice: distance, importance and capacity, to name a
few.
41
iii. Are the graphs below equal?
G1 = ({a, b, c}, {{a, b}, {b, c}}); G2 = ({a, b, c}, {{a, c}, {c, b}}).
Solution 3.1.1.3 (iii). No. Here the vertex sets of each graph are equal, which is a good
start. Also, both graphs have two edges. In the first graph, we have edges {a, b} and {b,
c}, while in the second graph we have edges {a, c} and {c, b}. Now we do have {b, c} =
{c, b}, so that is not the problem. The issue is that {a, b}, {a, c}. Since the edge sets of the
two graphs are not equal (as sets), the graphs are not equal (as graphs).
Solution 3.1.1.4 The two graphs are NOT equal. It is enough to notice that V1, V2 since a
∈ V1 but a ∉ V2. However, both of these graphs consist of three vertices with edges
connecting every pair of vertices. By drawing the graph as follows:
a u
E E
b c v w
E E E E
We can clearly see that these graphs are basically the same, so while they are not equal,
they will be isomorphic. This means the renaming of the vertices of one of the graphs and
results in the second graph.
42
Example 3.1.4.1 Decide whether the graphs G1 = {V1, E1} and G2 = {V2, E2} are equal
or isomorphic. V1 = {a, b, c, d}, E1 = {{a, b}, {a, c}, {a, d}, {c, d}} and V2 = {a, b, c, d},
E2 = {{a, b}, {a, c}, {b, c}, {c, d}}.
Solution 3.1.4.1 The graphs are NOT equal, since {a, d} ∈ E1 but {a, d} ∉ E2. However,
we can confirm that both graphs contain the exact same number of vertices and edges. By
this, they might be isomorphic (this is a good start but in most cases, it is not enough).
Let’s try to build an isomorphism. From the definition, let’s try to build a bijection f: V1 →
V2, such that f(a) = b, f(b) = c, f(c) = d and f(d) = a. This is a bijection, but to make sure
that the function is an isomorphism, we must make sure it respects the edge relation.
In G1, the vertices a and b are connected by an edge. In G2, f(a) = b and f(b) = c are
connected by an edge. We are on the right track, however, we have to check the other three
edges. The edge {a, c} in G1 corresponds to {f(a), f(c)} = {b, d}, now we have a problem
here. There is no edge between b and d in G2. Thus f is NOT an isomorphism.
If f is not an isomorphism, it does not mean that there is no isomorphism between G1 and
G2. Let’s draw the graphs and then try to create some match ups (if possible).
It is noticeable in G1 that the vertex a is adjacent to every other vertex. In G2, there is also
a vertex with such property and that is c. Therefore, we can build the bijection g: V1 → V2
by defining g(a) = c to start with. Next, which vertex should we match with b? In G1, the
vertex b is only adjacent to vertex a. There is exactly one vertex like this in G2, that is d.
Therefore, let g(b) = d. By looking at the last two, we can see that we are free to choose the
matches. Therefore, let go with g(c) = b and g(d) = a (switching these would still work fine).
Finally, let’s check that there is really is an isomorphism between G1 and G2 using g. We
have seen that g is definitely a bijection. Now we have to make sure that the edges are
respected. The four edges in G1 are
{a, b}, {a, c}, {a, d}, {c, d}.
Under the proposed isomorphism these become
{g(a), g(b)}, {g(a), g(c)}, {g(a), g(d)}, {g(c), g(d)}
The bijection results in the edges:
{c, d}, {c, b}, {c, a}, {b, a}.
These edges are precisely the edges in G2. Thus g is an isomorphism, hence G1 ≌ G2.
43
3.1.5 Subgraphs
3.1.5.1 Definition. We say that G′ = (V′, E′) is a subgraph of G = (V, E), and write G′ ⊆
G, provided V′ ⊆ V and E′ ⊆ E.
3.1.5.2 Definition. We say that G′ = (V′, E′) is an induced subgraph of G = (V, E) provided
V′ ⊆ V and every edge in E whose vertices are still in V′ is also an edge in E′.
Example 3.1.5. Considering the graph G1. Which of the graphs G2, G3 and G4 are
subgraphs or induced subgraphs of G1?
A graph is bipartite if the vertices can be divided into two sets, A and B, with no two
vertices in adjacent in A and B. The vertices in A can be adjacent to some or all of the
vertices in B. If each vertex in A is adjacent to all the vertices in B, then the graph is a
complete bipartite graph, and gets a special name: Km,n, where |A| = m and |B| = n.
44
Figure 3: Bipartition and complete bipartite graphs.
3.1.7 Union and Intersection of a Graph: These are two useful operations for combining
graphs. Let G1 = (V1, E1) and G2 = (V2, E2) be graphs.
i.The union of G1 and G2, denoted by G1 ⋃ G2, is the graph G3 defined as G3 = (V1 ⋃ V2,
E1 ⋃ E2).
ii.The intersection of G 1 and G2, denoted by G1 ∩ G2, is the graph G4 defined as G4 = (V1
∩ V2, EI ∩ E2).
3.1.8 Complement of a Graph: This operation that is used with a single graph. To define
this, we need an analogue of a universal set. In this case, we use the complete graph on the
vertex set of the graph for which we would like to find the complement. Let G = (V, E) be
a subgraph of K|V|, the complete graph on |V| vertices. The complement of G¯ in K|V|,
denoted as G = (V1, El), is the subgraph of K|V| with V1 = V and E1 = K|V| (E) - E.
45
3.2 The Handshaking Problem
Theorem 1. (Handshaking Theorem) Let G be a graph with at least two vertices. At least two
vertices of G have the same degree.
Proof. The proof is by induction on the number of vertices n in a graph. Let no = 2 and T = {n
∈ N: any graph with n vertices has at least two vertices of the same degree}.
(Base step) For no, the only graphs to consider are the graph consisting of two isolated vertices
and the graph having a single edge. Clearly, the result holds for each of these graphs. Therefore,
the base case no = 2 is true and no ∈ T.
(Inductive step) Let n ≥ no. Show that if n ∈ T, then n + 1 ∈ T.
Assuming that any graph on n vertices with n ≥ 2 has two vertices of the same degree, we must
prove that any graph on n + 1 vertices has two vertices of the same degree.
Let G = (V, E) be a graph with n + 1 vertices where n + 1 ≥ 3. Clearly, 0 ≤ deg(v) ≤ n for any
v ∈ V.
If there is an isolated vertex in G, then by the induction hypothesis, the subgraph of G
consisting of all the vertices but one isolated vertex must have two vertices with the same
degree. Adding an isolated vertex to the subgraph with at least two vertices having the same
degree gives the result for G.
If there is no isolated vertex in G, then all the degrees of vertices v ∈ V satisfy 1 ≤ deg(v) ≤ n.
In this case, we have at most n different values for the degrees of vertices in G. Since G has n
+ 1 vertices, then by the Pigeon-Hole Principle (see reference material for more explanation),
at least two vertices of G have the same degree.
Therefore, n + 1 ∈ T. By the Principle of Mathematical Induction, T = {n ∈ N: n ≥ 2}.
46
The handshake theorem is sometimes called the degree sum formula, and can be written
symbolically as
∑v∈V d(v) = 2e.
Here we are using the notation d(v) for the degree of the vertex v. One use for the theorem is
to actually find the number of edges in a graph. To do this, you must be given the degree
sequence for the graph (or be able to find it from other information). This is a list of every
degree of every vertex in the graph, generally written in non-increasing order.
Example 3.2.1. How many vertices and edges must a graph have if its degree sequence is (4,
4, 3, 3, 3, 2, 1)?
Solution 3.2.1. The number of vertices is easy to find: it is the number of degrees in the
sequence: 7. To find the number of edges, we compute the sum of the degrees:
4 + 4 + 3 + 3 + 3 + 2 + 1 = 20.
Therefore, the number of edges is half of 20 (20/2) = 10.
47
In summary, we can conclude the followings:
i. A graph has an Euler circuit if and only if the degree of every vertex is even.
ii. A graph has an Euler path if and only if there are at most two vertices with odd degree.
3.4 Adjacency Matrices
A graph can be represented in several different ways in a computer. It can be shown
diagrammatically when the number of vertices and edges are reasonably small. Though, graphs
can also be represented in the form of matrices. Thus, adjacency matrix is a square matrix used to
represent a finite graph in graph theory and computer science. The element of the matrix shows
whether pairs of vertices are adjacent or not in the graph. Also, directed and undirected graphs can
be represented using adjacency matrices. Let 𝐺 = (𝑉, 𝐸) be a graph with "𝑛" vertices, then the
𝑛 × 𝑛 matrix 𝐴, in which 𝑉 = {𝑣1 , 𝑣2 ,. . . , 𝑣𝑛 } is the vertex set, 𝐸 is the edge set, 𝑎𝑖𝑗 = 1 is the
number of edges between the vertices 𝑣𝑖 and 𝑣𝑗 (if there exists a path from 𝑣𝑖 to 𝑣𝑗 ) and 𝑎𝑖𝑗 = 0
otherwise is called adjacency matrix.
Example 3.4.1: The adjacency matrix 𝐴𝐺1 of the directed graph 𝐺1 is given in Figure 1.
4.0 Conclusion
Graphs are very simple and are extremely useful mathematical objects. They are universal
in the practical applications. They are made up of a collection of dots that are called vertices
and lines connecting those dots that are called edges. There are directed or undirected
graph.
5.0 Summary
In this unit, you have learnt that:
• Graphs useful mathematical objects
• You can use your knowledge on graph to design complex network connections
48
• Analyse traffic routes and determine the shortest path to any location
• Graphs are used on rating of web sites through referencing or site visits
• Two graphs are isomorphic if there is an isomorphism between them
• A graph is bipartite if the vertices can be divided into two sets
G2 = a c
b d
49
i. Any subgraph of a complete graph is also complete.
ii. Any induced subgraph of a complete graph is also complete.
iii. Any subgraph of a bipartite graph is bipartite.
5.
i. Which of the graphs below have Euler paths or Euler circuits?
ii. List the degrees of each vertex of the graphs 5 i above. Is there a connection between
degrees and the existence of Euler paths and circuits?
iii. Is it possible for a graph with a degree 1 vertex to have an Euler circuit? If so, draw
one. If not, explain why not. What about an Euler path?
iv. What if every vertex of the graph has degree 2? Is there an Euler path or an Euler
circuit? Draw some graphs.
50
MODULE 3 MATRICES, APPLICATIONS TO COUNTING AND DISCRETE
PROBABILITY
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Matrix
3.1.1 Types of Matrices
3.1.2 Main or Principal Diagonal
3.1.3 Particular cases of a square matrix
3.1.4 Operations on Matrices
3.2 Determinants
3.2.1 Minor and Cofactor of Element
3.3 Special Matrices
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Reading
1.0 Introduction
In many analysis, variables are assumed to be related by sets of linear equations. Matrix
algebra provides a clear and concise notation for the formulation and solution of such
problems, many of which would be complicated in conventional algebraic notation. The
concept of determinant is based on that of matrix.
2.0 Objectives
By the end of this Unit, you will be able to:
• compactly write and work with multiple linear equations
• discuss the concept of matrices
51
• explain how to perform some simple operations addition, subtraction,
multiplication, determinant and transpose
• explain how to find the inverse of a matrix
• explain the business application aspect of matrices.
3.0 Main Content
3.1 MATRIX
Definition 3.1.1. A matrix is a rectangular array of numbers. A matrix with m rows and n
columns is said to have dimension m × n.
Definition 3.1.2. A set of mn numbers (real or complex), arranged in a rectangular
formation (array or table) having m rows and n columns and enclosed by a square bracket
[ ] is called m × n matrix (read “m by n matrix”) .
A matrix may be represented as follows
𝑎11 𝑎12 … 𝑎1𝑛
𝑎21 𝑎22 … 𝑎2𝑛
𝐴= [ … … … ]
𝑎𝑚1 𝑎𝑚2 … 𝑎𝑚𝑛
The letters aij stand for real numbers. Note that aij is the element in the ith row and jth
column of the matrix. Thus, the matrix A is sometimes denoted by simplified form as (aij)
or by {aij} i.e., A = (aij). Matrices are usually denoted by capital letters A, B, C etc. and its
elements by corresponding small letters a, b, c etc.
Order of a Matrix: The order or dimension of a matrix is the ordered pair having
as first component the number of rows and as second component the number of
columns in the matrix. If there are 3 rows and 2 columns in a matrix, then its order
is written as (3 × 2) or (3, 2) which is read as three by two. In general, if m are rows
and n are columns of a matrix, then its order is (m × n).
Example 3.1.1.
1
3 1 4 2 6
A=[ ], B = [ 3 ] and C = [ ].
0 2 2 1 3
4
52
Definition 3.1.3. Matrices A and B are equal, A = B, if A and B have the same
dimensions and each entry of A is equal to the corresponding entry of B.
53
1. Diagonal matrix: A square matrix in which all elements are zero except
those in the main or principal diagonal is called a diagonal matrix. Some elements
of the principal diagonal may be zero but not all.
1 00
1 0
For example, [ 0 1 0 ] and [ ] are diagonal matrices.
0 2
0 01
𝑎11 𝑎12 ⋯ 𝑎1𝑛
In general, 𝐴 = [ ⋮ ⋱ ⋮ ] = (𝑎𝑖𝑗 )𝑛𝑥𝑛
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛
is a diagonal matrix if and only if
aij = 0 for i ≠ j, and
aij ≠ 0 for at least one i = j
2. Scalar Matrix
A diagonal matrix in which all the diagonal elements are same, is called a scalar
matrix i.e.
𝑘00
1 0
Thus, [ ] and [0 𝑘 0] are scalar matrices.
0 2
00𝑘
54
4. Equal Matrices
Two matrices A and B are said to be equal if and only if they have the same order
and each element of matrix A is equal to the corresponding element of matrix B.
this implies that for each i, j, aij = bij.
4
2 1 2−1
Thus, 𝐼2 = [ ] and 𝐼3 = [ 2 ]
3 0 √9 0
Then A = B because the order of matrices A and B is same and aij = bij for every i,
j.
Example 3.1.1. Find the values of x, y, z and a which satisfy the matrix equation
𝑥+3 2𝑦 + 𝑥 0 −7
[ ]= [ ]
𝑧−1 4𝑎 − 6 3 2𝑎
Solution 3.1.1. By the definition of equality of matrices, we have:
x + 3 = 0 ……………………………(1)
2y + x = -7 ………………………….(2)
z – 1 = 3 …………………………….(3)
4a – 6 = 2a ………………………….(4)
i.From (1) x = -3,
ii.Put the value of x in (2), we get y = -2,
iii.From (3) z = 4,
iv.From (4) a = 3
55
3.1.4. Operations on Matrices
1. Multiplication of a Matrix by a Scalar: If A is a matrix and k is a scalar
(constant), then kA is a matrix whose elements are the elements of A, each
multiplied by k.
1 2 3
For example, if , 𝐴 = [2 4 6] then for a scalar k,
3 6 9
𝑘 2𝑘 3𝑘
k𝐴 = [2𝑘 4𝑘 6𝑘]
3𝑘 6𝑘 9𝑘
1 2 3
𝐴 = [2 4 6]
3 6 9
1 2 3 3 6 9
3𝐴 = 3 [2 4 6] = [6 12 16]
3 6 9 9 18 27
Similarly, the difference A – B of the two matrices A and B is a matrix each element
of which is obtained by subtracting the elements of B from the corresponding
elements of A.
2 − 1 9 − ( 5) 1 14
Then, D = A - B = [ ]=[ ]
5−3 6−2 3 8
A + B = B + A and (A + B) + C = A + (B + C)
56
i.e., the addition of matrices is commutative and associative respectively.
Note: The sum or difference of two matrices of different order is not defined. For
example, the sum or difference of a matrices with orders (3 2) and (2 2) is not
defined.
Thus the product of the matrices Amxp and Bpxn is the matrix (AB)mxn. The elements
of AB are determined as follows:
The element Cij in the ith row and jth column of (AB)mxn is found by
57
iii.A matrix A can be multiplied by itself if and only if it is a square matrix. The product A A,
in such cases is written as A2. Similarly, we may define higher powers of a square matrix i.e.,
A A2 = A3, A2 A2 = A4.
iv.In the product AB, A is said to be pre multiple of B and B is said to be post multiple of A.
1 2 2 1
Example 3.1.2. If 𝐴 = [ ]and 𝐵 = [ ], find AB and BA.
1 3 1 1
Solution 3.1.2.
1 2 2 1
𝐴𝐵 = [ ][ ]
1 3 1 1
1.2 + 2.1 1.1 + 2.1
=[ ]
1.2 + 3.1 1.1 + 3.1
4 3
=[ ]
1 2
2 1 1 2
𝐵𝐴 = [ ][ ]
1 1 1 3
2.1 + 1. 1 2.2 + 1.3
=[ ]
1.1 + 1. 1 1.2 + 1.3
2−1 4+3
=[ ]
1−1 2+3
1 7
=[ ]
0 5
Exercise 3.1.2 clearly shows that multiplication of matrices in general, is not commutative
i.e., AB BA.
1 1
3 1 2
Example 3.1.3. If 𝐴 = [ ] and 𝐵 = [ 2 1 ], find AB
1 0 1
3 1
Solution 3.1.3. Since A is a (2 3) matrix and B is a (3 2) matrix, they are conformable
for multiplication. We have
1 1
3 1 2
𝐴𝐵 = [ ][ 2 1 ]
1 0 1
3 1
3.1 + 1.2 + 2.3 3. 1 + 1.1 + 2.1
=[ ]
1.1 + 0.2 + 1.3 1. 1 + 0.1 + 1.1
3+3+6 3+1+2
= [ ]
1+0+3 1+0+1
11 0
= [ ]
4 0
58
Remarks:
If A, B and C are the matrices of order (m p), (p q) and (q n) respectively, then,
i. Associative law: (AB)C = A(BC).
ii. Distributive law: C (A + B) = CA + CB and (A + B) C = AC + BC.
3.2 Determinant
The determinant of a matrix is a scalar (number), obtained from the elements of a matrix by
specified, operations, which is characteristic of the matrix. The determinants are defined
only for square matrices. Determinant is denoted by det (A) or |A| for a square matrix A.
𝑎11 𝑎12
Determinant of a 2 2 matrix: Given the matrix 𝐴 = [𝑎 ], then
21 𝑎22
𝑎 𝑎
|𝐴| = |𝑎11 𝑎12 |
21 22
1 2
Example 3.2.1. If 𝐴 = [ ], find |A|.
1 3
Solution 3.2.1.
1 2
|𝐴| = | | = |1.3 − ( 1.2)| = |3 + 2| = 5
1 3
= 𝑎11 (𝑎22 𝑎33 −𝑎32 𝑎23) − 𝑎12 (𝑎21 𝑎33 − 𝑎31 𝑎23 ) + 𝑎13 (𝑎21 𝑎32 − 𝑎31 𝑎22 )
These determinants are called minors. We take the sign + or − , according to ( − 1)i+j aij
Where i and j represent row and column.
59
The minor Mij of the element aij in a given determinant is the determinant of order (n – 1
n – 1) obtained by deleting the ith row and jth column of Anxn. For example, in the
determinant
𝑎11 𝑎12 𝑎13
|𝐴| = | 𝑎21 𝑎22 𝑎23 |
𝑎31 𝑎32 𝑎33 ………………………….. (1)
𝑎22 𝑎23
i.The minor of the element a11 is M11 = |𝑎 𝑎33 |
32
𝑎21 𝑎23
ii.The minor of the element a12 is M12 = | 𝑎 𝑎33 |
31
𝑎21 𝑎22
iii.The minor of the element a13 is M13 = |𝑎 𝑎32 | and so on.
31
i+j
The scalars Cij = (-1) Mij are called the cofactor of the element aij of the matrix A.
The value of the determinant in equation (1) can also be found by its minor elements or
cofactors, as
a11M11 – a12M12 + a13M13
Or
a11C11 + a12C12 + a13C13.
Hence, the |A| is the sum of the elements of any row or column multiplied by their
corresponding cofactors. The value of the determinant can be found by expanding it from
any row or column.
3 2 1
Example 3.2.3. If 𝐴 = [ 0 1 2 ]find |A| by expansion about (a) the first row (b) the first
1 3 4
column. Solution 3.2.3. (a) Using the first row
3 2 1
|𝐴| = | 0 1 2 |
1 3 4
1 2 0 2 0 1
= 3| | − 2| | + 1| |
3 4 1 4 1 3
= 3(1.4 – (-2).3) -2(0.4 – 1. -2) +1(0.3 – 1.1)
= 3(4+6) -2(0+2) +1(0-1)
= 30 – 4 – 1
= 25
Solution 3.2.3. (b) Using the first column
60
3 2 1
|𝐴| = | 0 1 2 |
1 3 4
1 2 2 1 2 1
= 3| | − 0| | + 1| |
3 4 3 4 1 2
= 3(1.4 – (-2).3) - 0(2.4 – 3.1) +1(2.-2 – 1.1)
= 3(4+6) - 0(8 - 2) +1(-4 - 1)
= 30 – 0 – 5
= 25
3.3. Special Matrices
1. Transpose of a Matrix
If A = [aij] is m n matrix, then the matrix of order n m obtained by interchanging the
rows and columns of A is called the transpose of A. It is denoted At or A. For example,
3 2 1 3 0 1
𝑡
if 𝐴 = [ 0 1 2 ] then, 𝐴 = [ 2 1 3 ]
1 3 4 1 2 4
2. Symmetric Matrix
A square matrix A is called symmetric if A = At. For example,
0 41 0 41
𝑡
if 𝐶 = [ 4 0 3 ] then, 𝐶 = [ 4 0 3 ] = 𝐶
1 3 0 1 3 0
3. Skew Symmetric
A square matrix A is called skew symmetric if A = −At. For example,
0 41
If 𝐶 = [ 4 0 3 ] then,
1 3 0
0 4 1 0 41
𝑡
𝐶 = [ 4 0 3 ] = ( 1) [ 4 0 3 ]
1 3 0 1 3 0
Ct = −C. Thus matrix C is skew symmetric.
61
1 3
𝐴= [ ] then,
1 3
|𝐴| = | 1 3| = |1.3 − (1.3)| = |3 − 3| = 0
1 3
Then, |A| = 0, Hence A is singular.
5. Adjoint of a Matrix
Let A = (aij) be a square matrix of order n n and (cij) is a matrix obtained by replacing
each element aij by its corresponding cofactor cij then (cij)t is called the adjoint of A. It is
written as Adj (A).
1 0 −1
Example 3.1.4. If 𝐴 = [ 1 3 1 ], find the cofactor matrix of A
0 1 2
Solution 3.1.4. The cofactors of A are:
3 1 1 1 1 3
C11 = (−1)1+1 | | = 5; C12 = (−1)1+2 | | = -2; C13 = (−1)1+3 | | =1
1 2 0 2 0 1
0 −1 1 −1 1 0
C21 = (−1)2+1 | | = -1; C22 = (−1)2+2 | | = 2; C23 = (−1)2+3 | | = -1
1 2 0 2 0 1
0 −1 1 −1 1 0
C31 = (−1)3+1 | | = 3; C32 = (−1)3+2 | | = -2; C33= (−1)3+3 | |=3
3 1 1 1 1 3
62
6. Inverse of a Matrix
𝑎𝑑𝑗 (𝐴)
If A is a non-singular square matrix then, 𝐴−1 = |𝐴|
22 Matrix
1 2
Example 3.1.5. If 𝐴 = [ ], find A-1.
1 3
Solution 3.1.5.
7 3 1 3 1 0
𝐵𝐴 = [ ][ ]=[ ]
2 1 2 7 0 1
0 2 3
Example 3.1.7. If 𝐴 = [ 1 3 3 ]
1 2 2
Solution 3.1.7.
|A| = 0 +2 (–2 +3) – 3(–2 + 3) = 2 – 3
|A| = –1, Hence solution exists.
Cofactor of A are:
C11 = 0; C12 = −1; C13 = 1
C21 = 2 ; C22 = -3; C23 = 2
63
C31 = 3; C32 = -3; C33 = 2
The matrix of cofactors of A is:
0 1 1
𝐶 = [2 3 2]
3 3 2
The transpose of C is:
0 2 1
𝐶 𝑡 = [−1 3 3] = 𝐴𝑑𝑗 (𝐴)
1 2 2
So,
−1
1 1 0 2 1
𝐴 = 𝑎𝑑𝑗 (𝐴) = [ 1 3 3]
|𝐴| −1
1 2 2
0 2 1
= [1 3 3]
1 2 2
64
If B 0, then (1) is called non-homogenous system of linear equations and if B = 0, it is
called a system of homogenous linear equations.
If now B 0 and A is non-singular then A-1 exists.
Multiply both sides of AX = B on the left by A-1, we get
A-1(AX) = A-1B
(A-1A) X = A-1B
1X = A-1B
Or X = A-1B
Where A-1B is an n 1 column matrix. Since X and A-1B are equal, each element in X is
equal to the corresponding element in A-1B. These elements of X constitute the solution of
the given linear equations.
If A is a singular matrix, then of course it has no inverse, and either the system has no
solution or the solution is not unique.
Example 3.1.8. Use matrices to find the solution set of
x + y – 2z = 3
3x – y + z = 5
3x + 3y – 6z = 9
Solution 3.1.8.
1 1 2
𝐴 = [3 1 1]
3 3 6
|A| = 3 + 21 – 24 = 0
Since |A| = 0, the solution of the given linear equations does not exist.
Example 3.1.9. Use matrices to find the solution set of
4x + 8y + z = –6
2x – 3y + 2z = 0
x + 7y – 3z = –8
Solution 3.1.9.
4 8 1
𝐴 = [2 3 2]
1 7 3
|A| = –32 + 48 + 17 = 61
Since |A| 0 then, A-1 exists.
65
1 1 5 31 19
𝐴−1 = 𝑎𝑑𝑗 (𝐴) = [ 8 13 16 ]
|𝐴| 61
17 20 28
Now since,
X = A-1B, we have
𝑥 1 5 31 19 6
[𝑦] = [ 8 13 16 ] [ 0 ]
𝑧 61
17 20 28 8
1 30 + 152 2
= [ 48 + 48 ] [ 0 ]
61
102 + 224 2
Hence solution set: {(x, y, z)} = {( 2, 0, 2)}.
4.0 Conclusion
A matrix is a rectangular array of numbers with m rows and n columns. Matrix algebra
provides a clear and concise notation for the formulation and solution of some problems.
There are different types of matrices: row, column, null, square, diagonal, upper triangular,
lower triangular, symmetric and antisymmetric matrix. Different operations are carried out
on matrices which include: addition, subtraction, multiplication, determinant and inverse.
5.0 Summary
In this unit, you are have learnt how to write and work with multiple linear equations.
• Understand the concept of matrices
• Know how to perform some simple operations addition, subtraction, multiplication,
determinant and transpose
• Know how to find the inverse of a matrix
66
a. (A + B)(A + B) A2 + 2AB + B2
b. (A + B)(A – B) A2 – B2
3. Write each product as a single matrix
2 1
3 1 1
a. [ ] [0 2]
0 1 2
1 1
2
b. [3 1 2] [ 2 ]
1
3 1 1 2 1 1
c. [ 0 1 2] [ 0 2 1 ]
1 2 1 1 1 1
1 2 3 1
4. If 𝐴 = [ ], 𝐵 = [ 3 0 ] and = [ ], find
1 1 1 2 1 1
a. CB + A2
b. B2 + AC
c. kABC, where k = 2.
5. Find K such that the following matrices are singular
K 6
a. [ ]
4 3
1 2 −1
b. [−3 4 K ]
−4 2 6
1 1 −2
c. [ 3 − 1 1 ]
K 3 −6
6. Find the solution set of the following system by means of matrices:
a. 2x – 3y = –1
x + 4y = 5
b. x+y=2
2x – z = 1
2y – 3z = –1
c. x – 2y + z = –1
3x + y – 2z = 4
y–z=1
d. –4x + 2y – 9z = 2
3x + 4y + z = 5
x – 3y + 2z = 8
67
e. x + y – 2z = 3
3x – y + z = 0
3x + 3y – 6z = 8
68
UNIT 2 APPLICATIONS TO COUNTING
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 The Product and Sum Rules
3.2 Permutations and Combinations
3.3 Combinatorial Identities
3.3.1 Using Pascal’s triangle to expand a binomial expression
3.4 Inclusion-Exclusion Principle
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Reading
1.0 Introduction
Counting is a basic mathematical tool that has uses in many diverse circumstances. How
much RAM can a 32-bit register address? How many poker hands form full houses
compared to flushes? How many ways can ten-coin tosses end up with four heads? To
count, we can always take the time to enumerate all the possibilities; but even just
enumerating all poker hands is already daunting, let alone all 32-bit addresses. This unit
discusses some techniques that serve as useful shortcuts for counting.
2.0 Objectives
By the end of this unit, you will be able to:
• apply product and sum rules
• discuss permutation and combination
• use Pascal’s triangle to expand a binomial expression
• identify and apply inclusion-exclusion and pigeonhole principle.
69
The product and sum rules represent the most intuitive notions of counting. Suppose there
are n(A) ways to perform task A, and regardless of how task A is performed, there are n(B)
ways to perform task B.
Then, there are n(A) n(B) ways to perform both task A and task B; this is the product
rule. This can generalize to multiple tasks, e.g., n(A) n(B) n(C) ways to perform task
A, B, and C, as long as the independence condition holds, e.g., the number of ways to
perform task C does not depend on how task A and B are done.
Example 3.1.1. On an 8 × 8 chess board, how many ways can I place a pawn and a rook?
Example 3.1.1. 1. First I can place the pawn anywhere on the board; there are 64 ways.
Then I can place the rook anywhere except where the pawn is; there are 63 ways. In total,
there are 64 × 63 = 4032 ways.
Example 3.1.2. On an 8 × 8 chess board, how many ways can I place a pawn and a rook
so that the rook does not threaten the pawn?
Solution 3.1.2. Firstly, I can place the rook anywhere on the board; there are 64 ways. At
the point, the rook takes up on square, and threatens 14 others (7 in its row and 7 in its
column). Therefore, I can then place the pawn on any of the 64 − 14 − 1 = 49 remaining
squares. In total, there are 64 × 49 = 3136 ways.
Example 3.1.3. If a finite set A has n elements, then |P(A)| = 2n.
Solution 3.1.3. We can proof this by using the product rule. P(A) is the set of all subsets
of A. To form a subset of A, each of the n elements can either be in the subset or not (2
ways). Therefore, there are 2n possible ways to form unique subsets, therefore, |P(A)| = 2n.
Example 3.1.4. How many legal configurations are there in the towers of Hanoi?
Solution 3.1.4. Each of the n rings can be on one of three poles, giving us 3n configurations.
Normally we would also need to count the height of a ring relative to other rings on the
same pole, but in the case of the towers of Hanoi, the rings sharing the same pole must be
ordered in a unique fashion: from small at the top to large at the bottom.
The sum rule is probably even more intuitive than the product rule. Suppose there are n(A)
ways to perform task A, and distinct from these, there are n(B) ways to perform task B.
Then, there are n(A) + n(B) ways to perform task A or task B. This can generalize to
multiple tasks, e.g., n(A) + n(B) + n(C) ways to perform task A, B, or C, as long as the
70
distinct condition holds, e.g., the ways to perform task C are different from the ways to
perform task A or B.
Example 3.1.5. To fly from Lagos to Brisbane you must fly through Istanbul or Dubai.
Solution 3.1.5. There are 5 such flights a day through Istanbul, and 3 such flights a day
through Dubai. How many different flights are there in a day that can take you from Lagos
to get to Brisbane? The answer is 5 + 3 = 8.
What is P(n, r)? To form an r-permutation from a set A of n elements, we can start by
choosing any element of A to be the first in our permutation; there are n possibilities. The
next element in the permutation can be any element of A except the one that is already
71
taken; there are n−1 possibilities. Continuing the argument, the final element of the
permutation will have n − (r − 1) possibilities. Applying the product-rule, we have:
n!
Theorem 3.2.1. P(n, r) = n(n − 1)(n − 2) · · · (n − r + 1) = (n − r)!
… … … … … . (1)
Note that 0! = 1.
Example 3.2.1.1. How many one-to-one functions are there from a set A with m elements
to a set B with n elements?
Solution 3.2.1.1. If m > n we know there are no such one-to-one functions. If m ≤ n, then
each one-to-one function f from A to B is a m-permutation of the elements of B: we choose
m elements from B in an ordered manner (e.g., first chosen element is the value of f on the
first element in A). Therefore there are P(n, m) such functions.
3.2.2. Combinations
Proof. Let us express P(n, r) in turns of C(n, r). It must be that P(n, r) = C(n, r)P(r, r),
because to select an r-permutation from n elements, we can first selected an unordered set
72
of r elements, and then select an ordering of the r elements. Rearranging the expression
gives:
P(n,r) n!⁄(n−r)! n!
C(n, r) = = = (n − r)!r!
P(r,r) r!
Example 3.2.2.1. How many poker hands (i.e., sets of 5 cards) can be dealt from a standard
deck of 52 cards?
Solution 3.2.2.1. Exactly C(52, 5) = 52!/(47!5!).
Example 3.2.2.2. How many full houses (3 of a kind and 2 of another) can be dealt from a
standard deck of 52 cards?
Solution 3.2.2.2. We have 13 denominations (ace to king), and 4 suites (spades, hearts,
diamonds and clubs). To count the number of full houses, we may
i. First pick a denomination for the “3 of a kind”: there are 13 choices.
ii. Pick 3 cards from this denomination (out of 4 suites): there are C(4, 3) = 4 choices.
iii. Next pick a denomination for the “2 of a kind”: there are 12 choices left (different
from the “3 of a kind”).
iv. Pick 2 cards from this denomination: there are C(4, 2) = 6 choices.
So in total there are 13 ∗ 4 ∗ 12 ∗ 6 = 3744 possible full houses.
3.3 Combinatorial Identities
There are many identities involving combinations. These identities are fun to learn because
they often represent different ways of counting the same thing; 66 counting one can also
prove these identities by churning out the algebra, but that is boring. We start with a few
simple identities.
73
Lemma 3.2. (Pascal’s Identity). If 0 < k ≤ n, then C(n + 1, k) = C(n, k − 1) + C(n, k).
Proof. Here is another way to choose k elements from n + 1 total element. Either the n + 1st
element is chosen or not:
i. If it is, then it remains to choose k−1 elements from the first n elements.
ii. If it isn’t, then we need to choose all k elements from the first n elements.
By the sum rule, we have C(n + 1, k) = C(n, k − 1) + C(n, k).
Pascal’s identity, along with the initial conditions C(n, 0) = C(n, n) = 1, gives a recursive
way of computing the binomial coefficients C(n, k). The recursion table is often written as
a triangle, called Pascal’s Triangle; as shown in Figure 3.1.
Figure 3.1. Pascal’s triangle contains the binomial coefficients C(n, k) ordered as shown in
the figure. Each entry in the figure is the sum of the two entries on top of it (except the
entries on the side which are always 1).
74
n
k=0
Proof. If we manually expand (x + y)n, we would get 2n terms with coefficient 1 (each term
corresponds to choosing x or y from each of the n factors). If we then collect these terms,
how many of them have the form xn−k yk? Terms of that form must chooses n−k many x’s,
and k many y’s. Because just choosing the k many y’s specifies the rest to be x’s, there are
C(n, k) such terms.
If we substitute specific values for x and y, the binomial theorem gives us more
combinatorial identities as corollaries.
Proof. Simply write 2n = (1+1)n and expand using the binomial theorem.
If we want to expand (a + b)3 we select the coefficients from the row of the triangle
beginning 1,3: these are 1,3,3,1. We can immediately write down the expansion by
remembering that for each new term we decrease the power of a, this time starting with 3,
and increase the power of b. So,
(a + b) 3 = a3 + 3a2b + 3ab2 + b3
Thinking of (a + b)3 as
= a3 + 3a2b + 3ab2 + b3
we note that the term 3ab2, for example, arises from the two terms ab2 and 2ab2 ; again this
is the link with the way 3 is generated in Pascal’s triangle - by adding the 1 and 2 in the
previous row.
76
Solution 3.3.2. To find this we use the row beginning 1,4, and can immediately write down
the expansion. (a + b)4 = a4 + 4a3b + 6a2b2 + 4ab3 + b4.
Solution 3.3.3. We pick the coefficients in the expansion from the relevant row of Pascal’s
triangle: (1,3,3,1). As we move through the terms in the expansion from left to right we
remember to decrease the power of 2x and increase the power of y. So,
Solution 3.3.4. We pick the coefficients in the expansion from the row of Pascal’s triangle
(1,3,3,1). Powers of 2 x increase as we move left to right. Any power of 1 is still 1.
2 3 2 2 2 2 3
(1 + ) = 1(1)3 + 3(1)2 ( ) + 3(1)1 ( ) +1 ( )
𝑥 𝑥 𝑥 𝑥
6 12 8
=1+ + 2 + 3
𝑥 𝑥 𝑥
77
of the ways to perform A and B are the same (|X ∩ Y |), they have been counted twice, so
we need to subtract those.
Example 3.4.1. How many positive integers ≤ 100 are multiples of either 2 or 5?
Solution 3.4.1. Let A be the set of multiples of 2 and B be the set of multiples of 5. Then
|A| = 50, |B| = 20, and |A ∩ B| = 10 (since this is the number of multiples of 10). By the
inclusion-exclusion principle, we have 50 + 20 − 10 = 60 multiples of either 2 or 5.
What if there are more tasks? For three sets, we can still gleam from the Venn diagram that
|X ∪ Y ∪ Z| = |X| + |Y | + |Z| − |X ∩ Y | − |X ∩ Z| − |Y ∩ Z| + |X ∩ Y ∩ Z|
More generally,
𝑛 𝑛
|⋃ 𝐴𝑖 | = ∑(−1)𝑘+1 ∑ |⋂ 𝐴𝑖 | = ∑ (−1)𝑘+1 |⋂ 𝐴𝑖 |
𝑖=1 𝑘=1 𝐼,𝐼⊆{1,…,𝑛},|𝐼|=𝑘 𝑖∈𝐼 𝐼⊆{1,…,𝑛} 𝑖∈𝐼
Proof. Consider some x ∈ ⋃iAi. We need to show that it gets counted exactly one in the
RHS. Suppose that x is contained in exactly m of the starting sets (A1 to An), 1 ≤ m ≤ n.
Then for each k ≤ m, x appears in C(m, k) many k-way intersections (that is, if we look at
|∩i∈I Ai| for all |I| = k, x appears in C(m, k) many terms). Therefore, the number of times
x gets counted by the inclusion-exclusion formula is exactly
∑(−1)𝑘+1 𝐶(𝑚, 𝑘)
𝑘=1
78
people, at least two people must have the same birthday (since there are a total of 366
possible birthdays). More generally, we have
Lemma 3.4. (Pigeonhole Principle). If we place n (or more) pigeons into k pigeon holes,
then at least one box contains ⌈n/k⌉ or more pigeons.
Proof. Assume the contrary that every pigeon hole contains ≤ ⌈n/k⌉ −1 < n/k many pigeons.
Then the total number of pigeons among the pigeon holes would be strictly less than
k(n/k) = n, a contradiction.
Example 3.5.1. In a group of 800 people, how many people are likely to share the same
birthday?
Solution 3.5.1. There are at least ⌈800/366⌉ = 3 people with the same birthday.
4.0 Conclusion
Specially, you have learned about counting. You have also learned how to carry out
counting using some special techniques and principles.
5.0 Summary
In this unit, you have learnt how to use Pascal’s triangle to expand a binominal expression.
You have also been taught how to identify and apply inclusion-exclusion and pigeonhole
principle.
6.0 Tutor-Marked Assignment
1. How many positive divisors does 2000 = 2453 have?
2. Six friends Adam, Brian, Chris, Dan, Elvis and Frank want to go see a movie. If there
are only six seats available, how many ways can we seat these friends
3. Expand the following:
a. (1 + p)4
b. (3a − 2b)5
3 4
c. (1 + 𝑎)
1 6
d. (𝑥 − 𝑥)
4. Find the minimum number of students in a class such that three of them are born in the
same month.
79
5. Show that from any three integers, one can always choose two, so that a 3b – ab3 is
divisible by 10.
7.0 References/Further Reading
Asimow, L and Maxwell, M (2010). Probability and Statistics with Applications. A
problem solving text. ACTEX publications Inc. Winsted, Conecticut. ISBN:
978-1-56698-721-9
Coolman, R. (2015). Properties of Pascal’s triangle. Published 17 June 2015.
Fraleigh, J. B. (1982). A First Course in Abstract Algebra, 3rd ed., Addison-Wesley.
Gallian, J. A. (1998. Contemporary Abstract Algebra, 4th edition, Houghton-Mifflin.
Kiltinen, J.O. (2004). Parity Theorem for Permutations - Convergence (December 2004)
80
UNIT 3 DISCRETE PROBABILITY GENERATING FUNCTION
CONTENTS
1.0 Introduction
2.0 Objectives
3.0 Main Content
3.1 Common Sums
3.2 Probability Generating Function
3.3 Using the PGF to calculate the mean and variance
3.4 Using the PGF to calculate the probabilities
3.5 Geometric Random Variables
3.6 Binomial Distribution
4.0 Conclusion
5.0 Summary
6.0 Tutor-Marked Assignment
7.0 References/Further Reading
1.0 Introduction
Discrete probability generating functions are important and useful tools for dealing with
sums and limits of random variables. The exact strength of Probability Generating
Function (PGF), is that, it gives an easy way of characterizing the distribution of 𝐴 + 𝐵
when 𝐴 and 𝐵 are independent. To find the distribution of a sum using the common
probability function we know is quite difficult, hence, the use of PGF which transform a
sum into a product makes it much easier to handle. The PGF gives us details of
everything we need to know about the distribution.
2.0 Objectives
By the end of this unit, you will be able to:
• obtain the sum of Geometric, Binomial and Exponential series
• define Probability Generating Functions (PGFs) and use it to calculate the mean,
variance and probability
• identify and calculate the PGF for Geometric, Binomial and Exponential
distributions.
3.0 Main Content
3.1 Common Sums
3.1.1 Geometric Series
81
1
1 + 𝑧 + 𝑧 2 + 𝑧 3 + 𝑧 4 +. . . = ∑∞ 𝑥
𝑥=0 𝑧 = , when |𝑧| < 1.
1−𝑧
= 𝒑 ∑∞
𝑥=0(1 − 𝑝)
𝑥
𝑝
= (𝑏𝑒𝑐𝑎𝑢𝑠𝑒 |1 − 𝑝| < 1)
1−(1−𝑝)
The Binomial Theorem proves that ∑𝑛𝑥=0 𝑃(𝑋 = 𝑥) = 1 when 𝑋 ~ Binomial(𝑛, 𝑝):
𝑛
𝑃(𝑋 = 𝑥) = ( ) 𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 𝑓𝑜𝑟 𝑥 = 0, 1, 2, 3, . . . , 𝑛,
𝑥
𝑛 𝑛
𝑛
∴ ∑ 𝑃(𝑋 = 𝑥) = ∑ ( ) 𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 = [𝑝 + (1 − 𝑝)]𝑛 = 1𝑛 = 1
𝑥
𝑥=0 𝑥=0
𝜆𝑥
𝑃(𝑋 = 𝑥) = 𝑒 −𝜆 𝑓𝑜𝑟 𝑥 = 0, 1, 2, 3, ⋯,
𝑥!
𝜆𝑥 𝜆𝑥
∴ ∑∞ ∞
𝑥=0 𝑃(𝑋 = 𝑥) = ∑𝑥=0 𝑥! 𝑒
−𝜆
= 𝑒 −𝜆 ∑∞ −𝜆 𝜆
𝑥=0 𝑥! = 𝑒 𝑒 = 1
1 𝑛
But we know that 𝑒 𝜆 = lim (1 + ) 𝑓𝑜𝑟 𝜆 ∈ ℝ.
𝑛→∞ 𝑛
82
𝐺𝑋 (𝑧) = 𝑝0 + 𝑝1 𝑧 + 𝑝2 𝑧 2 + . . . = ∑∞ 𝑗 𝑋
𝑗=0 𝑝𝑗 𝑧 = 𝔼(𝑧 ), 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑧 ∈ ℝ for which the
sum converges. Therefore, to calculate the probability generating function, we that
𝐺𝑋 (𝑧) = 𝔼(𝑧 𝑋 ) = ∑∞ 𝑥
𝑥=0 𝑧 𝑃(𝑋 = 𝑥).
Example 3.2.2: Let 𝑋 have a binomial distribution function with parameters 𝑛 𝑎𝑛𝑑 𝑝 (or
𝑛
𝑋 ~ 𝐵(𝑛, 𝑝), so 𝑃(𝑋 = 𝑥) = ( ) 𝑝 𝑥 𝑞 𝑛−𝑥 for 𝑥 = 0, 1, 2 , 3, . . . , 𝑛. The probability
𝑥
generating function is given by
𝑛 ∞
𝑛 𝑛
𝐺𝑋 (𝑧) = ∑ 𝑧 ( ) 𝑝 𝑥 𝑞 𝑛−𝑥 = ∑ ( ) (𝑝𝑧)𝑥 𝑞 𝑛−𝑥
𝑥
𝑥 𝑥
𝑥=0 𝑥=0
Example 3.2.4: Let 𝑋 have a Poisson distribution function with parameter 𝜆 (or
𝜆𝑥
𝑋 ~ 𝑃(𝜆), so 𝑃(𝑋 = 𝑥) = 𝑒 −𝜆 for 𝑥 = 0, 1, 2 , 3, . .. . The probability generating
𝑥!
function is given by
∞ ∞
𝑥
𝜆𝑥 −𝜆 −𝜆
(𝜆𝑧)𝑥
𝐺𝑋 (𝑧) = ∑𝑧 𝑒 = 𝑒 ∑ = 𝑒 −𝜆 𝑒 (𝜆𝑧) = 𝑒 𝜆(𝑧−1)
𝑥! 𝑥!
𝑥=0 𝑥=0
3.3 Using the PGF to calculate the mean (expectation) and variance
83
Here, we will use the PGF to calculate the moments of the distribution of 𝑋. The
moments of a distribution include the mean, variance, etc.
Hence, 𝐺 ′𝑋 (𝑧) = ∑∞
𝑥=0 𝑥 𝑃(𝑋 = 𝑥) 𝑧
𝑥−1
= ∑∞
𝑥=1 𝑥 𝑃(𝑋 = 𝑥)𝑧
𝑥−1
.
Also, the second moment is
𝐸[𝑋 2 ] = 𝐺 ′′𝑋 (1) + 𝐺 ′𝑋 (1)
But we know that, 𝐺 ′𝑋 (𝑧) = ∑∞
𝑥=1 𝑥 𝑃(𝑋 = 𝑥) 𝑧
𝑥−1
, then
∞ ∞
3.3.2 Variance
Similarly, let 𝑋 be a random variable with PGF 𝐺𝑋 (𝑧). Then, the variance is given by
𝑉𝑎𝑟[𝑋] = 𝐸[𝑋 2 ] − 𝐸[𝑋]2 = 𝐺 ′′𝑋 (1) + 𝐺 ′𝑋 (1) + 𝐺 ′𝑋 (1)2 .
Example 3.3.3: Let 𝑋 have a Poisson distribution function with parameter 𝜆. The PGF of
𝑋 is 𝐺𝑋 (𝑧) = 𝑒 𝜆(𝑧−1) . Find (i) Mean, 𝐸[𝑋] (ii) Variance, 𝑉𝑎𝑟[𝑋].
84
𝑉𝑎𝑟[𝑋] = 𝐺 ′′𝑋 (1) + 𝐺 ′𝑋 (1) + 𝐺 ′𝑋 (1)2 = 0 + 𝑝 − 𝑝2 = 𝑝(1 − 𝑝).
𝑗=0
85
2 3
∴ 𝐺𝑋 (𝑧) = 𝑧 + 𝑧3 ⟹ 𝐺𝑋 (0) = 𝑃(𝑋 = 0) = 0.
5 5
2 9 2
𝐺 ′𝑋 (𝑧) = + 𝑧2 ⟹ 𝐺 ′𝑋 (0) = 𝑃(𝑋 = 1) =
5 5 5
18 1
𝐺 ′′𝑋 (𝑧) = 𝑧 ⟹ 𝐺 ′′𝑋 (0) = 𝑃(𝑋 = 2) = 0.
5 2!
18 1 3
𝐺 ′′′𝑋 (𝑧) = ⟹ 𝐺 ′′′𝑋 (0) = 𝑃(𝑋 = 3) =
5 3! 5
1
𝐺 (𝑘)𝑋 (𝑧) = 0, 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑘 ≥ 4 ⟹ 𝐺 (𝑘)𝑋 (0) = 𝑃(𝑋 = 𝑘) = 0 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑘 ≥ 4
𝑘!
2
1 𝑤𝑖𝑡ℎ 𝑝𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑦 5
Therefore, the distribution of 𝑋, 𝑖𝑠 𝑋 = { 3
3 𝑤𝑖𝑡ℎ 𝑝𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑦 5
and
2(1 − 𝑃) 1 1 1−𝑝
𝑉𝑎𝑟[𝑋] = 𝐺 ′′𝑋 (1) + 𝐺 ′𝑋 (1) + 𝐺 ′𝑋 (1)2 = 2
+ + 2 =
𝑃 𝑝 𝑝 𝑝2
3.6 Binomial Distribution
Let 𝑋 have a binomial distribution function with parameters 𝑛 𝑎𝑛𝑑 𝑝. Then, the PGF is
𝑛
𝑛
𝐺𝑋 (𝑧) = ((1 − 𝑝) + 𝑝𝑧) = ∑ ( 𝑗 ) (1 − 𝑝)𝑛−𝑗 𝑝 𝑗 𝑧 𝑗 .
𝑛
𝑗=0
𝑛−1
⟹ 𝐺 ′𝑋 (𝑧) = 𝑛𝑝((1 − 𝑝) + 𝑝𝑧) 𝑎𝑛𝑑 𝐸[𝑋] = 𝐺 ′𝑋 (1) = 𝑛𝑝.
𝑛−2
⟹ 𝐺 ′′𝑋 (𝑧) = 𝑛(𝑛 − 1)𝑝2 ((1 − 𝑝) + 𝑝𝑧)
86
−𝑛𝑝2 + 𝑛𝑝 = 𝑛𝑝(1 − 𝑝).
4.0 Conclusion
PGFs are very useful tool for dealing with sums of random variables, which are difficult
to tackle using the standard probability function.
5.0 Summary
In this unit, you have learnt how to
• Compute the sums Geometric, Binomial and Exponential series.
• Know the properties of PGF.
• Use PGF TO calculate the mean, variance and probability.
• Identify and calculate the PGF for Geometric and Binomial distributions.
1 + x + x2
e. (Hint: multiplication).
(1 − x) 2
2. Show how you can get the generating function for the triangular numbers in three different
ways:
a. Take two derivatives of the generating function for 1, 1, 1, 1, 1, . . .
b. Multiply two known generating functions.
3. Find a generating function for the sequence with recurrence relation an = 3an−1 − an−2 with
initial terms a0 = 1 and a1 = 5.
4. Starting with the generating function for 1, 2, 3, 4, . . ., find a generating function for each
of the following sequences.
a. 1, 0, 2, 0, 3, 0, 4, . . ..
b. 1, −2, 3, −4, 5, −6, . . ..
c. 0, 3, 6, 9, 12, 15, 18, . . ..
d. 0, 3, 9, 18, 30, 45, 63, . . .. (Hint: relate this sequence to the previous one.)
87
𝑤
5. Let 𝑋 be a discrete random variable with PGF 𝐺𝑋 (𝑧) = (2 + 5𝑤 3 ). Calculate the
3
distribution of 𝑋.
88