You are on page 1of 20

MODULE 4 DISCRETE MATHEMATICS

MODULE 4 DISCRETE MATHEMATICS

Chapter/ Module 4: Counting and Probability

Learning Objectives:

This module will introduce students to basic counting principles that they can use to analyse and
understand mathematical structures. Specifically this module aims to:
 Recognition and comparison of different counting principles (Suma and product rule,
permutation and combination, inclusion and exclusion theory) along with its associated
properties and where and when they can be applied.
 Knowledge of solving counting problems using or involving multiplication rule, permutations
and combinations.
 Understanding and application of the counting principles: Probability, Bayes Theorem,
Pigeonhole.
 Evaluation of probability of different events using different discrete probability approaches and
counting principles.

LESSON 4: COUNTING PRINCIPLES

FUNDAMENTAL COUNTING PRINCIPLES


The Fundamental Counting Principle, sometimes referred to as the fundamental counting rule, is
a way to figure out the number of possible outcomes for a given situation.
While there are five basic counting principles: addition, multiplication, subtraction, cardinality
(principle of inclusion-exclusion), and division. The one that is most closely associated with the title of
“fundamental counting principle” is the multiplication rule, where if there are p ways to do one task and
q ways to another task, then there are pxq ways to do both.

ADDITION PRINCIPLE (RULE OF SUM)


The Sum Rule states that if a task can be performed in either two ways, where the two methods
cannot be performed simultaneously, then completing the job can be done by the sum of the ways to
perform the task.
MODULE 4 DISCRETE MATHEMATICS

Example
For instance, suppose a bakery has a selection of 20 different cupcakes, 10 different donuts, and 15
different muffins. If you are to select a tasty treat, how many different choices of sweets can you choose
from?
Here’s how this works.
Because we have to choose from either a cupcake or donut or muffin (notice the “OR”), we
have 20 + 10 + 15 = 45 treats to choose from.

MULTIPLICATION PRINCIPLE (RULE OF PRODUCT)


The Product Rule states that if a task can be performed in a sequence of tasks, one after the
other, then completing the job can be done by the product of the ways to perform the task.

Example #1
Continuing our story from above, suppose a bakery has a selection of 20 different cupcakes, 10
different donuts, and 15 different muffins — how many different orders are there?
What makes this question different from the first problem is that we are  not asking how many total
choices there are. We are asking how many different ways we can select a treat.
It’s possible that you only want one treat, but you can quite easily want more than one.
So how many different orders can you create, if you’re allowed to choose as few or as many as you like?
This is the job for the product rule!
Because we can choose treats from a selection of cupcakes and donuts and muffins (notice the
“AND”), we 20 x 10 x 15 = 3,000 ordering options.

Example #2
Now let’s look at another example. Suppose a mathematics faculty and 83 mathematics majors, and no
one is both a faculty member and a student. Solution: By the sum rule, it follows that there are 37 + 83 =
120 possible ways to pick a representative.
Remember, the product rule states that if there are p ways to do one task and q ways to another task,
then there are pxq ways to do both.
MODULE 4 DISCRETE MATHEMATICS

Multiplication Rule 1: Dependent Event


The occurrence of one event does affect the probability of the other event.
For example, if you draw a King from a deck of cards and do not replace it, it causes the probability of
drawing another King to decrease.
When two events, A and B, are independent, the probability of both occurring is:
P(A and B) = P(A) · P(B)

Experiment 1: A card is chosen at random from a standard deck of 52 playing cards. Without replacing it, a
second card is chosen. What is the probability that the first card chosen is a queen and the second card
chosen is a jack?

Probabilities:
 4 
P(queen on first pick)  = 5
2
 
 4 
P(jack on 2nd pick given queen on 1st
 = 5
pick)
1
 
 4   4    16     4  
P(queen and jack)  = 5  · 5  = 265  = 66
2 1 2 3

Multiplication Rule 2: Independent Event


The occurrence of one event does not affect the probability of the other event.
For example, when flipping a coin, getting “heads” does not change the likelihood of getting “heads” on the
next coin flip.
When two events, A and B, are dependent, the probability of both occurring is:
P(A and B)  =  P(A) · P(B|A)

