0% found this document useful (0 votes)
45 views

Discrete Structures

This document provides an overview and guidelines for CIT 206 Discrete Structures course. The course aims to introduce students to basic concepts in discrete mathematics including sets, logic, functions, matrices, and graph theory. It is made up of 3 modules and 8 units covering topics such as set theory, proofs, Boolean algebra, graphs, and matrices. Students will learn through study units and be assessed through tutor-marked assignments and a final exam. The course aims to help students develop problem solving skills in discrete structures applicable to computer science.

Uploaded by

Fire lace
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Discrete Structures

This document provides an overview and guidelines for CIT 206 Discrete Structures course. The course aims to introduce students to basic concepts in discrete mathematics including sets, logic, functions, matrices, and graph theory. It is made up of 3 modules and 8 units covering topics such as set theory, proofs, Boolean algebra, graphs, and matrices. Students will learn through study units and be assessed through tutor-marked assignments and a final exam. The course aims to help students develop problem solving skills in discrete structures applicable to computer science.

Uploaded by

Fire lace
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 99

COURSE

GUIDE

CIT 206
DISCRETE STRUCTURES

Course Team

Theophilus Aniemeka Enem, PhD (Course Writer) –


Air Force Institute of Technology

NATIONAL OPEN UNIVERSITY OF NIGERIA


© 2022 by NOUN Press
National Open University of Nigeria
Headquarters
University Village
Plot 91, Cadastral Zone Nnamdi Azikiwe Expressway
Jabi, Abuja

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.

What You Will Learn in This Course


The overall aims and objectives of this course is to provide guidance on what you should be
achieving in the course of your studies. Each unit also has its own unit objectives which state
specifically what you should be achieving in the corresponding unit. To evaluate you progress
continuously, you are expected to refer to the overall course aims and objectives as well as the
corresponding unit objectives upon completion of each.

Course Aims

The overall aims and objectives of this course will help you to:

1. Develop your knowledge and understanding of the basic concepts of sets

2. Build your capacity to evaluate logic and induction techniques

3. Develop your competence in sets operations

4. Build up your knowledge on graph to design complex network connections

iv
Course Objectives

Upon completion of the course, you should be able to:

1. Prove basic set equalities;

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;

4. Demonstrate an understanding of relations and functions and be able to determine their


properties;

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;

6. Demonstrate different traversal methods for trees and graphs;

7. Discriminate between a Eulerian graph from a Hamiltonian graph for use in solving
mathematical problems;

8. Model problems in Computer Science using graphs and trees;

9. Apply counting principles to determine probabilities.

Working through This Course

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:

Module 1: Introduction to Discrete Structures

Unit 1: Set Theory


Unit 2: Proofs and Induction
Unit 3: Logic

Module 2: Boolean Algebra and Graph Theory

Unit 1: Boolean Algebra and Lattices


Unit 2: Graph Theory

Module 3: Matrices, Applications to Counting and Discrete Probability

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:

1. Introduction to Discrete Structures


2. Boolean Algebra and Graph Theory
3. Matrices, Applications to Counting and Discrete Probability

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

• THEORY AND PROBLEMS OF DISCRETE MATHEMATICS- Seymour Lipschutz., 3rd


Edition, Marc Lars Lipson. Schaum’s Outline Series, McGraw-Hill. DOI:
10.1036/0071470387
• DISCRETE MATHEMATICS – An Open Introduction 3rd Edition, Oscar Levin, 2019.
ISBN: 978-1792901690
• DISCRETE MATHEMATICS AND ITS APPLICATION, Kenneth H. Rosen, Tata
McGraw-Hill Editions, 2003
• INTRODUCTION TO GRAPH THEORY – Richard J. Trudean, Dover publisher, Inc New
York, 2013. ISBN: 13: 978-0-486-67870-2
• A TEXT BOOK OF GRAPH THEORY – Balakrishnan, R and Ranganathan, K, 2012.
Department of Mathematics, University of Tiruchirappalli India. ISBN: 2191-6675
(electronic)
• PURE MATHEMATICS FOR ADVANCED LEVEL - Bunday, BD and Mulholland, H.
(2014). Second edition. Published by Elsevier science. ISBN: 1483106136, 9781483106137
• DISCRETE STRUCTURES, LOGIC AND COMPUTABILITY. James, H. (2017). Published
by Jones and Bartlett. Fourth Edition. ISBN:978-284-07040-8.
• A COURSE IN DISCRETE STRUCTURES - Pass, R., & Tseng, W. L. D (2019). Wei-Lung
Dustin Tseng, Site Internet: www.freechbooks.com(2019)
• DISCRETE MATHEMATICS FOR COMPUTER SCIENCE - Haggard, G., Schlipf J.,
Whitesides, S., (2006). Thomson Brooks/Cole.

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.

Course Marking Scheme


This table shows how the actual course marking is broken down:
Assessment Marks
Assignment 1-4 Four assignments, best three marks of the four count at 30% of course
marks
Final Examination 70% of overall course marks
Total 100% of course marks

How to get the Most from the Course


In distance learning, the study units replace the university lecturer. This is one of the great
advantages of distance learning; you can read and work through specially designed study materials,
at your own pace, and at a time and place that suit you best. Think of it as reading the lecture
instead of listening to a lecturer. In the same way that a lecturer might set you some reading to do,
the study units tell you when to read your set books or other material. Just as a lecturer might give
you an in-class exercise, your study units provides exercises for you to do at appropriate points.
Each of the study units follows a common format. The first item is an introduction to the subject
matter of the unit, and how a particular unit is integrated with the other units and the course as a
whole. Next is a set of learning objectives. These objectives enable you know what you should be
able to do by the time you have completed the unit. You should use these objectives to guide your
study. When you have finished the units, you must go back and check whether you have achieved
the objectives, in order to significantly improve your chances of passing the course.
Remember that your tutor’s job is to assist you. When you need help, don’t hesitate to call and ask
your tutor to provide it.

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

Module 1: Introduction to Discrete Structures

Unit 1: Sets……….………………………………………………....…. 1
Unit 2: Proofs and Induction ….…………………………………......... 12
Unit 3: Logic …….………………………………………………......... 18

Module 2: Boolean Algebra and Graph Theory

Unit 1: Boolean Algebra and Lattices …………………………………. 26


Unit 2: Graph Theory ………………………………………………...... 39

Module 3: Matrices, Applications to Counting and Discrete Probability

Unit 1: Matrices and Determinants……………………………………… 51


Unit 2: Applications to Counting ………………………………………. 69
Unit 3: Discrete Probability Generating Function ……………………... 81

xi
MODULE 1 INTRODUCTION TO DISCRETE STRUCTURES
Unit 1: Set Theory
Unit 2: Proofs and Induction
Unit 3: Logic

UNIT 1: SET THEORY

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.

3.0 Main Content


