Fundamental Principles of Counting

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Fundamental Principles of Counting

Fundamental Principle of Multiplication:


• If there are two jobs such that
– one of them can be completed in m ways
– second job can be completed in n ways
• when the first job has been completed in
any one of the m ways,
• then the two jobs in succession can be
completed in m × n ways.
Fundamental Principle of Addition:
• If there are two jobs such that
– one of them can be completed in m ways
– second job can be completed in n ways
• then either of the two jobs can be
completed in m + n ways.
Example:
– In a class there are 3 boys and 4 girls.
– The teacher wants
• to select a boy and a girl to represent the class in a
function.
• to select either a boy or a girl to represent the
class in a function.
– In how many ways can the teacher make this
selection?
– Ans:
• 3x4
• 3+4
• A room has 8 doors, in how many ways
can a man enter the room through one
door and come out through a different
door?
– Ans: 8 x 7

• The flag of a newly formed forum is in the


form of three blocks, each to be colored
differently. If there are six different colors
on the whole to choose from, how many
such designs are possible?
– Ans: 6 x 5 x 4
• How many words (with or without
meaning) of three distinct letters of the
English alphabets are there?

– Ans: 26 × 25 × 24

• Find the total number of ways of


answering 5 objective type questions,
each question having four choices.

– Ans: 4 x 4 x 4 x 4 x 4 or 45
• Five persons entered the lift cabin on the ground
floor of an 8-floor house.
• Suppose each of them can leave the cabin
independently at any floor beginning with the
first.
• Find the total number of ways in which each of
the five persons can
• leave the cabin
i. at any one of the 7 floors
ii. at different floors.
• Ans:
i. 75
ii. 7 × 6 × 5 × 4 × 3
Permutation
A permutation is an ordered arrangement of
objects.
Example:
• If there are three objects (a, b, c),
• Permutations of these objects, taking two at a
time, are
• ab, ba, bc, cb, ac, ca.
• Total Number of permutations of n distinct
things, taken r at a time is denoted by nPr.
nP = n(n − 1)(n − 2)...(n − (r − 1))
r
= n! / (n − r)!
Examples:
• Seven athletes are participating in a race. In how
many ways can the first three prizes be won?
• 7P3
• How many different signals can be made by 5
flags from 8 flags of different colors?
• 8P5
• In how many ways can 6 persons stand in a
queue?
• 6P6
• It is required to seat 5 men and 4 women in a
row so that the women occupy the even places.
How many such arrangements are possible?
• 4P4 × 5P5
• Three men have 4 coats, 5 shirts and 6 caps. In
how many ways can they wear them?
• 4P3 × 5P3 × 6P3
Combinations
Each of the different selections made by taking
some or all of a number of objects, irrespective
of their arrangements is called a combination.
• Example: Combinations of three letters taking
two at a time, are
• ab, bc, ac
• The Number of all combinations of n objects,
taken r at a time is denoted by .

n
n
Cr or  
r
• nCr = Number of ways of selecting r
objects from n objects

n!
n
Cr = = Cn − r
n

(n − r )!r!
Examples:
• If there are 12 persons in a party, and if each two
of them shake hands with each other, how many
handshakes happen in the party?
• 12C
2
• A question paper has two parts, Part A and Part B, each
containing 10 questions. If the student has to choose 8
from Part A and 5 from Part B, in how many ways can he
choose the questions?
• 10C8 x 10C5
• In how many ways a committee of 5 members can be
selected from 6 men and 5 women, consisting of 3 men
and 2 women?
• 6C3 x 5C2
• In how many ways can a cricket eleven be chosen out of
a batch of 15 players if
– (i) there is no restriction on the selection;
– (ii) a particular player is always chosen;
– (iii) a particular player is never chosen?
• 15C11 , 14C ,
10
14C
11
Probability Theory
• If an experiment is repeated under
homogeneous conditions we generally come
across two types of outcomes-

▪ When outcome is certain (deterministic phenomenon)

▪ When outcome is not certain but is one of the several


possible outcomes (random phenomenon)
• In tossing of a coin, one is not sure if a head or tail
will be shown on the upper face of the coin.

• Probability theory deals with the study of random


phenomena.
• Random Experiment is an experiment which results in any one of
the possible outcomes, though repeated under identical conditions.
Actual result can not be predicted.

• Sample Space is an exhaustive list of all the possible outcomes of


a random experiment.

• The repetitions of the experiment are known as trials.


• An individual outcome of a sample space is called a simple event.
• An event is a collection of one or more simple events in a sample
space.
• The outcomes favorable to an event in a trial are called as
favorable outcomes.
• All the possible outcomes in any trial are together known as
exhaustive events.
• Events are said to be mutually exclusive or disjoint, if the
happening of any one of them rules out the happening of all the
others. No two or more of them can happen simultaneously.
• The events are said to be equally likely, if there is no
reason to expect one in preference to the others.

• The events are said to be independent, if the happening


of an event does not affect the happening of any other
event.

• The event ‘ A occurs’ and the event ‘ A does not occur’


are called complementary events to each other.