Experiment 2: Mr. Parietti needs two students to help him with a science demonstration for his class of 18
girls and 12 boys. He randomly chooses one student who comes to the front of the room. He then chooses a
second student from those still seated. What is the probability that both students chosen are girls?

Probabilities P(Girl 1 and Girl 2) = P(Girl 1) and P(Girl 2|Girl 1)


  18 17
 =   · 
30 29
MODULE 4 DISCRETE MATHEMATICS

306
 = 
870

 51 
 = 
145

PRINCIPLE OF INCLUSION EXCLUSION


This rule states that if a task can be done in either p or q ways, the total number of ways to
complete the job is p + q minus the number of ways to do the task that are common to both p and q,
which alleviates the possibility of double counting.

Example #1
In this problem, suppose four cards are chosen at random from a standard 52-card deck, with
replacement. And we wish to determine the number of four-card sequences where all four cards are
from the same suit.
Well, what do we know?
There are four suits in a deck (diamonds, hearts, clubs, spades), which means there are 13 cards in each
suit.
And if we want to determine the number of four-card sequences that are all the same suit, then this
would mean that we would be looking for either all hearts or all diamonds or all clubs or all spades.

Hence, there are 114244 possibilities!


MODULE 4 DISCRETE MATHEMATICS

Example #2
Additionally, what if we were interested in knowing how many integer numbers less than 500 ends with
0?
First, we need to determine how many one-digit numbers are less than 500 and end with 0. Well, there’s
only one number (i.e., “0”) that fits that description, so there’s only one possible way to get this value.
Second, we need to think of all the two-digit numbers that are less than 500 and end with 0. Well, for a
number to have two digits, the first digit can’t be 0, so that means we are limited to choosing digits
ranging from 1-9, and the second digit has to be zero, so there’s only 1 possible value for this.
And finally, we need to think of all the three-digit numbers that are less than 500 and end with zero.
Well, for a number to have three digits, the first digit can’t be 0. And secondly, the number has to be
less than 500, so the digit must be a value of 4 or less. Therefore, our first digit for this three-digit
number ranging from 1-4. Now the second digit can be any value, so that means it can range from 0-9,
and our third digit has to be zero, so there’s only 1 possible value for this.

This means there are 1 + (9)(1) + (4)(10)(1) = 50 different numbers that are less than 500 and end with
0!

PERMUTATION
A permutation is an ordered arrangement of a set of distinct objects. All this means is that
Permutation indicates Placement.

Simply put, the counting principle, or product rule for counting, states that if there are p ways to finish
a task and q ways to complete another task, then there are pq ways to do both.
MODULE 4 DISCRETE MATHEMATICS

But this means there are two possible types of permutations ( ways to order objects), and they depend
on whether repetition is allowed or whether repetition is not allowed.
Let’s suppose there are n objects and we r ways to order them, then:

So, what this indicates is that when we aren’t allowed repetition, we must reduce the number of ways
(choices) to arrange the objects.

Example
Let’s look at a few examples so we can get a better understanding of how permutations work.
Let’s suppose you have 5 pictures, and you want to arrange 3 of them on your wall. How many different
arrangements can be made?
Let’s say the 5 pictures are labeled A, B, C, D, and E for ease of purpose. This means we can arrange
the three images: ABC or ABD or ABE or BCA or CDE, and so on.
This means each of the five photos can be in first, second, or third place on the wall. But what can’t
happen is something like this: AAA or BBB or ABA, etc., because once we hang picture A on the wall,
we can’t hang it somewhere else as it’s already been used. This implies that repetition is not allowed,
and placement (order) matters.
So, for the first spot on the wall, there are 5 possible pictures to choose from (A, B, C, D, E). Let’s say
A is the picture that you choose.
The second spot on the wall has 4 choices (B, C, D, E), as picture A has already been hung. Let’s let D
be chosen.
And our third and final spot on the wall has 3 choices (B, D, E) as pictures A and D have now been
hung up.
So, the total number of picture arrangements given 5 pictures for 3 spots is 5*4*3 = 60.
Let’s write our problem using mathematical notation. We can write our problem as follows:
MODULE 4 DISCRETE MATHEMATICS

