Fundamental Principles of Counting
Fundamental Principles of Counting
陳彥良
中央大學資管系
1.1. The rules of sum and product
The rule of sum: If a first task can be
performed in m ways, while a second task
can be performed in n ways, and the tasks
cannot be performed simultaneously, then
performing either task can be accomplished
in any one of m+n ways.
Ex 1.4
The boss assigns 12 employees to two
committees.
Committee A consists of five members.
Committee B consists of seven members.
If the boss speak to just one member
before making a decision, …?
If he speak to one member of committee A
on the first day, and another member of
committee B on the second day, …?
The rule of product
If a procedure can be broken down into first
and second stages, and if there are m
possible outcomes for the first stage and if,
for each of these outcomes, there are n
possible outcomes for the second stage,
then the total procedure can be carried out,
in the designated order, in mn ways.
Ex 1.6
A license plate consists of two letters
followed by four digits.
If no letter or digit can be repeated?
If repetitions of letters and digits are
allowed?
If repetitions of letters and digits are
allowed, how many of the plates have only
vowels (A, E, I, O, U) and even digits?
Ex 1.7
In some simple computers, one-byte
address is used to identify the cells in main
memory.
Some uses two-byte address.
Some uses four-byte address.
Some even uses eight-byte address.
1.2 Permutations
Definition 1.1. n factorial is defined by (a) 0!
=1; n!=n(n-1)(n-2)…(2)(1)
Definition 1.2. Given a collection of n distinct
objects, any (linear) arrangement of these
objects is called a permutation of the
collection
The number of permutations of size r from a
collection of n distinct objects is P(n,
r)=n!/(n-r)!.
Examples
Ex 1.9. In a class of 10 students, five are to
be chosen and seated in a row for a picture.
How many such linear arrangements are
possible?
Ex 1.10. If five letters are to be chosen from
COMPUTER, how many arrangements are
there?
Ex 1.11
The number of arrangements of the four letters in BALL
is 12, not 24.
2 (number of arrangements of the letters B, A, L, L) =
(number of arrangements of the letters B, A, L1, L2)
Ex 1.12
How many of arrangements are there in all
nine letters in DATABASES.
2! 3! (number of arrangements of the
letters DATABASES) = (number of
arrangements of the letters D, A1, T, A2, B,
A3, S1, E, S2)
Permutation with repetition
If there are n objects with n1 indistinguishable
objects of a first type, n2 indistinguishable
objects of a second type,…, and nr
indistinguishable objects of an rth type, where
n1+n2+…+nr=n, then there are
n!
n1! n 2 !...n r !
arrangements of the given n objects.
Ex 1.14
Determine the number of staircase paths
from (2,1) to (7,4), where each path is made
up of individual steps going one unit to the
right (R) or one unit upward (U).
What does RURRURRU stands for?
What does URRRUURR stands for?
There are 8!/5!3!=56 possible paths.
Ex 1.16
If six people are seated about a round table,
how many different circular arrangements
are possible, if arrangements are
considered the same when one can be
obtained from the other by rotation.
6 (number of circular arrangements) =
(number of linear arrangements)
Consequently, there are 6!/6=5!
arrangements.
Ex 1.17
Suppose that the six people are three
married couples.
We want to arrange the six people around
the table so that the sexes alternate.
A female is placed first.
The next position can be placed in three
ways.
The answer is 32211=12.
1.3. Combinations : The binomial
theorem
We start with 52 cards, and how many ways
are there that we can select three of these
cards, with no reference to order?
(3!)(number of selections of size 3 from a
deck of 52 cards) = number of permutations
of size 3 for the 52 cards
C(n, r)=P(n, r)/r!=n! / r! (n-r)!
C(n, r)= C(n, n-r)
Ex 1.19
To win the grand prize for PowerBall one
must match five numbers selected from 1 to
49 inclusive and then must also match the
powerball, an integer from 1 to 42 inclusive.
There are totally C(49,5) C(42, 1) =
80089128 combinations we can select the
six balls.
Ex 1.20
If the student must answer any seven of ten
questions….
If the student must answer three questions
from the first five and four questions from
the last five….
If the student must answer seven of ten
questions, where at least three are selected
from the first five…..
Ex 1.23
The number of arrangements of the letters
in TALLAHASSEE is 11!/ 3! 2! 2! 2! 1! 1!
=831600
How many of them have no adjacent A’s?
The answer is C(9, 3) (8!/ 2! 2! 2! 1! 1!)=84
5040=423360. (Why)
Ex 1.24
alphabet ={0, 1, 2},
A string x=x1x2…xn is made up from a prescribed
alphabet symbols
the weight of a string wt(x)= x1+x2+…+xn
Among the 310 strings of length 10, how many
have even weight?
A string has even weight if and only if the number
of 1’s in the string is even.
Number of 1’s can be 0, 2, 4, 6, 8, 10
210 + C(10, 2)28+C(10, 4)26+C(10, 6)24+C(10,
8)22+C(10, 10)
Ex 1.25
Suppose that we draw five cards from a standard
deck of 52 cards.
a) In how many ways can we have a hand with no clubs?
C(39, 5)
b) In how many ways can we have a hand with at least
one club? C(52, 5)-C(39, 5)
c) The same question as in (b), but we compute in
another way. C(13, 1)C(51, 4)
d) an over-counting problem occurs in part (c), why over-
counting?
e) Another way to get the result of (b): C(13, 1)C(39, 4) +
C(13,2)C(39, 3) + C(13, 3)C(39, 2) + C(13, 4)C(39, 1)
+ C(13,5)
The Binomial Theorem
If x and y are variables and n is a positive
integers, then we have