3.1 Introduction to Mathematical Statements
We will take a few examples of mathematical statements to illustrate what a proper
communication in mathematics is all about.
3.1.1 Statement Definitions
A declarative sentence which is either true or false is called a statement. A statement is
said to be an Atomic Statement if it cannot be divided into smaller statements, otherwise
it is called a Molecular Statement.
Example 3.1.1.1
These statements are examples of atomic statements:
• Mobile numbers in Nigeria have 11 digits.
• 5 is larger than 7.
• 12 is a perfect square.
• Every even number greater than 2 can be expressed as the sum of two primes.
However, these are not statements:
• Would you like some ice cream?
• The product of two numbers.
• 1 + 3 + 5 + 7 + · · · + 2n + 1.
• Go to the lecture room!
• 4 + x = 12
The sentence “4 + x = 12” is not a statement because it contains an unknown variable, x.
Depending on the value of x, the sentence is either true or false, however, right now it is
neither true nor false. We can also build a complicated (molecular) sentence by
combining more than one or more simple atomic or molecular sentences by using Logical
Connectives. An example of a molecular stamen is:
Mobile numbers in Nigeria have 11 digits and 5 is larger than 7.

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.1.2 Logical Connectives


• P ∧ Q is read as “P and Q,” and it is called a conjunction.
• P ∨ Q is read as “P or Q,” and it is called a disjunction.
• P → Q is read as “if P then Q,” and it is called an implication or conditional.
• P ↔ Q is read as “P if and only if Q,” and it is called a bi-conditional.
• ¬P is read as “not P,” and it is called a negation.
The truth value of a statement is determined by the truth value(s) of its part(s), depending
on the connectives:
Truth Conditions for Connectives.

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.

3.2.3 Operations on Sets


∪: A ∪ B is the union of A and B: is the set containing all elements which are elements
of A or B or both.
If A is {1, 2, 4, 5}, B is {2, 3, 4}. Then A ∪ B = {1, 2, 3, 4, 5}

∩: 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}.

Ac or A̅: The complement of A is the set of everything which is not an element of A.


Let the universal set, U be {1, 2, . . . , 9, 10}, A = {2, 3, 4}. Then Ac = {1, 5, 6, …,
9, 10}.

|A|: The cardinality (or size) of A is the number of elements in A.


|{1, 2, 3}| = |{a, b, c}| = |{1,{1, 2}, 5}| = |{1, 2, ∅}| = 3.

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.

3.2.4 Rules of Set Theory


Let P, Q and R be sets.
i. Commutative Law: (P ∪ Q) = (Q ∪ P) and (P ∩ Q) = (Q ∩ P).
ii. Associative Law: (P ∪ (Q ∪ R)) = ((P ∪ Q) ∪ R) and (P ∩ (Q ∩ R)) = ((P ∩ Q) ∩ R).
iii. Distributive Law: (P ∪ (Q ∩ R)) = (P ∪ Q) ∩ (P ∪ R) and (P ∩ (Q ∪ R)) = (P ∩ Q) ∪
(P ∩ R).
iv. De Morgan’s Law: (P ∪ Q)C = (Pc ∩ Qc ) and (P ∩ Q)C = (Pc ∪ Qc)

Some special sets we will consider in this unit:


•∅ The empty set that contains no element (also denoted as { }).
•U The universe set is the set of all elements
•ℕ {0, 1, 2, 3, . . . }, the non-negative integers
• ℕ+ {1, 2, 3, . . . }, the positive integers
•ℤ {. . . −2, −1, 0, 1, 2 . . . }, the integers
•ℚ {q | q = a/b, a, b ∈ ℤ, b 6= 0}, the rational numbers
• ℚ+ {q | q ∈ Q, q > 0}, the positive rational
•ℝ The real numbers

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.

3.2.7 Venn Diagrams


A Venn Diagram is a great tool used to visualize and represent operations on sets. It is used
to display sets as intersecting circles. We can highlight a region under consideration when
we carry out an operation. The cardinality of a set can be represented by putting numbers
in the corresponding area.

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.

6.0 Tutor-Marked Assignments


1. Describe each of the following sets both in words and by listing out enough elements to see
the pattern.
a. {x : x + 2 ∈ ℕ}.
b. {x : x + 2 ∈ ℕ+}.
c. {x ∈ ℕ : x + 2 ∈ ℕ}.
d. {x : x ∈ ℕ ∨ −x ∈ ℕ}.
e. {x : x ∈ ℕ ∧ −x ∈ ℕ}.
2. Let A = {7, 1, 2, 3, 6}, B = {2, 3, 4}, C = {1, 6, 7} and D = {5, 8, 4, 9} be subsets of U = {n
ℕ : 1 ≤ n ≤10}.
a. Find the following;
i. A ⋃ C ii. (A ⋂ Dc) ⋃ (A ⋂ B)c iii. ∅ ⋃ B iv. (A ⋃ B)c
b. Represent the sets in 2a above by the use of a Venn Diagram.

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. wA 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?

7.0 References/Further Reading

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

By the end of this unit, you will be able to:

• explain the basic types of proofs


• prove certain mathematical statement
• mention types of induction techniques.

3.0 Main Content

3.1 Basic Proof Techniques

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).

3.2 Direct Proof (Proof by Construction)

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.

The two steps to directly prove that X → Y is true.

a. Demonstrate that Y must follow from X.

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

Using direct proof: For an integer k;

If n is even, then n = 2k, and

n2 = (2k)2 = 4k2 = 2 (2k2), which is even.

If n is odd, then n = 2k + 1, and

n2 = (2k + 1)2 = 4k2 + 4k + 1 = 2 (2k2+ 2k) + 1, which is odd.

3.3 Proof by Induction

The initial step

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).

Initial step: If n = 1, the sum is simply 1.

1 1
Now, for n = 1, 2n (n + 1) = 2× 1 × 2=1. So, the result is true for n = 1.

Inductive step:

Stage 1: Our assumption (the inductive hypothesis) asserts that

1
1+2+3+ ··· + k = 2k(k + 1).

Stage 2: We want to prove that

1 1
1+2+3+ ··· + (k + 1) = 2 (k + 1)[(k + 1) + 1] = 2 (k + 1)(k + 2).

Stage 3: How can we get to stage 2 from stage 1?

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.

3.4 Indirect Proofs

3.4.1 Proof by Contrapositive

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.

Based on first-order logic we can make a statement such as P → Q is equivalent to ¬Q →


¬P. Steps to proving a theorem by contrapositive:

15
b. Assume ¬Q is true.
c. Show that ¬P must be true.
d. Observe that P → Q by contraposition

Example 3.4.1.1 Let n be an integer. If n is even, then n2 is even.

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!

3.4.2 Proof by Contradiction.

This form of proof assumes both that the premise X is true and the conclusion Y is false,
and reach a logical fallacy.

Steps to proving a theorem by contradiction:

a. Assume P is true.
b. Assume ¬Q is true.
c. Demonstrate a contradiction.

Example 3.4.2.1 Let’s apply this form of proof to example 3.4.1.1

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.

6.0 Tutor-Marked Assignment

1. Prove the following:


a. √ 2 is irrational.
x+y
b. Let x and y be non-negative reals. Then, ≥ √ xy.
2

2. Use induction to prove for all n ∈ ℕ that ∑𝑛𝑘=0 2𝑘 = 2𝑛+1 − 1.


3. Prove that 7n − 1 is a multiple of 6 for all n ∈ ℕ.
4. Prove that 1 + 3 + 5 + · · · + (2n − 1) = n2 for all n ≥ 1.
5. Prove that F0 + F2 + F4 + · · · + F2n = F2n+1 − 1 where Fn is the nth Fibonacci number.

7.0 References/Further Reading

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.

3.0 Main Content


3.1 Propositional Logic
Logic is the study of consequences. Given a few mathematical statements or facts, we
would like to be able to draw some conclusions. For example, we can say the statement:
“Abuja is the capital of Nigeria” is True and that the statement: “The month of December
is fall in the summer” is False. This kind of statements are called propositions because they
are either true or false. The truth or falsehood of a proposition is called its truth value.

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.