Example
Okay, so now let’s suppose we are given the word GRAM, and we are asked to find the number of
arrangements that can be made (they don’t have to spell a word) from the letters in the word GRAM if
repetition is allowed.

With Repetition
Well, there are 4 letters in the word GRAM so that means, if we wanted to, we could say GGGG or
RRRR or AMAM.
You get the idea.
This means we are dealing with an r-permutation with repetition, so we would say there are
4*4*4*4=256 possible 4-letter arrangements.

Without Repetition
Now, let’s assume repetition is not allowed.
This would mean that if we wanted to construct a 4-letter word only using the letters from the word
GRAM, we have 4 choices for the first letter, but once it’s used, we can’t choose it again, so that leaves
3 options for the second letter and 2 choices for the third and 1 choice for the fourth.
In other words, the number of 4-letter arrangements without repetition using the letters from the word
GRAM is 4*3*2*1 = 24.

Example
But now, let’s change things up a bit. Let’s suppose we wanted to know how many distinguishable
permutations there are of the word GRAMMAR.
Notice that this is a bit different because some letters are the same, which means they aren’t unique or
independent. Therefore, while there are 7 letters in the word GRAMMAR, there are only 4
distinguishable letters: G-R-A-M, as there are two Rs, two As, and 2 Ms.
MODULE 4 DISCRETE MATHEMATICS

This means we need a generalized theorem that says:

Alright, so if GRAMMAR has 7 letters, with 1-G, 2-Rs, 2-As, and 2-Ms, this means the number of
distinguishable permutations would be:

Circular Permutation
But what happens if we want to arrange people or objects in a circle?
To do this, we need the division rule or the circular rule for permutations.

Example
For example, notice the circle below where Annie (A), Bobbie (B), Carol (C), and Dan (D) are seated.
MODULE 4 DISCRETE MATHEMATICS

But notice that we can easily arrange these four people in different places at the table, but still maintain
their order (Annie is next to Bobbie, who is beside Carol, followed by Dan).

This means we need to divide by the number of repeated arrangements, which is 4. This will ensure that
one object (person) is fixed, and the remaining objects (people) are arranged relative to that first object.
So, the number of ways to arrange 4 people around a table is

COMBINATIONS
In mathematics, a combination is the number of possible arrangements of objects or elements from a
group when the order of selection doesn’t matter.
Because it doesn’t matter which order you complete these activities, this is no longer a permutation but
a combination, because as I like to think of this…
… a  Combination is when you  Couldn’t Care less about the order —  notice they both start with “C.”
 just like permutations, there are two types of combinations:

 Repetition Allowed.
 Repetition Is Not Permitted.

Without Repetition
Simply put, if we let n be the number of items or objects and r represent the number of subgroups we
wish to select, then:
MODULE 4 DISCRETE MATHEMATICS

Example – Deck Of Cards


Suppose you are given a standard deck of 52 cards.
How many different possible hands of 5 cards can be dealt?
Because each card’s order is not important, and because once you deal a card from the deck, you don’t
put it back in the deck, we are dealing with an example of combinations without replacement.
If we let n represent the 52 cards and r be the 5 cards hands that are dealt, then:

So, there are 2,598,960 possible combinations of 5 card hands that can be dealt with a 52-card deck.

Example – Multiplying Combinations


And combinations can be combined with the fundamental counting principle as if there are  m different
combinations to perform task one and n different combinations to perform task two. We can blend these
combinations using multiplication.
For instance, how many ways can a committee of 3 men and 2 women be chosen from an organization
comprised of 10 men and 12 women?
The way we need to think of this is to assume we are choosing a committee of 3 men from the 10 men
possible and a committee of 2 women from the 12 women possible. Consequently, we multiply the
number of ways that each of these committees can occur as follows:
MODULE 4 DISCRETE MATHEMATICS

Repetition Allowed

Example – Ice Cream


Suppose you walk into an ice-cream shop to buy 5 ice cream cones for you and your four friends.
The store only has 3 different types of ice-cream flavors for sale:

1. Chocolate
2. Vanilla
3. Strawberry
Now, the order doesn’t matter as purchasing a chocolate cone before a vanilla cone won’t make a
difference, but we do have a little bit of a problem — how can we choose 5 ice cream cones when there
are only 3 possible choices to choose from?
Thankfully, we can use the formula for combinations with repetition, which says the number of
combinations of n items taken r at a time with repetition is:

This means, for our ice cream example, if we have n = 3 flavors and r = 5 selections, then the number of
ways you can select 5 ice cream cones is:
MODULE 4 DISCRETE MATHEMATICS

LESSON 5: PROBABILITY, BAYES THEOREM AND PIGEONHOLE

PROBABILTITY
Probability means possibility. It is a branch of mathematics that deals with the occurrence of a
random event. The value is expressed from zero to one. Probability has been introduced in Maths to predict
how likely events are to happen. The meaning of probability is basically the extent to which something is
likely to happen. This is the basic probability theory, which is also used in the probability distribution, where
you will learn the possibility of outcomes for a random experiment. To find the probability of a single event
to occur, first, we should know the total number of possible outcomes.
Probability is a measure of the likelihood of an event to occur. Many events cannot be predicted with
total certainty. We can predict only the chance of an event to occur i.e. how likely they are to happen, using
it. Probability can range in from 0 to 1, where 0 means the event to be an impossible one and 1 indicates a
certain event. Probability for Class 10 is an important topic for the students which explains all the basic
concepts of this topic. The probability of all the events in a sample space adds up to 1.

The probability formula is defined as the possibility of an event to happen is equal to the ratio of the number
of favourable outcomes and the total number of outcomes.

Probability of event to happen P(E) = Number of favourable outcomes/Total


Number of outcomes

Sometimes students get mistaken for “favourable outcome” with “desirable outcome”. This is the basic
formula. But there are some more formulas for different situations or events.

Examples and Solutions


1) There are 6 pillows in a bed, 3 are red, 2 are yellow and 1 is blue. What is the probability of picking
a yellow pillow?
Ans: The probability is equal to the number of yellow pillows in the bed divided by the total number of
pillows, i.e. 2/6 = 1/3.
2) There is a container full of coloured bottles, red, blue, green and orange. Some of the bottles are
picked out and displaced. Sumit did this 1000 times and got the following results:

 No. of blue bottles picked out: 300


 No. of red bottles: 200
 No. of green bottles: 450
 No. of orange bottles: 50
a) What is the probability that Sumit will pick a green bottle?
MODULE 4 DISCRETE MATHEMATICS

Ans: For every 1000 bottles picked out, 450 are green.
Therefore, P(green) = 450/1000 = 0.45
b) If there are 100 bottles in the container, how many of them are likely to be green?
Ans: The experiment implies that 450 out of 1000 bottles are green.
Therefore, out of 100 bottles, 45 are green.

Probability Tree
The tree diagram helps to organize and visualize the different possible outcomes. Branches and ends of the
tree are two main positions. Probability of each branch is written on the branch, whereas the ends are
containing the final outcome. Tree diagrams are used to figure out when to multiply and when to add. You
can see below a tree diagram for the coin:
MODULE 4 DISCRETE MATHEMATICS

Types of Probability
There are three major types of probabilities:

 Theoretical Probability
 Experimental Probability
 Axiomatic Probability

Theoretical Probability
It is based on the possible chances of something to happen. The theoretical probability is mainly based on
the reasoning behind probability. For example, if a coin is tossed, the theoretical probability of getting a
head will be ½.

Experimental Probability
It is based on the basis of the observations of an experiment. The experimental probability can be calculated
based on the number of possible outcomes by the total number of trials. For example, if a coin is tossed 10
times and heads is recorded 6 times then, the experimental probability for heads is 6/10 or, 3/5.