• The event ‘A does not occur’ is denoted by Ac or A or A’.

• The event and its complements are mutually exclusive.


Classical Definition (or a-priori definition):
The Probability of an event A is defined a-priori
without actual experimentation as

Number of outcomes favorable to A


P( A) = ,
Total number of possible outcomes

provided all these outcomes are equally likely.


Example: Consider a box with n white and m red
balls. Select one ball from the box at random.

n
Probability of “selecting a white ball”= .
n+m
• In general
– S is a sample space
– A is some event in S.A( S)
– nA is the number of occurrences of A
– n is the total number of outcomes.
– The Probability of event A is nA
P( A) =
n
• P(A) satisfies following 3 axioms:
(i) 1  P( A)  0
(ii) P( S ) = 1 (Sum of the probablities of all outcomes in
S must be 1)
(iii) P( A  B) = P( A) + P( B), provided A  B = 
• Addition Law of Probability
▪ P(AUB) = P(A) + P(B) – P(A ∩B)
– P(AUB) = P(A) + P(B), provided A∩B = φ
– A∩B = φ means A and B are mutually exclusive
Examples:
• What is the chance that a leap year selected at random
will contain 53 Sundays?
Ans: 2/7
• A bag contains 3 red, 6 white and 7 blue balls. What is
the probability that two balls drawn, at random, are white
and blue?
Ans: .35 (Without Replacement)
• Two cards are drawn at random from a well shuffled
pack of 52 cards. What are the chances of drawing two
aces?
Ans: 1/221 (Without replacement)
• Three cards are drawn from a well shuffled pack of 52
cards. What are the chances that they are a K, a Q and
a J?
Ans: 16/5525 (Without replacement)
Examples:
Consider a biased coin with probability of Heads as 1/3 and of
Tails as 2/3. The coin is tossed 5 times. What is the
probability of getting 2 Heads?

A fair coin is tossed repeatedly. What is the probability of


getting the first Head?

These questions can not be answered using the classical


definition of probability.

Limitations of Classical Definition:


▪ When the outcomes are not equally likely;
▪ When the exhaustive number of cases in a trial is infinite.
Examples:
• A survey of 300 households, who purchased big screen TV sets,
was done. Following table indicates the consumers’ responses to
whether the TV set purchased was a plasma screen and whether
they also purchased a DVR in the past 12 months.
DVR
Yes No Total
Plasma Screen Yes 38 42 80
No 70 150 220
Total 108 192 300

• Obtain the probability that a randomly selected household


purchased
– A plasma screen TV
– A DVR
– A Plasma Screen TV and A DVR
– A Plasma Screen TV or A DVR
Idea of Conditional Probability
• Example:
• Suppose a family has 2 children.
i. What is the probability that both are boys?
ii. What is the probability that both are boys given that
at least one of them is a boy?
• Sample space S= {(b,b),(b,g),(g,b),(g,g)}
• Let A be the event that both are boys then
• A= {(b,b)}.
• So P(A)=1/4.
• Let B be the event that at least one of them is boy then
• B= {(b,b),(b,g),(g,b)}.
• So the probability that both are boys given at least one of
them is a boy is
• P(A given that B has already occurred)=1/3
• Another Example:
• Suppose that we throw a fair dice twice.
• What is the probability of getting 6 as the sum of two
outcomes?
• The favorable event
• A= {(5,1),(1,5),(4,2),(2,4),(3,3)}.
• Total number of cases is 36.
• So P(A)=5/36
• If it is given that on the 1st throw we have already seen 4.
• What is the probability of getting the sum as 6?
• B = {(4,1),(4,2),(4,3),(4,4),(4,5),(4,6)}
• A1= {(4,2)}
• P(A1)=1/6
Conditional Probability
• Consider two events A and B
• Conditional probability of event A given that B
has already occurred is given by

n( A  B ) n( A  B ) n( B )
P( A | B) = =
n( B ) n( S ) n( S )
P( A  B)
= , ( P( B)  0)
P( B)
• A box contains 4 bad and 6 good tubes.
• Two are drawn from the box one by one without
replacement.
• First one is tested and found to be good.
• What is the probability that the second one is also good?
• Ans: 5/9

• A person figures out that there is a 30 percent chance