P Q ¬P ¬Q P∧Q P∨Q P→Q P↔Q


T T F F T T T T
T F F T F T F F
F T T F F T T F
F F T T F F T T

Example 3.1.1. Make a truth table for the statement ¬P ∨ Q.

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.

The statement about monopoly in example 3.1.2 is an example of a tautology. Tautology


is a statement which is true on the basis of its logical form alone. Tautologies are always
true but they don’t tell us much about the world. No knowledge about monopoly was
required to determine that the statement was true.

3.1.1 Logical Equivalence

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.

Example 3.1.3. Check if the statement ¬P ∨ Q is logically equivalent to P → Q.


Solution 3.1.3. let us start by making the truth table for these statements. Check example
3.1.1 and our first truth table.

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

Solution 3.1.6. Considering solution 3.1.2, we can see that:


P Q P→Q
T T T
T F F
F T T
F F T

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.

3.2 First Order Logic


First order logic is an extension of propositional logic. Propositional logic only deals with
“facts”, statements that may be true or false e.g. “It is raining”. However, one cannot have
variables that stand for books or tables. First order logic operates over a set of objects (e.g.,
real numbers, people, etc.). It allows us to express properties of individual objects, to define
relationships between objects, and, most important of all, to quantify over the entire set of
objects.
Let’s give a classic argument in first order logic:
All men are mortal.
Adam is a man.
Therefore, Adam is a mortal.
In first order logic, the argument might be translated as follows:
∀x Man(x) → Mortal(x)
Man (Adam)
Mortal (Adam)

Let’s give some statements in first order logic:


i. “When you paint a with blue paint, it becomes blue.” cannot be made in propositional
logic but can be made in first order logic. In propositional logic, we would need a

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.

6.0 Tutor-Marked Assignment


1. Consider the statement about a party, “If it’s your birthday or there will be cake, then there will
be cake.”

a. Translate the above statement into symbols. Clearly state which statement is P and
which is Q.

b. Make a truth table for the statement.

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?

2. Make a truth table for the statement (P ∨ Q) → (P ∧ Q).

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

7.0 References/Further Reading


James, H. (2017). Discrete Structures, Logic and Computability. Published by Jones and Bartlett.
Fourth Edition. ISBN:978-284-07040-8.
Stroud, K. (2013) Engineering Mathematics. 7th edition. www.pdffiller.com/448950026-
ENGINEERING-MATHEMATICS-7TH-EDITION-by-KA-Stroud.

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

Unit 1 Boolean Algebra and Lattices


Unit 2 Graph Theory

UNIT 1 BOOLEAN ALGEBRA AND LATTICES

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.

Let Y be a subset of a poset X. An element u in X is an upper bound of Y if a ≼ u for


every element a ∈ Y. If u is an upper bound of Y such that u ≼ v for every other upper
bound v of Y, then u is called an LUB of Y. An element l in X is said to be a lower
bound of Y if l ≼ a for all a ∈ Y. If l is a lower bound of Y such that k ≼ l for every other
lower bound k of Y, then l is called a GLB of Y.

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.

Figure 3.1 Partial Order of ({a, b, c})

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.

Figure 3.2 A partial order on the divisors of 24

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.

3.2 Boolean Algebras


Let us investigate the example of the power set, P(X), of a set X more closely. The power set is a
lattice that is ordered by inclusion. By the definition of the power set, the largest element
in P(X) is X itself and the smallest element is ∅, the empty set. For any set A in P(X), we know
that A ∩ X = A and A ∪ ∅ = A. This suggests the following definition for lattices. An element I in
a poset X is a largest element if a ≼ I for all a ∈ X. An element O is a smallest element of X if O
≼ a for all a ∈ X.
Let A be in P(X). Recall that the complement of A is
A′ = X∖A = {x: x ∈ X and x ∉ A}.
We know that A ∪ A′=X and A ∩ A′ = ∅. We can generalize this example for lattices. A
lattice L with a largest element I and a smallest element O is complemented if for each a ∈ L, there
exists an a′ such that a ∨ a′ = I and a ∧ a′ = O.
In a lattice, L, the binary operations ∨ and ∧ satisfy commutative and associative laws; however,
they need not satisfy the distributive law
a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c);
however, in P(X) the distributive law is satisfied since
A ∩ (B∪ C) = (A ∩ B) ∪ (A ∩ C)
for A, B, C ∈ P(X). We will say that a lattice L is distributive if the following distributive law
holds:
a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c)
for all a, b, c ∈ L.

Theorem 3.4 A lattice L is distributive if and only if


a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c)
for all a, b, c ∈ L.
Proof
Let us assume that L is a distributive lattice.
a ∨ (b ∧ c) = [a ∨ (a ∧ c)] ∨ (b ∧ c)
= a ∨ [(a ∧ c) ∨ (b ∧ c)]
31
= a ∨ [(c ∧ a) ∨ (c ∧ b)]
= a ∨ [c ∧ (a ∨ b)]
= a ∨ [(a ∨ b) ∧ c]
= [(a ∨ b) ∧ a] ∨ [(a ∨ b) ∧ c]
= (a ∨ b) ∧ (a ∨ c).
The converse follows directly from the Duality Principle.

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.

Finite Boolean Algebras


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.
Let B and C, be Boolean algebras. A bijective map ϕ: B→C is an isomorphism of Boolean
algebras if
ϕ (a ∨ b) = ϕ(a) ∨ ϕ(b)
ϕ (a ∧ b) = ϕ(a) ∧ ϕ(b)
for all a and b in B.
We will show that any finite Boolean algebra is isomorphic to the Boolean algebra obtained by
taking the power set of some finite set X. We will need a few lemmas and definitions before we
prove this result. Let B be a finite Boolean algebra. An element a ∈ B is an atom of B if a ≠
O and a ∧ b = a for all b ∈ B with b ≠ O. Equivalently, a is an atom of B if there is no b ∈ B with b
≠ O distinct from a such that O ≼ b ≼ a.

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).

Exercise 3.2 Prove


Corollary 3.1. The order of any finite Boolean algebra must be 2n for some positive integer n.

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.

6.0 Tutor-Marked Assignment

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.

7.0 References/Further Reading


Donnellan, T. (1968). Lattice Theory. Pergamon Press.
Halmos, P.(1956). The Basic Concepts of Algebraic Logic, American Mathematical
Monthly vol., 53, 363–87.
Hohn, F. (1955). Some Mathematical Aspects of Switching, American Mathematical
Monthly, vol., 62, 75–90.
Hohn, F. (1966). Applied Boolean Algebra. 2nd ed. Macmillan, New York.
Lidl, R. and Pilz, G. (1998). Applied Abstract Algebra. 2nd ed. Springer, New York,
Whitesitt, J. (2010). Boolean Algebra and Its Applications. Dover, Mineola, NY.

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.

3.0 Main Content


3.1 Graphs
Graphs are made up of a collection of dots that are called vertices and lines connecting
those dots that are called edges. When two vertices are connected by an edge, we say that
they are adjacent.

Definition 3.1.1 A graph is an ordered pair G = (V, E) consisting of a nonempty set V


(vertices) and a set E (edges) of two-element subsets of V.

• 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.

Example 3.1.1.3 Before we proceed further, try to determine:

i. Which (if any) of the graphs below are the same?

ii. Are the graphs below the same or different?


Graph 1:
V = {a, b, c, d, e},
E = {{a, b}, {a, c}, {a, d}, {a, e}, {b, c}, {d, e}}.
Graph 2:
V = {v1, v2, v3, v4, v5},
E = {{v1, v3}, {v1, v5}, {v2, v4}, {v2, v5}, {v3, v5}, {v4, v5}}

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).

Example 3.1.1.4 Consider the graphs:


G1 = {V1, E1} where V1 = {a, b, c} and E1 = {{a, b}, {a, c}, {b, c}};
G2 = {V2, E2} where V2 = {u, v, w} and E2 = {{u, v}, {u, w}, {v, w}}.
Are these graphs the same?

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.

3.1.4 Isomorphic Graphs


An isomorphism between two graphs G1 and G2 is a bijection, f: V1 → V2 between the
vertices of the graphs such that {a, b} is an edge in G1 if and only if {f(a), f(b)} is an edge
in G2. Two graphs are isomorphic if there is an isomorphism between them. In this case
we write G1 ≌ G2.

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?

Solution 3.1.5. By carefully applying the definitions of a subgraph and an induced


subgraph, we can see that:
i. The graphs G2 and G3 are both subgraphs of G1.
ii. Only the graph G2 is an induced subgraph. This is because every edge in G1 that
connects vertices in G2 is also an edge in G2. However, in G3, the edge {a, b} is in E1 but
not E3, even though vertices a and b are in V3.
iii. The graph G4 is NOT a subgraph of G1. It might seem like it is, however, if you
look closely, you will realize that vertex e does not exist in G4. Therefore, it is enough to
say that G4 is NOT a subgraph of G1, since {c, f} ∈ E4 but {c, f} ∉ E1 and that we don’t
have the required E4 ⊆ E1.

3.1.6 Bipartite Graphs

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.

Example 3.2.2. At a recent mathematics competition, 9 mathematicians greeted each other by


shaking hands. Is it possible that each mathematician shook hands with exactly 7 people at the
competition?
Solution 3.2.2. It looks like this should be possible. Each mathematician chooses one person
to not shake hands with. But this cannot happen. We are asking whether a graph with 9 vertices
can have degree 7 for each vertex. If such a graph existed, the sum of the degrees of the vertices
would be 9 x 7 = 63. This would be twice the number of edges (handshakes) resulting in a
graph with 31.5 edges. That is impossible. Thus at least one (in fact an odd number) of the
mathematicians must have shaken hands with an even number of people at the competition.

3.3 Euler Paths and Circuits


An Euler path, in a graph or multigraph can be defined as a walk through the graph which uses
every edge exactly once. While an Euler circuit is an Euler path which starts and stops at the
same vertex. The main goal here is to find a quick way to determine if a graph has an Euler
path or an Euler circuit.

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

6.0 Tutor-Marked Assignment


1. Are the graphs below equal? Are they isomorphic? If they are isomorphic, give the
isomorphism else state why they are not.
G1 = V1 = {a, b, c, d, e}, E1 = {{a, c}, {a, d}, {a, e}, {b, d}, {b, e}, {c, e}, {d, e}}

G2 = a c

b d

2. Consider the following two graphs:


G1 V1 = {a, b, c, d, e, f, g} E1 = {{a, b}, {a, d}, {b, c}, {b, d}, {b, e}, {b, f}, {c, g},
{d, e}, {e, f}, {f, g}}.
G2 V2 = {v1, v2, v3, v4, v5, v6, v7}, E2 = {{v1, v4}, {v1, v5}, {v1, v7}, {v2, v3},
{v2, v6}, {v3, v5}, {v3, v7}, {v4, v5}, {v5, v6}, {v5, v7}}
i. Let f: G1 → G2 be a function that takes the vertices of Graph 1 to vertices of Graph
2. The function is given by the following table:
x a b c d e f g
f(x) v4 v5 v1 v6 v2 v3 v7

Does f define an isomorphism between Graph 1 and Graph 2?


ii. Define a new function g (with g, f) that defines an isomorphism between Graph 1 and
Graph 2.
3. If 10 people each shake hands with each other, how many handshakes took place? What
does this question have to do with graph theory?
4. Decide whether the statements below about subgraphs are true or false. If true in 1 or 2
sentences, explain why, else, give a counterexample if false.

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.

7.0 References/Further Reading


Chiranjib, M and Gyan, M (2014). Role of Adjacency Matrix in Graph Theory, IOSR
Journal Computer Engineering, 16(2): 58- 63.
Donnellan, T. (1968). Lattice Theory. Pergamon Press.
Halmos, P.(1956). The Basic Concepts of Algebraic Logic, American Mathematical
Monthly vol., 53, 363–87.
Hohn, F. (1955). Some Mathematical Aspects of Switching, American Mathematical
Monthly, vol., 62, 75–90.
Hohn, F. (1966). Applied Boolean Algebra. 2nd ed. Macmillan, New York.
Lidl, R. and Pilz, G. (1998). Applied Abstract Algebra. 2nd ed. Springer, New York,
Whitesitt, J. (2010). Boolean Algebra and Its Applications. Dover, Mineola, NY.

50
MODULE 3 MATRICES, APPLICATIONS TO COUNTING AND DISCRETE
PROBABILITY

Unit 1 Matrices and Determinants


Unit 2 Applications to Counting
Unit 3 Discrete Probability Generating Function

UNIT 1 MATRICES AND DETERMINANTS

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

The order of the matrices, A, B and C are (2 × 2), (3 × 1) and (2 × 3) respectively.

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.

3.1.1 Types of Matrices


1. Row Matrix and Column Matrix: A matrix consisting of a single row is
called a row matrix or a row vector, whereas a matrix having single column is called
a column matrix or a column vector.
2. Null or Zero Matrix: A matrix in which each element is „0‟ is called a
Null or Zero matrix. Zero matrices are generally denoted by the symbol O. This
distinguishes zero matrix from the real number 0.
0 0 0
For example O = [ ]is a zero matrix of order 2  3.
0 0 0
The matrix Omxn has the property that for every matrix Amxn, A + O = O + A = A
3. Square matrix: A matrix A having same numbers of rows and columns is
called a square matrix. A matrix A of order m  n can be written as Amn. If m = n,
then the matrix is said to be a square matrix. A square matrix of order n  n, is
simply written as An. A = and C =.
𝑎 𝑑 𝑔
𝑎 𝑏
Thus [ ] and [ 𝑏 𝑒 ℎ ] are square matrix of order 2 and 3.
𝑐 𝑑
𝑐 𝑓 𝑖

3.1.2. Main or Principal Diagonal: The principal (leading) diagonal of a square


matrix is the ordered set of elements aij, where i = j, extending from the upper left-
hand corner to the lower right-hand corner of the matrix. Thus, the principal
diagonal contains elements a11, a22, a33 etc. For example, the principal diagonal of
𝑎 𝑑 𝑔
[𝑏 𝑒 ℎ]
𝑐 𝑓 𝑖

consists of a, e and i, in that order.

3.1.3. Particular cases of a square matrix

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𝑘

3. Identity Matrix or Unit Matrix