Axiomatic Probability
In axiomatic probability, a set of rules or axioms are set which applies to all types. These axioms are set by
Kolmogorov and are known as Kolmogorov’s three axioms. With the axiomatic approach to probability,
the chances of occurrence or non-occurrence of the events can be quantified. The axiomatic
probability lesson covers this concept in detail with Kolmogorov’s three rules (axioms) along with various
examples.
Conditional Probability is the likelihood of an event or outcome occurring based on the occurrence of a
previous event or outcome.

Probability of an Event
Assume an event E can occur in r ways out of a sum of n probable or possible equally likely ways. Then the
probability of happening of the event or its success  is expressed as;
P(E) = r/n
The probability that the event will not occur or known as its failure is expressed as:
P(E’) = (n-r)/n = 1-(r/n)
E’ represents that the event will not occur.
Therefore, now we can say;
P(E) + P(E’) = 1
This means that the total of all the probabilities in any random test or experiment is equal to 1.

What are Equally Likely Events?


When the events have the same theoretical probability of happening, then they are called equally likely
events. The results of a sample space are called equally likely if all of them have the same probability of
MODULE 4 DISCRETE MATHEMATICS

occurring. For example, if you throw a die, then the probability of getting 1 is 1/6. Similarly, the probability
of getting all the numbers from 2,3,4,5 and 6, one at a time is 1/6. Hence, the following are some examples
of equally likely events when throwing a die:

 Getting 3 and 5 on throwing a die


 Getting an even number and an odd number on a die
 Getting 1, 2 or 3 on rolling a die
are equally likely events, since the probabilities of each event are equal.

Complementary Events
The possibility that there will be only two outcomes which states that an event will occur or not. Like a
person will come or not come to your house, getting a job or not getting a job, etc. are examples of
complementary events. Basically, the complement of an event occurring in the exact opposite that the
probability of it is not occurring. Some more examples are:

 It will rain or not rain today


 The student will pass the exam or not pass.
 You win the lottery or you don’t.

Probability Terms and Definition


Some of the important probability terms are discussed here:

Term Definition Example

Sample Space The set of all the possible 1. Tossing a coin, Sample Space (S) = {H,T}
outcomes to occur in any trial 2. Rolling a die, Sample Space (S) =
{1,2,3,4,5,6}

Sample Point It is one of the possible In a deck of Cards:


results
 4 of hearts is a sample point.
 The queen of clubs is a sample point.

Experiment or A series of actions where the The tossing of a coin, Selecting a card from a deck of
Trial outcomes are always cards, throwing a dice.
uncertain.

Event It is a single outcome of an Getting a Heads while tossing a coin is an event.


experiment.

Outcome Possible result of a T (tail) is a possible outcome when a coin is tossed.


MODULE 4 DISCRETE MATHEMATICS

Term Definition Example

trial/experiment

Complimentary The non-happening events. Standard 52-card deck, A = Draw a heart, then A’ =
event The complement of an event Don’t draw a heart
A is the event, not A (or A’)

Impossible Event The event cannot happen In tossing a coin, impossible to get both head and tail
at the same time

BAYE’S THEOREM
Bayes’ Theorem states when a sample is a disjoint union of events, and event A overlaps this disjoint
union, then the probability that one of the disjoint partitioned events is true given A is true, is:

P(A|B) = P(A) P(B|A)P(B)

Which tells us:   how often A happens given that B happens, written P(A|B),


When we know:   how often B happens given that A happens, written P(B|A)
    and how likely A is on its own, written P(A)
    and how likely B is on its own, written P(B)

Example:

You are planning a picnic today, but the morning is cloudy

 Oh no! 50% of all rainy days start off cloudy!


 But cloudy mornings are common (about 40% of days start cloudy)
 And this is usually a dry month (only 3 of 30 days tend to be rainy, or 10%)

What is the chance of rain during the day?

We will use Rain to mean rain during the day, and Cloud to mean cloudy morning.

The chance of Rain given Cloud is written P(Rain|Cloud)

So let's put that in the formula:

P(Rain|Cloud) = P(Rain) P(Cloud|Rain)P(Cloud)


MODULE 4 DISCRETE MATHEMATICS

 P(Rain) is Probability of Rain = 10%


 P(Cloud|Rain) is Probability of Cloud, given that Rain happens = 50%
 P(Cloud) is Probability of Cloud = 40%