that his company will set up a branch at Delhi.
• If it does, he is 60 percent certain that he will be made
manager of the new branch.
• What is the probability that his company will set up a
branch at Delhi and he will be the manager of the new
branch?
• Ans: 0.30x0.60
• Example:
• An unbiased coin is tossed two times.
• What is the chance of getting a head on the second
toss?
• Sample space S = {HH,HT,TH,TT}
• Let A = {HH,TH} (getting a head on the second toss)
• So, P(A)=2/4 =1/2.
• If we have already seen head on the 1st toss.
• What is the probability of getting a head on the second
toss?
• Let B= {HH,HT} (getting a head on the first toss)
• P(A given that B has already occurred)=1/2= P(A) !!
• Is it just a coincidence?
Joint Probability
• For two events A and B, what is the probability that both
events take place.
• P(A and B) or P(AB)
• View this as a two step process:
▪ A occurs.
▪ Given that A has occurred, B occurs.
• P(A  B) = P(A). P(B|A).
• A die toss example: New Sample Space
▪ A : outcome is less than 5
▪ B : outcome is a multiple of 3 4 3 6 5
A 2
• P(A) = 4/6, P(B) = 2/6, 1 B
• P(B|A) = ¼
• P(A and B) = (4/6).(1/4) = 1/6
• If A and B are independent events, then
occurrence of B is not affected by
occurrence or non-occurrence of A.
• P(B|A) = P(B)
• From the formula of conditional probability,
• P(A  B) = P(A).P(B)
Total Probability Formula
• Consider a mutually exclusive and exhaustive set of
events: A1, A2, A3,…An
• Let B be some event in the same sample space.
P(B) = P(BA1)+P(BA2)…..+P(BAn)
= P(A1)P(B|A1)+P(A2)P(B|A2)….+P(An)P(B|An)

• P(B) is also called as unconditional or marginal


probability of B.

A1 A4
B

A2 A3
Example:

A factory has 3 machines that make parts.

Machine A makes 20% of which 6% are defective


Machine B makes 30% of which 7% are defective
Machine C makes 50% of which 8% are defective

What is the probability that a random part is defective?


Bayes’ Theorem
• Card drawing experiment.
• A : King on first draw, B : King on second draw
• P(A) = 4/52, P(B|A) = 3/51.
• P(A|B) = ?
• Joint probability formula: P(A  B) = P(A).P(B|A)
• Interchange A and B, P(A  B) = P(B).P(A|B)
• Using two relations, we get
• P(A).P(B|A) = P(B).P(A|B)
• Solve it for P(A|B)
• P(A|B) = [P(A).P(B|A)] / P(B)
• We have from total probability formula:
• P(B) = P(A)P(B|A) + P(Ac)P(B|Ac)
• Thus
• P(A|B) = [P(A).P(B|A)] / [P(A)P(B|A) + P(Ac)P(B|Ac)]
Generalized version of Bayes’ theorem

• A1, A2, A3,…An are mutually exclusive and


exhaustive events.

• B be some event in the same sample space.

• Then

P( B | Ak ) P( Ak ) P( B | Ak ) P( Ak )
P( Ak | B) = = n .
 P( B | Ai ) P( Ai )
P( B)
i =1
• Example:
• An assembly plant receives parts from three
suppliers S1, S2 and S3.
• Fifty percent of supply comes from S1, and 25
percent from S2 and S3 each.
• Parts supplied by these three suppliers contain
5%, 10% and 12% defective parts respectively.
• If a part is chosen at random from the stock
room, what is the probability that it is defective?
• If a randomly selected part was found to be
good, what is the probability that it came from
S2?
Ans: .08, .2445
• Example:
• Two boxes B1 and B2 contain 100 and 200 light
bulbs respectively.
• Box B1 has 15 defective bulbs.
• Box B2 has 5 defective bulbs.
• Suppose a box is selected at random and one
bulb is picked out.
• What is the probability that it is defective?
• Suppose we test the bulb and it is found to be
defective. What is the probability that it came
from box B1?
Ans: .0875, .8571
A market survey was conducted in four cities to find out the
preference for brand ‘A’ soap. The responses are shown
below:
DELHI KOLKATA CHENNAI MUMBAI
YES 45 55 60 50 210
NO 40 50 40 50 180
85 105 100 100 390
A) What is the probability that a consumer selected at random,
preferred brand A?
B) Probability that a consumer preferred brand A and was from
Chennai ?
C) Probability that a consumer preferred brand A given that he
was from Chennai ?
D) Given that a consumer preferred brand A, what is the
probability that he was from Mumbai ?

Sol: A) 210/390 B) 60/390 C) 60/100 D) 50/210


Example:
• In a lot of used cars
• 70% have air conditioning (AC)
• 40% have a CD player (CD)
• 20% of the cars have both.
• What is the probability that a car has a CD player,
given that it has AC ?
• We want to find P(CD | AC).
CD No CD Total
AC 0.2 0.5 0.7
No AC 0.2 0.1 0.3
Total 0.4 0.6 1.0
0 .2
Given AC or no 0 .7
AC: P(AC and CD) =
0.2

P(AC and CD/) =


0 .5
0.5
0 .7
All
Cars 0 .2
0 .3
P(AC’ and CD) =
0.2

P(AC’ and CD/) =


0.1 0.1
0.3
Given CD or no 0 .2
CD: 0 .4
P(CD and AC) =
0.2

P(CD and AC’) =


0 .2
0.2
0 .4
All
Cars 0 .5
0 .6
P(CD’ and AC) =
0.5

P(CD’ and AC’) =


0 .1 0.1
0 .6
Practice questions:

2.11, 2.12, 2.13, 2.18, 2.19, 2.21, 2.23, 2.27, 2.29,


2.33, 2.40, 2.41, 2.52, 2.57, 2.79, 2.80, 2.82, 2.83,
2.85, 2.88, 2.89, 2.95, 2.105

Solved Examples: 2.9, 2.10, 2.11

You might also like