A scalar matrix in which each diagonal element is 1 (unity) is called a unit matrix.
An identity matrix of order n is denoted by In.
100
1 0
Thus, 𝐼2 = [ ] and 𝐼3 = [0 1 0] are identity matrices of the order 2 and 3
0 1
001
respectively.
𝑎11 𝑎12 ⋯ 𝑎1𝑛
In general, 𝐴 = [ ⋮ ⋱ ⋮ ] = (𝑎𝑖𝑗 )𝑚𝑥𝑛
𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛
Is an identity matrix if and only if
aij = 0 for i ≠ j, and
aij ≠ 1 for i = j.
Note: If a matrix A and identity matrix I are conformable for multiplication, then I
has the property that AI = IA = A i.e., I is the identity matrix for multiplication.

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

5. The Negative of a Matrix


The negative of the matrix Amxn, denoted by -Amxn, is the matrix formed by
replacing each element in the matrix Amxn with its additive inverse. For example,
1 2
If 𝐴3𝑥2 = [ 3 4 ]
5 6
1 2
Then 𝐴3𝑥2 = [ 3 4 ]
5 6
for every matrix Amxn, the matrix -Amxn has the property that
A + (-A) = (-A) + A = 0
i.e., (-A) is the additive inverse of A.
The sum Bm-n + (-Amxn) is called the difference of Bmxn and Amxn and is denoted by
Bmxn – Amxn.

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𝑘

Example 3.3.1. From A given, determine 3A.

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

2. Addition and subtraction of Matrices: If A and B are two matrices of


same order m  n then their sum A + B is defined as C, m  n matrix such that each
element of C is the sum of the corresponding elements of A and B. For example,
2 9 1 5
Let 𝐴 = [ ] and 𝐵 = [ ].
5 6 3 2
2 + 1 9 + ( 5) 3 4
Then, C = A + B = [ ]=[ ]
5+3 6+2 8 4

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

If A, B and C are the matrices of the same order m  n then,

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.

3. Product of Matrices: Two matrices A and B are said to be conformable for


the product AB if the number of columns of A is equal to the number of rows of B.
Then the product matrix AB has the same number of rows as A and the same
number of columns as B.

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

cij = ai1b1j + ai2b2j + ai3b3j + ……….+ ainbnj

For example, let’s consider the matrices:

𝑎11 𝑎12 𝑏11 𝑏12


𝐴2𝑥2 = [𝑎 𝑎22 ] and 𝐵2𝑥2 = [𝑏21 ]
21 𝑏22
Since the number of columns of A is equal to the number of rows of B, the product AB is
defined and is given as
𝑎11 𝑎12 𝑏11 𝑏12 𝑎 𝑏 + 𝑎12 𝑏21 𝑎12 𝑏12 + 𝑎12 𝑏22
𝐴𝐵 = [𝑎 𝑎22 ] [𝑏21 ] = [ 11 11 ]
21 𝑏22 𝑎21 𝑏11 + 𝑎22 𝑏21 𝑎21 𝑏12 + 𝑎22 𝑏22
Thus c11 is obtained by multiplying the elements of the first row of A i.e., a11, a12 by the
corresponding elements of the first column of B i.e., b11, b21 and adding the product. Similarly,
c12 is obtained by multiplying the elements of the first row of A i.e., a11, a12 by the
corresponding elements of the second column of B i.e., b12, b22 and adding the product.
Similarly, for c21, c22. Note:
i.Multiplication of matrices is not commutative i.e., AB  BA in general. 2.
ii.For matrices A and B if AB = BA then A and B commute to each other.

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

= | 𝑎11 𝑎22 − 𝑎21 𝑎12 |

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 𝑎12 𝑎13


Determinant of a 3  3 matrix: Given the matrix 𝐴 = [ 𝑎21 𝑎22 𝑎23 ], then
𝑎31 𝑎32 𝑎33
𝑎11 𝑎12 𝑎13
|𝐴| = | 𝑎21 𝑎22 𝑎23 |
𝑎31 𝑎32 𝑎33
𝑎22 𝑎23 𝑎21 𝑎23 𝑎21 𝑎22
= 𝑎11 |𝑎 𝑎 | − 𝑎12 | 𝑎 𝑎 | + 𝑎13 |𝑎 |
32 33 31 33 31 𝑎32

= 𝑎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.

3.2.1. Minor and Cofactor of Element

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.

4. Singular and Non-singular Matrices


A square matrix A is called singular if |A| = 0 and is non-singular if |A|  0, for
example if t

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

The matrix of cofactors of A will be, C:


5 −2 1
𝐶 = [−1 2 − 1 ]
3 −2 3
5 −1 3
𝐶 𝑡 = [−2 2 − 2 ]
1 −1 3
Therefore, Adj (A) = Ct

Adjoint of a 22 Matrix


𝑎 𝑏
The adjoint of matrix 𝐴 = [ ] is denoted by Adj (A) and is defined as:
𝑐 𝑑
𝑑 −𝑎
𝐴𝑑𝑗 (𝐴) = [ ]
−𝑐 𝑏

62
6. Inverse of a Matrix
𝑎𝑑𝑗 (𝐴)
If A is a non-singular square matrix then, 𝐴−1 = |𝐴|

22 Matrix
1 2
Example 3.1.5. If 𝐴 = [ ], find A-1.
1 3
Solution 3.1.5.

|𝐴| = | 1 2| = |1.3 − (1.2)| = |3 − 2| = 1


1 3
3 −2
Adj (A) = [ ]
−1 1
𝑎𝑑𝑗 (𝐴) 1 3 −2 3 −2
𝐴−1 = = [ ]= [ ]
|𝐴| 1 −1 1 −1 1
Alternately: For a non-singular matrix A of order (n  n) if there exist another
matrix B of order (n  n) such that their product is the identity matrix I of order
(n  n) i.e., AB = BA = I.
Then B is said to be the inverse (or reciprocal) of A and is written as B = A-1.
1 3 7 3
Example 3.1.6. If 𝐴 = [ ]and 𝐵 = [ ]. Show that AB = BA = I then, B =
2 7 2 1
𝐴−1 .
Solution 3.1.6.
1 3 7 3 1 0
𝐴𝐵 = [ ][ ]=[ ]
2 7 2 1 0 1

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

7. Solution of Linear Equations by Matrices


For a linear system:
a11x1 + a12x2 + ------ + a1nxn = b1
a21x1 + a22x2 + ------ + a2nxn = b2………………………….. (1)

an1x1 + an2x2 + ------ + annxn = bn


It can be written as the matrix equation:

𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑥1 𝑏1


𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑥2 𝑏
[ ⋮ ⋱ ⋮ ][ ⋮ ] = [ 2]

𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 𝑥𝑛 𝑏𝑛

𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑥1 𝑏1


𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑥2 𝑏2
Let 𝐴 = [ ⋮ ⋱ ⋮ ] , 𝑋 = [ ⋮ ] and 𝐵 = [ ⋮ ].
𝑎𝑛1 𝑎𝑛2 ⋯ 𝑎𝑛𝑛 𝑥𝑛 𝑏𝑛

The equation can be written as, AX = B.

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

6.0 Tutor-Marked Assignment


1. Write the following matrices in tabular form:
a. A = [aij], where i = 1, 2, 3 and j = 1, 2, 3, 4
b. B = [bij], where i = 1 and j = 1, 2, 3, 4
c. C = [cjk], where j = 1, 2, 3 and k = 1
1 2 1 0
2. Show that if 𝐴 = [ ]and 𝐵 = [ ] then,
0 1 1 2

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