P(Rain|Cloud) = 0.1 x 0.50.4  = .125

Or a 12.5% chance of rain. Not too bad, let's have a picnic!

Example:

Hunter says she is itchy. There is a test for Allergy to Cats, but this test is not always right:

 For people that really do have the allergy, the test says "Yes" 80% of the time
 For people that do not have the allergy, the test says "Yes" 10% of the time ("false positive")

If 1% of the population have the allergy, and Hunter's test says "Yes", what are the chances that Hunter
really has the allergy?

We want to know the chance of having the allergy when test says "Yes", written P(Allergy|Yes)

Let's get our formula:

P(Allergy|Yes) = P(Allergy) P(Yes|Allergy)P(Yes)

 P(Allergy) is Probability of Allergy = 1%


 P(Yes|Allergy) is Probability of test saying "Yes" for people with allergy = 80%
 P(Yes) is Probability of test saying "Yes" (to anyone) = ??%

Oh no! We don't know what the general chance of the test saying "Yes" is ...

... but we can calculate it by adding up those with, and those without the allergy:

 1% have the allergy, and the test says "Yes" to 80% of them
 99% do not have the allergy and the test says "Yes" to 10% of them

Let's add that up:

P(Yes) = 1% × 80% + 99% × 10% = 10.7%

Which means that about 10.7% of the population will get a "Yes" result.

So now we can complete our formula:

P(Allergy|Yes) = 1% × 80%10.7%  = 7.48%

P(Allergy|Yes) = about 7%

PIGEONHOLE PRINCIPLE
MODULE 4 DISCRETE MATHEMATICS

The pigeonhole principle, also known as the Dirichlet principle, originated with German


mathematician Peter Gustave Lejeune Dirichlet in the 1800s, who theorized that given m boxes or
drawers and n > m objects, then at least one of the boxes must contain more than one object.

Interestingly enough, we can generalize the pigeonhole principle using the ceiling function to determine
either the number of pigeons or pigeonholes that fit a scenario.

Example

For instance, suppose there are 35 different time periods during which classes at the local college can be
scheduled. If there are 679 different classes, what is the minimum number of rooms that will be needed?

Therefore, the local college will need 20 different rooms to accommodate the different classes and
periods.

Example

Likewise, let’s suppose we want to know the minimum number of students required in a math class so
that at least six students will receive the same letter grade (A, B, C, D, or F).

This means that if we let n represents the number of students (pigeons), m is the number of letter grades
(pigeonholes), and 6 is the desired outcome (objects), then:
MODULE 4 DISCRETE MATHEMATICS

EXERCISE

Exercises will be posted on the Google Classroom

REFERENCES:
 Levin , O. , Discrete Mathematics: An Open Introduction, 2nd Edition , CreateSpace Independent
Publishing Platform, 2019
 Epp , S., Discrete Mathematics with Applications Fifth edition , Cengage Learning , 2018
 Gallier , J. , Discrete Mathematics , Springer, 2017
 Smid , M., Discrete Structures for Computer Science: Counting, Recursion, and Probability , School of
Computer Science Carleton University Ottawa, Ontario Canada , December 18, 2017
 Hoogerwoord, R. and Zantema,H. , Discrete Structures (2IT50) , August, 2016
 Cartier, P., Choudary, A.D.R. , and Waldschmidt, M., Mathematics in the 21st Century, Springer Basel
Heidelberg New York Dordrecht London, 2015
 Slinko, A., Algebra for Applications Cryptography, Secret Sharing, Error-Correcting, Fingerprinting,
Compression, Springer International Publishing Switzerland, 2015
 Bronshtein, I.N. , Semendyayev , K.A. , Musiol, G. , Muehlig, H., Handbook of Mathematics 6th Ed.,
Springer-Verlag Berlin Heidelberg, 2014
 Doer , A. and Levasseur , K., Applied Discrete Structures , Pearsons Education, Inc. , 2013
Rosen, K, Discrete Mathematics and Its Applications, 7th Ed. , The McGraw-Hill Companies, Inc.,
2012

You might also like