Counting Probability
Counting 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.
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.
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
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
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?
306
=
870
51
=
145
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.
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
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
So, there are 2,598,960 possible combinations of 5 card hands that can be dealt with a 52-card deck.
Repetition Allowed
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
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.
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.
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.
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:
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:
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}
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.
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:
Example:
We will use Rain to mean rain during the day, and Cloud to mean cloudy morning.
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)
... 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
Which means that about 10.7% of the population will get a "Yes" result.
P(Allergy|Yes) = about 7%
PIGEONHOLE PRINCIPLE
MODULE 4 DISCRETE MATHEMATICS
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
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