7.0 References/Further Reading


Deitel, H. M. and Deitel, P. J. (1998). C++ How to Programme (2nd Edition), New Jersey:
Prentice Hall.
French, C. S. (1992). Computer Science, DP Publications. (4th Edition), 199-217.

Shaffer, Clifford A. A. (1998). Practical Introduction to Data Structures and Algorithm


Analysis, Prentice Hall, pp. 77-102.

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.

3.0 Main Content


3.1 The Product and Sum Rules

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.

Example 3.1.6. How many 4- to 6-digit pin codes are there?


Solution 3.1.6. By the product rule, the number of distinct n digit pin codes is 10n (each
digit has 10 possibilities). By the sum rule, we have 104 + 105 + 106 number of 4- to 6-
digit pin codes (to state the obvious, we have implicitly used the fact that every 4-digit pin
code is different from every 5-digit pin code).

3.2 Permutations and Combinations


Permutations and combinations are also tools for counting. Given n distinct objects, how
many ways are there to “choose” r of them? Well, it depends on whether the r chosen
objects are ordered or not. For example, suppose we deal three cards out of a standard 52-
card deck. If we are dealing one card each to Alice, Bob and Cathy, then the order of the
cards being dealt matters; this is called a permutation of 3 cards. On the other hand, if we
are dealing all three cards to Alice, then the order of the cards being dealt does not matter;
this is called a combination of 3 cards.
3.2.1. Permutations
Definition 3.2.1.1. A permutation of a set A is an ordered arrangement of the elements in
A. An ordered arrangement of just r elements from A is called an r-permutation of A. For
non-negative integers r ≤ n, P(n, r) denotes the number of r-permutations of a set with n
elements.

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

Considering unordered selections.


Definition 4.10. An unordered arrangement of r elements from a set A is called an r-
𝑛
combination of A. For non-negative integers r ≤ n, C(n, r) or ( ) denotes the number of r-
𝑟
combinations of a set with n elements. C(n, r) is also called the binomial coefficients (we
will soon see why).
For example, how many ways are there to put two pawns on a 8 × 8 chess board? We can
select 64 possible squares for the first pawn, and 63 possible remaining squares for the
second pawn. But now we are over counting, e.g., choosing squares (b5, c8) is the same as
choosing (c8, b5) since the two pawns are identical. Therefore, we divide by 2 to get the
correct count: 64 × 63/2 = 2016. More generally,
Theorem 3.2.2.
n!
C(n, r) = (n − r)!r!

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.

Lemma 3.1. If 0 ≤ k ≤ n, then C(n, k) = C(n, n − k).


Proof. Each unordered selection of k elements has a unique complement: an unordered
selection of n − k elements. So instead of counting the number of selections of k elements
from n, we can count the number of selections of n−k elements from n (e.g., to deal 5 cards
from a 52 card deck is the same as to throw away 52 − 5 = 47 cards).
An algebraic proof of the same fact (without much insight) goes as follows:
n! n!
C(n, r) = (n − k)!k! = (n−(n − k))!(n−k)! = 𝐶(𝑛, 𝑛 − 𝑘)

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.

Lemma 3.3. ∑nk=0 C(n, k) = 2n .


Proof. Let us once again count the number of possible subsets of a set of n elements. We
have already seen by induction and by the product rule that there are 2n such subsets; this
is the RHS.

Another way to count is to use the sum rule:

No of subsets = ∑nk=0 No of subsets of size k = ∑nk=0 C(n, k) This is the LHS.

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).

Theorem 3.3.1. (The Binomial Theorem). For n ∈ ℕ,

74
n

(x + y) ∑ C(n, k)x n−k y k


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.

Exercise 3.3.1. What is the coefficient of x13y7 in the expansion of (x−3y)20?


We write (x − 3y)20 as (x + (−3y))20 and apply the binomial theorem, which gives us the
term: C(20, 7)x13(−3y)7 = −3 7C(20, 7)x13y7.

If we substitute specific values for x and y, the binomial theorem gives us more
combinatorial identities as corollaries.

Corollary 3.1. ∑nk=0 C(n, k) = 2n , again.

Proof. Simply write 2n = (1+1)n and expand using the binomial theorem.

Corollary 3.2. ∑nk=1(−1)k+1 𝐶(𝑛, 𝑘) = 1.


Proof. Expand 0 = 0n = (1 − 1)n using the binomial theorem:
0 = ∑nk=0 𝐶(𝑛, 𝑘)1𝑛−𝑘 (−1)k
= 𝐶(𝑛, 0) + ∑nk=1(−1)𝑘 𝐶(𝑛, 𝑘)
Rearranging terms gives us:
𝐶(𝑛, 0) = − ∑nk=1(−1)𝑘 𝐶(𝑛, 𝑘) = ∑nk=1(−1)𝑘+1 𝐶(𝑛, 𝑘)
This proves the corollary since C(n, 0) = 1.
3.3.1 Using Pascal’s triangle to expand a binomial expression
Let’s now see how useful the triangle can be when we want to expand a binomial
expression. Consider the binomial expression a + b, and suppose we wish to find (a + b)2.
We know that
(a + b)2 = (a + b)(a + b)
= a2 + ab + ba + b2
75
= a2 + 2ab + b2
That is,
(a + b) 2 = 1a2 + 2ab + 1b2
Observe the following in the final result:
1. As we move through each term from left to right, the power of a decreases from 2 down
to zero.
2. The power of b increases from zero up to 2.
3. The coefficients of each term, (1, 2, 1), are the numbers which appear in the row of
Pascal’s triangle beginning 1,2.
4. The term 2ab arises from contributions of 1ab and 1ba, i.e. 1ab + 1ba = 2ab. This is the
link with the way the 2 in Pascal’s triangle is generated; i.e. by adding 1 and 1 in the
previous row.

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 = 1a3 + 3a2b + 3ab2 + 1b3

which we would normally write as just

(a + b) 3 = a3 + 3a2b + 3ab2 + b3

Thinking of (a + b)3 as

(a + b) (a2 + 2ab + b2) = a3 + 2a2b + ab2 + ba2 + 2ab2 + b3

= 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.

Example 3.3.2. Suppose we wish to find (a + b)4.

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.

Example 3.3.3. Suppose we want to expand (2x + y)3.

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,

(2x + y)3 = 1(2x) 3 + 3(2x)2y + 3(2x)1y2 + 1y3

= 8x3 + 12x2y + 6xy2 + y3


2 3
Example 3.3.4. Let’s expand (1 + 𝑥) .

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
𝑥 𝑥 𝑥

3.4 Inclusion-Exclusion Principle


Some counting problems simply do not have a closed form solution. In this section we
discuss a counting tool that also does not give a closed form solution. The inclusion-
exclusion principle can be seen as a generalization of the sum rule.
Suppose there are n(A) ways to perform task A and n(B) ways to perform task B, how
many ways are there to perform task A or B, if the methods to perform these tasks are not
distinct? We can cast this as a set cardinality problem. Let X be the set of ways to perform
A, and Y be the set of ways to perform B. Then:
|X ∪ Y | = |X| + |Y | − |X ∩ Y |
This can be observed using the Venn Diagram. The counting argument goes as follows: To
count the number of ways to perform A or B (|X ∪ Y |) we start by adding the number of
ways to perform A (i.e., |X|) and the number of ways to perform B (i.e., |Y |). But if some

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,

Theorem 3.4.1. Let A1, … , An be finite sets. Then,

𝑛 𝑛

|⋃ 𝐴𝑖 | = ∑(−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

and this is 1 by Corollary 3.2.


3.5 Pigeonhole Principle
In this section, we will discuss the pigeonhole principle: a proof technique that relies on
counting. The principle says that if we place k + 1 or more pigeons into k pigeon holes,
then at least one pigeon hole contains 2 or more pigeons. For example, in a group of 367

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−𝑧

This formular proves that ∑∞


𝑥=0 𝑃(𝑋 = 𝑥) = 1 when 𝑋 ~ Geometric(𝑝):

𝑃(𝑋 = 𝑥) = 𝑝(1 − 𝑝)𝑥 ⟹ ∑∞ ∞


𝑥=0 𝑃(𝑋 = 𝑥) = ∑𝑥−0 𝑝(1 − 𝑝)
𝑥

= 𝒑 ∑∞
𝑥=0(1 − 𝑝)
𝑥

𝑝
= (𝑏𝑒𝑐𝑎𝑢𝑠𝑒 |1 − 𝑝| < 1)
1−(1−𝑝)

=1 (𝑤ℎ𝑖𝑐ℎ 𝑖𝑠 𝑡ℎ𝑒 𝑠𝑢𝑚 𝑜𝑓 𝑔𝑒𝑜𝑚𝑒𝑡𝑟𝑖𝑐 𝑠𝑒𝑟𝑖𝑒𝑠)

3.1.2 Binomial Theorem


Binomial theorem states that for any 𝑝, 𝑞 ∈ ℝ and integer 𝑛, then
𝑛 𝑛 𝑛!
(𝑝 + 𝑞)𝑛 = ∑𝑛𝑥=0 ( ) 𝑝 𝑥 𝑞 𝑛−𝑥 , where ( ) = .
𝑥 𝑥 (𝑛−𝑥)!𝑥!

The Binomial Theorem proves that ∑𝑛𝑥=0 𝑃(𝑋 = 𝑥) = 1 when 𝑋 ~ Binomial(𝑛, 𝑝):
𝑛
𝑃(𝑋 = 𝑥) = ( ) 𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 𝑓𝑜𝑟 𝑥 = 0, 1, 2, 3, . . . , 𝑛,
𝑥
𝑛 𝑛
𝑛
∴ ∑ 𝑃(𝑋 = 𝑥) = ∑ ( ) 𝑝 𝑥 (1 − 𝑝)𝑛−𝑥 = [𝑝 + (1 − 𝑝)]𝑛 = 1𝑛 = 1
𝑥
𝑥=0 𝑥=0

Hence the prove.


3.1.3 Exponential Series
𝜆𝑥
Exponential series state that for any 𝜆 ∈ ℝ, 𝑡ℎ𝑒𝑛 ∑∞ 𝜆
𝑥=0 𝑥! = 𝑒 .

The Exponential Series proves that ∑∞


𝑥=0 𝑃(𝑋 = 𝑥) = 1 when 𝑋 ~ Poisson(𝜆):

𝜆𝑥
𝑃(𝑋 = 𝑥) = 𝑒 −𝜆 𝑓𝑜𝑟 𝑥 = 0, 1, 2, 3, ⋯,
𝑥!

𝜆𝑥 𝜆𝑥
∴ ∑∞ ∞
𝑥=0 𝑃(𝑋 = 𝑥) = ∑𝑥=0 𝑥! 𝑒
−𝜆
= 𝑒 −𝜆 ∑∞ −𝜆 𝜆
𝑥=0 𝑥! = 𝑒 𝑒 = 1

1 𝑛
But we know that 𝑒 𝜆 = lim (1 + ) 𝑓𝑜𝑟 𝜆 ∈ ℝ.
𝑛→∞ 𝑛

3.2 Probability Generating Function (PGF)


Let be a random variable defined over the negative integers {0, 1, 2, 3, ⋯ }. The
probability generating function of 𝑋 is given by

82
𝐺𝑋 (𝑧) = 𝑝0 + 𝑝1 𝑧 + 𝑝2 𝑧 2 + . . . = ∑∞ 𝑗 𝑋
𝑗=0 𝑝𝑗 𝑧 = 𝔼(𝑧 ), 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑧 ∈ ℝ for which the
sum converges. Therefore, to calculate the probability generating function, we that
𝐺𝑋 (𝑧) = 𝔼(𝑧 𝑋 ) = ∑∞ 𝑥
𝑥=0 𝑧 𝑃(𝑋 = 𝑥).

3.2.1 Properties of the PGF


(1) 𝐺𝑋 (0) = 𝑃(𝑋 = 0):
𝐺𝑋 (0) = 00 × 𝑃(𝑋 = 0) + 01 × 𝑃(𝑋 = 1) + 02 × 𝑃(𝑋 = 2)+. ..
𝐺𝑋 (0) = 𝑃(𝑋 = 0).
(2) 𝐺𝑋 (1) = 1: 𝐺𝑋 (1) = ∑∞ 𝑥 ∞
𝑥=0 1 𝑃(𝑋 = 𝑥) = ∑𝑥=0 𝑃(𝑋 = 𝑥) = 1.

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

= (𝑝𝑧 + 𝑞)𝑛 by Binomial Theorem.


Hence, 𝐺𝑋 (𝑧) = (𝑝𝑧 + 𝑞)𝑛 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑠 ∈ ℝ.
Example 3.2.3: Let 𝑋 have a Geometric distribution function with parameter 𝑝 (or
𝑋 ~ 𝑃(𝜆), so 𝑃(𝑋 = 𝑥) = 𝑝(1 − 𝑝)𝑥 = 𝑝𝑞 𝑥 for 𝑥 = 0, 1, 2, 3, . . ., where 𝑞 =
1 − 𝑝. The probability generating function is given by
∞ ∞
𝑝
𝐺𝑋 (𝑧) = ∑ 𝑧 𝑥 𝑝𝑞 𝑥 = 𝑝 ∑(𝑞𝑧)𝑥 = 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑧 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 |𝑞𝑧| < 1.
1 − 𝑞𝑧
𝑥=0 𝑥=0
𝑝 1
Hence, 𝐺𝑋 (𝑧) = 𝑓𝑜𝑟 |𝑧| < .
1−𝑞𝑧 𝑞

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

Hence, 𝐺𝑋 (𝑧) = 𝑒 𝜆(𝑧−1) 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑧 ∈ ℝ .

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.

3.3.1 Mean (Expected value)


Let 𝑋 be a discrete random variable with PGF 𝐺𝑋 (𝑧). Then, the expectation value can be
expressed by
𝐸[𝑋] = ∑∞ ′ ′
𝑥=1 𝑥 𝑃(𝑋 = 𝑥) = 𝐺 𝑋 (1) , where 𝐺 𝑋 (𝑧) denotes the derivative of 𝐺𝑋 (𝑧).

Hence, 𝐺 ′𝑋 (𝑧) = ∑∞
𝑥=0 𝑥 𝑃(𝑋 = 𝑥) 𝑧
𝑥−1
= ∑∞
𝑥=1 𝑥 𝑃(𝑋 = 𝑥)𝑧
𝑥−1
.
Also, the second moment is
𝐸[𝑋 2 ] = 𝐺 ′′𝑋 (1) + 𝐺 ′𝑋 (1)
But we know that, 𝐺 ′𝑋 (𝑧) = ∑∞
𝑥=1 𝑥 𝑃(𝑋 = 𝑥) 𝑧
𝑥−1
, then
∞ ∞

𝐺 ′′𝑋 (𝑧) = ∑ 𝑥(𝑥 − 1) 𝑃(𝑋 = 𝑥) 𝑧 𝑥−2 = ∑(𝑥 2 − 𝑥) 𝑃(𝑋 = 𝑥) 𝑧 𝑥−2


𝑥=2 𝑥=0

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, 𝑉𝑎𝑟[𝑋].

Solution: Given 𝐺𝑋 (𝑧) = 𝑒 𝜆(𝑧−1) , then


(𝑖) 𝐺 ′𝑋 (𝑧) = 𝜆𝑒 𝜆(𝑧−1) , 𝑤ℎ𝑖𝑐ℎ 𝑖𝑚𝑝𝑙𝑖𝑒𝑠 𝑡ℎ𝑎𝑡 𝐸[𝑋] = 𝐺 ′𝑋 (1) = 𝜆
(𝑖𝑖) Thus, 𝐺 ′′𝑋 (1) = 𝜆2 𝑒 𝜆(𝑧−1) |𝑧=1 = 𝜆2
and
𝐸[𝑋 2 ] = 𝐺 ′′𝑋 (1) + 𝐺 ′𝑋 (1) = 𝜆2 + 𝜆
∴ 𝑉𝑎𝑟[𝑋] = 𝐸[𝑋 2 ] − 𝐸[𝑋]2 = 𝜆2 + 𝜆 − 𝜆2 = 𝜆
Example 3.3.4: Let 𝑋 be a random variable that has Bernoulli distribution with
parameter 𝑝. The PGF is defined by 𝐺𝑋 (𝑧) = (1 − 𝑝) + 𝑝𝑧. Calculate 𝐸[𝑋] and 𝑉𝑎𝑟[𝑋].
Solution: This implies that 𝐺 ′𝑋 (𝑧) = 𝑝 𝑎𝑛𝑑 𝐺 ′′𝑋 (𝑧) = 0
Hence, 𝐸[𝑋] = 𝐺 ′𝑋 (1) = 𝑝
and

84
𝑉𝑎𝑟[𝑋] = 𝐺 ′′𝑋 (1) + 𝐺 ′𝑋 (1) + 𝐺 ′𝑋 (1)2 = 0 + 𝑝 − 𝑝2 = 𝑝(1 − 𝑝).

3.4 Using the PGF to calculate the probabilities


As well as calculating the moments of distribution of 𝑋, we can also calculate the
probabilities using the PGF. Given the PGF 𝐺𝑋 (𝑧) = 𝐸(𝑧 𝑋 ) of any probability function,
we can recover all the possible probabilities 𝑃(𝑋 = 𝑥) (𝑜𝑟 𝑠𝑜𝑚𝑒𝑡𝑖𝑚𝑒𝑠 𝑤𝑟𝑖𝑡𝑡𝑒𝑛 𝑎𝑠 𝑝𝑥 ).

𝑋)
∴ 𝐺𝑋 (𝑧) = 𝐸(𝑧 = 𝑝0 + 𝑝1 𝑧 + 𝑝2 𝑧 + . . . = ∑ 𝑝𝑗 𝑧 𝑗
2

𝑗=0

Hence, 𝑝0 = 𝑃(𝑋 = 0) = 𝐺𝑋 (0).


Also, the first derivative of the PGF is
𝐺 ′𝑋 (𝑧) = 𝑝1 + 2𝑝2 𝑧 + 3𝑝3 𝑧 2 + 4𝑝4 𝑧 3 + . ..
Which implies that
𝑝1 = 𝑃(𝑋 = 1) = 𝐺 ′𝑋 (0).
The second derivative of the PGF is
𝐺 ′′𝑋 (𝑧) = 2𝑝2 + 6𝑝3 𝑧 + 12𝑝4 𝑐+ . ..
Which implies that
1 ′
𝑝2 = 𝑃(𝑋 = 2) = 𝐺 ′ (0).
2! 𝑋
For the third derivative of the PGF, we have
𝐺 ′′′𝑋 (𝑧) = 6𝑝3 + 24𝑝4 𝑧+ . ..
Which implies that
1
𝑝3 = 𝑃(𝑋 = 3) = 3! 𝐺 ′′′ (0).
𝑋

Therefore, the 𝒏𝒕𝒉 derivative or the general form is given by


1 1 𝑑𝑛
𝑝𝑛 = 𝑃(𝑋 = 𝑛) = (𝑛!) 𝐺 (𝑛)𝑋 (0) = (𝑛!) 𝑑𝑧 𝑛 (𝐺𝑋 (𝑧))|𝑧=0.
𝑧
Example 3.4.1: Let 𝑋 be a discrete random variable with PGF 𝐺𝑋 (𝑧) = 5 (2 + 3𝑧 2 ).
Obtain the distribution of 𝑋.
𝑧 2 3
Solution: Given 𝐺𝑋 (𝑧) = 5 (2 + 3𝑧 2 ) = 𝑧+ 𝑧3
5 5

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

3.5 Geometric Random Variables


The PGF of a geometrically distributed random variable 𝑋 is
∞ ∞
𝑗−1 𝑗
𝑝𝑧
𝐺(𝑧) = ∑ 𝑝(1 − 𝑝) 𝑧 = 𝑝𝑧 ∑(1 − 𝑝)𝑗 𝑧 𝑗 =
1 − (1 − 𝑝)𝑧
𝑗=1 𝑗=0

𝑝
𝐺(𝑧) = ∑ 𝑝(1 − 𝑝)𝑗−1 𝑧 𝑗 = 𝐺 ′ (𝑧) = , 𝐺 ′′ (𝑧)
(1 − (1 − 𝑝)𝑧)2
𝑗=1
2𝑝(1 − 𝑝)
=
(1 − (1 − 𝑝)𝑧)3
1
∴ 𝐸[𝑋] = 𝐺 ′𝑋 (1) = 𝑃

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 − 𝑝) + 𝑝𝑧)

∴ 𝑉𝑎𝑟[𝑋] = 𝐺 ′′𝑋 (𝑧) + 𝐺 ′𝑋 (1) + 𝐺 ′𝑋 (1)2 = (𝑛2 − 𝑛)𝑝2 + 𝑛𝑝 − 𝑛2 𝑝2

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.

6.0 Tutor-Marked Assignment

1. Find the sequence generated by the following generating functions:


4x
a. 1−x
1
b. 1 − 4x
x
c. 1+x
3x
d. (1 + x) 2

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 𝑋.

7.0 References/Further Reading

Abramowitz, M. and Stegun, I. A. (1964). Handbook of Mathematical Functions, National


Bureau of Standards, Applied Mathematics Series Nr.55, Washington, D.C.
Casella, G and Berger, R. L. (2002). Statistical Inference (2nd Edition). Pacific Grove: Duxbury.
Clive, M., John, B., Tim, W., Wait, K. and Dan, B. (2011). Electrical Engineering: Know It All.
Newnes. Pp. 884.
Levin, O., (2021). Discrete Mathematics: An Open Introduction 3rd Edition, Oscar Levin, 2019.
ISBN: 978-1792901690.
Spanos, Aris (1999). Probability Theory and Statistical Inference. New York: Cambridge
musiUniversity, pp. 109-130.

88

You might also like