A n - PCC

advertisement
Counting and probability
•What do you mean by counting?
•How do you count things in daily life?
•Counting the European way or the English speaking way?
•8 days a week (not the Beatles song)?
1.1 Linear Series Rule.
If m and n are integers such that m n, then there are nm+1 integers from m to n inclusive. 1.1 Linear Series Rule.
Example 1: How many integers are there in the sequence 10, 11,
12, …, 19, 20?
Example 2: How many integers are there in the sequence -8,-7,6,…-1,0,1,2,…4, 5?
Example 3: How many integers are there in 0 to 1000 inclusive,
that are divisible by 3.
1.1 Linear Series Rule.
If m and n are integers such that m n, then there are nm+1 integers from m to n inclusive. 1.1 Linear Series Rule.
Example 1: How many integers are there in the sequence 10, 11,
12, …, 19, 20?
Ans: 20 – 10 + 1 = 11
Example 2: How many integers are there in the sequence -8,-7,6,…-1,0,1,2,…4, 5?
Ans: 5 – (–8) + 1 = 14
Example 3: How many integers are there in 0 to 1000 inclusive,
that are divisible by 3.
The integers are 0,3,6,9,…,996,999 , which are in the form 3k,
where k = 0,1,2,…,333.
Hence there are 333-0+1 = 334 integers from 0 to 1000 which are
divisible by 3.

What is Probability?
A coin has a 50% chance of landing heads. What does that mean?

The coin will land heads 50% of the time?
not really.

The coin will land heads approximately 50% of the time?
Then the probability is approximately 50%, not exactly 50%.
It means that the fraction of the time that the coin lands heads will get
arbitrarily close to 50% as the number of coin tosses increases without
bound.
The Sample Space
•An experiment is a procedure that leads to an outcome.
Toss a coin.
• We observe a characteristic of the outcome.
Which side landed up?
• The sample space is the set of all possible observations/ outcomes.
Sample space = {H, T}
•An event is a collection of possible observations, i.e., a subset of the
sample space.
E(H) = 1
A sample space is the set of all possible outcomes of a random process
or experiment. An event is a subset of a sample space.
Some points to ponder.
•The processes are random, i.e. some set of outcomes is sure to occur
but it is impossible to predict with certainty which one.
•We will consider only finite sample spaces.
•The probability of an event is the sum of the probabilities of its
individual members.
• If the members of the sample space are equally likely, then P(E) =
|E|/|S|.
•If the n members of the sample space are equally likely, then the
probability of each member is 1/n.
•Examples Toss a coin, P(H) = 1/2. Roll a die, P(3) = 1/6.
Possibility Trees and the
Multiplication Rule
•Often, an experiment may be viewed as a sequence of simple
procedures, or sub-experiments.
• An outcome of the experiment will be a sequence of outcomes of
the sub-experiments.
•To analyze the experiment, we should first analyze the subexperiments.
•Draw three cards, with replacement, from a shuffled deck
 1st sub-experiment:
Draw the 1st card.
2nd sub-experiment:
Draw the 2nd card.
 3rd sub-experiment:
Draw the 3rd card.
•What is the sample space? Are the outcomes equally likely? What if
we drew without replacement?
•A possibility tree Starts at a root.
Has one level for each sub-experiment.
At each level, shows a set of branches for all the possibilities
(sample space) of that sub-experiment.
•If
sub-experiment #1 has m possible outcomes
• and
sub-experiment #2 has n possible outcomes (no matter how
sub-experiment #1 turned out),
• then
the two sub-experiments in sequence have mn possible
outcomes.
Multiplication Rule
If an operation consists of a sequence of steps/events E1, E2 … Ek and if
each Ei can be performed in ni ways regardless of how the previous steps E1, …
Ei-1 were performed (i.e. independent), then the entire operation can be
performed in n1´n2´…´nk ways.




Examples
Toss 5 coins: 2  2  2  2  2 = 32 possibilities
Roll 3 dice: 6  6  6 = 216 possibilities
Draw 5 cards (without replacement): 52  51  50  49  48 = 311,875,200
possibilities
Example 1:What is the maximum number of possible 3-letter English words with the
pattern consonant-vowel-consonant?
Example 2: How many odd numbers greater than 3000 can be formed by using each of
the digits 1, 2, 3, and 4 once?
Example 3: A car license plate has 3 letters of alphabet followed by 4 single digit
numbers. How many different car licenses can be issued (a) if repetitions of
alphabets/numbers in the license plate is allowed; (b) if repetitions are not
allowed?
Example 4: (Limitations of the Multiplication Rule)
Two teams A and B are to play each other repeatedly until one wins two games in
a row, or until a total of 3 games. How many ways can a tournament be played?
A wins
A wins
B wins
B wins
A wins
B wins
A wins
A wins
B wins
Why do the rules of multiplication not apply here?
B wins
Example 5: Three officers – A president, a treasurer, and a secretary, are to be
chosen from among 4 people: A, B, C, D. Suppose that A cannot be president, and
either C or D must be secretary. How many ways can the officers be chosen?
Selecting three officers can be broken down to the following tasks:
Step 1: Select the president : 3 ways.
Step 2: Select the treasurer : 3 ways.
Step 3: Select the secretary : 2 ways.
Total number of performing the task = 3 .3 .2 ways
Example 5: Three officers – A president, a treasurer, and a secretary, are to be
chosen from among 4 people: A, B, C, D. Suppose that A cannot be
president, and either C or D must be secretary. How many ways can the
officers be chosen?
Goal Re-ordering is a possible way to by-pass dependency of tasks
1.
Select the president: 3 ways
2.
Select the treasurer: number of ways DEPENDENT on the outcome of step 1!!!
3.
Select the secretary: number of ways DEPENDENT on the outcome of step 2, which is
in turn, DEPENDENT on step 1.
C
B
start
A
C
D
D
D
C
A
D
B
D
A
C
B
C
C
D
(Goal Re-ordering is a possible way to by-pass dependency of tasks)
Step 1: Select the secretary : 2 ways (C or D).
Step 2: Select the president : 2 ways regardless of the choice taken in step 1 (person
B with the remaining person from step 1)
Step 3: Select the treasurer : 2 ways. (person A with the person remaining from step
2)
Total number of performing the task = 2 * 2 * 2 ways
C
B
start
A
C
D
D
D
C
A
D
B
D
A
C
B
C
C
D
Each step is independent of the choices of previous step.
The number of ways of each step is independent of the choices of
the previous step
Permutations
•
•
•
A permutation of the elements of a set is an ordering of those elements.
Distinct orderings are distinct permutations.
The permutations of {a, b, c} are abc, acb, bac, bca, cab, and cba.
1.
a permutation of a set S of n distinct objects is an ordered list of these objects
2.
an r-permutation is an ordered list of r elements of S
S={1,2,3}, all permutations={(1,2,3),(2,1,3),(1,3,2),(2,3,1),(3,1,2),(3,2,1)}
all 2-permutations={(1,2),(2,1),(1,3),(3,1),(2,3),(3,2)}
1 r  n
3.
the number of r-permutations of a set S with n elements is written as P(n,r).
4.
If n and r are integers such that
, then
P(n,r) = n*(n-1)*(n-2)*...*(n-r+1) = n!/(n-r)!
5.
P(n,n) = n! / (n-n)! = n!
• 6. CIRCULAR PERMUTATIONS
– The number of ways of permuting r objects from a set of n
objects in a circle (in which two arrangements are the same when
one is a rotation of the other) is P(n,r) / r.
• 1. How many different ways can a salesman visit 8 cities?
• 2. How many different ways can 10 horses in a race win, place and
show (come in first, second, third)?
Addition and Difference rule
Theorem: Let {A1, …, An} be a partition of a set A.
Then |A| = |A1| + … + |An|.
Corollary: Let {A1, …, An} be a collection of pair wise disjoint finite sets.
Then |A1  …  An| = |A1| + … + |An|.
Addition Rule:
If a finite set A = A1 A2 An where all the Ai’s are mutually
disjoint, then |A| = |A1| + |A2| + + |An|
Difference Rule:
If A is a finite set and BA, then |A – B| = |A| – |B|
Example 1: A computer access code word consists of one to three letters,
chosen from the 26 alphabets, with repetitions allowed. How many code
words are possible?
Set of all code words of length 3
Set of all
code words
of length 1
Set of all
code words
of length 2
Set of all
code words
of length 3
• By addition rule: |Set of all code words of length 3 |
= | Set of all code words of length 1 |
+ | Set of all code words of length 2 |
+ | Set of all code words of length 3 |
Example 1: A computer access code word consists of one to three letters,
chosen from the 26 alphabets, with repetitions allowed. How many code
words are possible?
Set of all code words of length 3
Set of all
code words
of length 1
•
•
•
•
Set of all
code words
of length 2
Set of all
code words
of length 3
Number of code words of length 1 = 26
Number of code words of length 2 = 262 (Multiplication Rule)
Number of code words of length 3 = 263 (Multiplication Rule)
Total number of code words = 26 + 262 + 263 (Addition Rule)
Basic Rules: Addition/Difference Rule
Example 2: There are 15 different computer science books, 12 different math
books, and 10 different chemistry books on the shelf. How many ways can
we select 2 books, each from a different subject?
Set of selections of 2 books
1 book from
CS and 1 book
Math
1 book from
CS and 1 book
from Chemistry
1 book from
Math and 1
book from
Chemistry
• By addition rule: |Set of selections of 2 books|
= | Set of selection of 1 book from CS and 1 book from Math |
+ | Set of selection of 1 book from CS and 1 book from Chem |
+ | Set of selection of 1 book from Math and 1 book from Chem |
Example 2: There are 15 different computer science books, 12 different math
books, and 10 different chemistry books on the shelf. How many ways can
we select 2 books, each from a different subject?
Set of selections of 2 books
1 book from
CS and 1
book Math
15  12
(M.R.)
+
1 book from
CS and 1
book from
Chemistry
15  10
(M.R.)
1 book from
Math and 1
book from
Chemistry
+
12  10
(M.R.)
Basic Rules: Addition/Difference Rule
Example 3: A group of eight people are attending the movies together. If two
of the eight people are enemies and do not want to sit next to each other,
how many ways can this group sit in a row, such that the two enemies are
separated?
Answer:
Different arrangements of 8 people in a row = 8! (by multiplicaton rule)
Different
arrangements of
8 people in a row
where the 2
enemies sit next
to each other
Different
arrangements of
8 people in a row
where the 2
enemies sit apart
How?
Step 1: Sit the 1st person: 8 ways
Step 2: Sit the 2nd person: 7 ways
regardless of outcome of step 1.
Step 3: Sit the 3rd person: 6 ways
regardless of outcome of step 1-2.
…
Basic Rules: Addition/Difference Rule
Example 3: A group of eight people are attending the movies together. If two
of the eight people are enemies and do not want to sit next to each other,
how many ways can this group sit in a row, such that the two enemies are
separated?
Answer:
Different arrangements of 8 people in a row
Different
arrangements of
8 people in a row
where the 2
enemies sit next
to each other
Different
arrangements of
8 people in a row
where the 2
enemies sit apart
= 8!
= 2*7 !
(by
multiplicaton rule)
How?
Step 1: Sit the 2 enemies
together: 2*7 ways
Step 2-7: Sit the remaining 6
people: 6*5*4*3*2*1
OR… Another way of looking at it:
Step 1: Combine the 2 enemies as 1 person and take it as an arrangement of 7 people
to 7 chairs, (7!).
Step 2: Different ways of arranging the 2 enemies to sit side-by-side: 2 ways.
Basic Rules: Addition/Difference Rule
Example 3: A group of eight people are attending the movies together. If two
of the eight people are enemies and do not want to sit next to each other,
how many ways can this group sit in a row, such that the two enemies are
separated?
Answer:
Different arrangements of 8 people in a row
Different
arrangements of
8 people in a row
where the 2
enemies sit next
to each other
Different
arrangements of
8 people in a row
where the 2
enemies sit apart
= 8!
= 2*7!
(by multiplicaton rule)
Answer = 8! – 2*7!
(Difference Rule)
Basic Rules: Addition/Difference Rule
Example 4: How many integers are there in 1000 to 9999 that contain at least
a digit 5.
Answer
= (Number of integers in 1000 to 9999) –
(Number of integers in 1000 to 9999 that do not contain a digit 5)
(Difference Rule)
= (9999 – 1000 + 1) – 8.93
(Linear Series Rule) (Multiplication Rule)
= 3168
If S is a finite sample space and A is an event in S, then
P( Ac )  1  P( A)
Page 298 example 6.3.3
Basic Rules: Addition/Difference Rule
Example 5: How many 3 digit numbers have at least one digit repeated?
Answer
= Number of 3 digit numbers
Number of 3 digit numbers which have NO digit repeated
(Difference Rule)
(9 *10 *10)
Multiplication Rule:
Step 1: Choose hundredths
digit (must exclude leading ‘0’,
therefore only 9 ways)
Step 2: Choose tenths digit
Step 3: Choose units digit
–
(9 *9 *8)
Multiplication Rule:
Step 1: Choose hundreths digit
(must exlude leading ‘0’)
Step 2: Choose tenths digit
(10 ways, excluding the digit
in step 1. Therefore 9 ways)
Step 3: Choose units digit
Basic Rules: Inclusion-Exclusion Rule
1.4Inclusion-Exclusion Rule:
• (For 2 sets) Given any sets A and B,
|A  B| = |A| + |B| – |A  B|
• (For 3 sets) Given any sets A, B and C,
|A  B  C | = |A| + |B| + |C| – |A  B| – |A  C| – |B  C|
+ |A  B  C|
• (For n sets) Given any sets A1 … An,
| A1
 …  An |
=
–

i{1,..., n}

| Ai |
i, j {1..n} i, j distinct
+

 Aj |
| Ai  Aj  Ak |
| Ai
i, j,k {1..n} i, j,k distinct
– …
The pattern is to add “one at a time”, subtract “two at a time”, and add “three
at a time” and so on.
Basic Rules: Inclusion-Exclusion Rule
Example 1: How many integers from 1 through 1000 are multiples of 3 or 5?
How many are neither multiples of 3 nor 5?
Answer:
|{Integers of multiples of 3 or 5}|
= |{Integers of multiples of 3}|
+ |{Integers of multiples of 5}|
– |{Integers of multiples of 3 and 5}|
(Inclusion-Exclusion Rule)
Multiples
of 3
Multiples
of 5
All integers
fom 1 to 1000
Basic Rules: Inclusion-Exclusion Rule
Example 1: How many integers from 1 through 1000 are multiples of 3 or 5?
How many are neither multiples of 3 nor 5?
Answer:
|{Integers of multiples of 3 or 5}|
= |{Integers of multiples of 3}|
+ |{Integers of multiples of 5}|
– |{Integers of multiples of 3 and 5}|
(Inclusion-Exclusion Rule)
|{Integers of multiples of 3}| = |{3k | where k = 1,2,…333}| = 333
|{Integers of multiples of 5}| = |{5k | where k = 1,2,…200}| = 200
|{Integers of multiples of 3 and 5}| = |{15k | where k = 1,2,…66}| = 66
Ans = 333 + 200 – 66= 467
Basic Rules: Inclusion-Exclusion Rule
Example 1: How many integers from 1 through 1000 are multiples of 3 or 5?
How many are neither multiples of 3 nor 5?
Question: How many are neither multiples of 3 nor 5?
Answer:
{Int from 1..1000} -{Int from 1..1000 with are multiples of 3 or 5}
1000
Ans
467
= 1000-467 (By difference rule)
= 533
How many primes are there between 1 and 100?
The non-primes must be multiples of 2, 3, 5, or 7, since the square root of 100
is 10.
Counting subsets of a Set:
Combinations
• Definition:
– An r-combination of a set of n elements is a subset of r elements taken
from the set of n elements (
).
• Notation:
– The number of r-permutations of a set of n elements is denoted as
C(n,r), also as nC and  n 
rn
r
 
r
• Note: A combination is an unordered selection: you are selecting a ‘set’,
and ordering is not important in sets.
Theorem: The number of r-combinations of a set of n elements is
C(n, r) = n!/[r!(n – r)!].
Corollary: For all n  0 and 0  r  n,
P(n, r) = r!  C(n, r).
Calculator tools
Example 1:
You are to select five members from a group of twelve to form a team.
(a) How many distinct five-person teams can be selected?
(b) If two of them insist on working together as a pair, such that any team must
either contain both of neither. How many five person teams can be formed?
Answer:
(a) C(12,5)
C(10,3)
All 5-person teams satisfying the ‘2-friends’
constraint.
 C(10,5)
Those
teams
which
involve
the 2
‘friends’
Those
teams
which
do not
involve
the 2
‘friends’
Example 2
You are to select five members from a group of twelve to form a team.
If two of them insist on working apart,how many five person teams can be
formed?
1’st version using addition rule
All 5-person teams that do not contain the two enemies, say A and B
Those
teams
which
contain A
but not B
Those
teams
which
contain B
but not A
Those
teams
which do
not contain
A nor B
Step 1: select the A: 1 way
Step 2: select the
remaining people except
B: C(10,4)
C(10,4)
+
C(10,4)
+
C(10,5)
Example 2
You are to select five members from a group of twelve to form a team.
If two of them insist on working apart,how many five person teams can be
formed?
2’nd version
All 5-person teams
C(12,5)
Those
teams with
the two
enemies
together
Those
teams with
the two
enemies
apart
Step 1: select the two enemies: 1 way
Step 2: select the remaining 3 people: C(10,3)
Ans: C(12,5) – C(10,3)
C(10,3)
Example :
A group of twelve consists of five men and seven women.
(a) How many five-person teams can be chosen that consists of three men and
two women?
(b) How many five-person teams contain at least one man?
(c) How many five-person teams contain at most one man?
(a) Answer:
Step 1: choose the men: C(5,3) ways
Step 2: choose the women: C(7,2) ways (regardless of the choices made in step
1)
Multiplication rule: C(5,3) x C(7,2)
(b) Answer:
Number of 5-person teams that contain at least one man
= Number of 5-person teams
– Number of 5-person teams that do not contain any men (all women).
(DIFFERENCE RULE)
= C(12,5) – C(7,5)
(c) Answer:
Number of 5-person teams that contain at most one man
= Number of 5-person teams that contain no men
+ Number of 5-person teams that contain 1 man
(BY ADDITION RULE)
= (C(5,0) x C(7,5))
Step 1: Choose 0 men from 5 men
Step 1: Choose 5 women from 7 women
+ (C(5,1) x C(7,4))
Step 1: Choose 1 man from 5 men
Step 2: choose 4 women from 7 women
Example 4:
10 people are to sit around two round tables. The first table has 6 chairs, the second
table has 4 chairs.
(a) How many ways can this be done?
(b) How many ways can this be done if two of them need to sit together?
(a) Answer (version#1):
Step 1: Choose 6 people to sit on the first table
C(10,6)
Step 2: Arrange the 6 people on the first table
5! (Circular Permutation)
Step 3: Arrange the remaining 4 on the second table.
3! (Circular Permutation)
(BY MULTIPLICATION RULE)
= C(10,6) x 5! x 3!
= 10!/24
(a) Answer (version#2):
Step 1: Permute 6 people from 10 circularly around the first table
P(10,6)/6
Step 2: Arrange the remaining 4 on the second table.
3! (Circular Permutation)
(BY MULTIPLICATION RULE)
= P(10,6)/6 x 3!
= 10!/24
(b) Answer (version#1):
BY ADDITION RULE
Number of sitting arrangements where the two sit on the 1st table
BY MULTIPLICATION RULE
Step 1: Put the two on the first table: 1 way
Step 2: Select 4 more to join them: C(8,4)
Step 3: Permute them around the table : 5!
Step 4: Permute the remaining 4 circularly on 2nd table: 3!
+ Number of sitting arrangements where the two sit on the 2nd table
BY MULTIPLICATION RULE
Step 1: Put the two on the second table: 1 way
Step 2: Select 2 more to join them: C(8,2)
Step 3: Permute them around the table: 3!
Step 4: Permute remaining 6 circularly on 1st table: 5!
= (C(8,4)x5!x3!) +
(C(8,2)x3!x 5!)
Example 4:
10 people are to sit around two round tables. The first table has 6 chairs, the second table
has 4 chairs.
(a) How many ways can this be done?
(b) How many ways can this be done if two of them need to sit together?
(b) Answer (version#2):
BY ADDITION RULE
Number of sitting arrangements where the two sit on the 1st table
BY MULTIPLICATION RULE
Step 1: Put the two on the first table: 1 way
Step 2: Permute 4 from 8 circularly on the 2nd table: P(8,4)/4
Step 3: Permute the 6 circularly on 1st table: 5!
+ Number of sitting arrangements where the two sit on the 2nd table
BY MULTIPLICATION RULE
Step 1: Put the two on the second table: 1 way
Step 2: Permute 6 from 8 circularly on the 1st table: P(8,6)/6
Step 3: Permute remaining 4 circularly on 2nd table: 3!
= (P(8,4)/4 x 5!) + (P(8,6)/6 x 3!)
Permutations of Sets with Repeated ElementsTheorem:
Suppose a set contains
•n1 indistinguishable elements of one type,
•n2 indistinguishable elements of one type,
and so on, through k types, where n1 + n2 + … + nk = n.
Then the number of (distinguishable) permutations of the n elements is
n!/(n1!n2!…nk!).
How many eight-bit strings have exactly three 1’s?
1
2
3
3
5
6
7
8
1. Choose a subset of 3 positions out of 8
to contain 1’s.
C(8, 5) ways
Once 1. Above has been chosen the remaining
Positions are filled with 0’s.
1 way
How many permutations are there of the letters in the word MISSISSIPPI?
IIMSSPISSIP, ISSSPMIIPIS, PIMISSSSIIP and so on.
11!/(4!4!2!1!) = 34650
How many different numbers can be formed by permuting the digits of the number
444556? 6!/(3!2!1!) = 720/(6  2  1) = 60.
R-Combinations
with repetitions allowed
• A multiset is a set, except that repetitions are allowed.
• For example, {1, 1, 2, 2, 2, 3, 4} is a multiset.
• An r-combination with repetitions allowed of a set of n elements is a
multiset of r objects, with each member taken from the set of n elements.
• Definition (r-combinations from a multi-set):
Given a set X of n objects, an r-combination with repetition allowed (or rcombination with a multi-set of size r) is an unordered selection of
elements taken from X with repetition allowed.
• Theorem: The number of r-combination with repetition allowed drawn
from a set of n elements is C(r+n–1 , r).
•
Example: 3-combinations from a set {a,b,c,d}
– [a,a,a]; [a,a,b]; [a,a,c]; [a,a,d]
– [a,b,b]; [a,b,c]; [a,b,d];
– [a,c,c]; [a,c,d]; [a,d,d];
– [b,b,b]; [b,b,c]; [b,b,d];
– [b,c,c]; [b,c,d]; [b,d,d];
– [c,c,c]; [c,c,d]; [c,d,d];
– [d,d,d]
Total Number = 20 = C(3+4-1 , 3)
Category a Category b Category c Category d
[a,a,a]
XXX
[a,a,b]
XX
X
[a,b,d]
X
X
[a,c,d]
X
[b,c,c]
X
X
X
X
XX
Problem generalized:
Selection
Represented by:
[a,a,a]
XXX|||
[a,a,b]
XX|X||
[a,b,d]
X|X||X
[a,c,d]
X||X|X
|X|XX|
[b,c,c]
• r-combination = putting r crosses
• From a set of n elements = putting
n-1 ‘|’s in between crosses.
Reduces to the same problem of
assigning 2-bits (X and |) to r+n-1
positions. (Permuting r+n-1
positions from a multi-set of {X,|}
• Roll three dice.
• How many different possible combinations are there? (Order does not matter.)
•n = 6, r = 3.
•C(n + r – 1, r) = C(8, 3) = 56.
•Are the 56 different combinations equally likely?
Example 1: A person giving a party wants to set out 15 assorted cans of soft
drinks for his guests. He shops at a store that sells 5 different types of soft
drinks
(a) How many different selections of cans of 15 soft drinks can he make?
(b) If root beer is one of the types of soft drinks, how many different selections
include at least 6 cans of root beer?
Answer:
(a) 15-combination (15 drinks) from a multi-set of 5 categories
– r = 15 drinks = 15 crosses
– n = 5 categories: need 4 ‘|’ to separate the crosses
– C(15+5-1 , 15) = C(19, 15) = 3876
(b) Step 1: take out 6 cans of root beer: 1 way
Step 2: select the remaining 9 cans: 9-combination (9 remaining drinks) from a
multi-set of 5 categories: C(9+5-1 , 9) = C(13,9) = 715
Final Answer = 1 x 715 = 715 (Multiplication Rule)
Example 2: How many solutions are there to the equation
x1 + x2 + x3 + x4 = 10
(a) if x1, x2, x3, x4 are non-negative integers?
(b) if x1, x2, x3, x4 are positive integers?
Answer:
(a) 10-combination from a multi-set of 4 categories
– r = 10 units = 10 crosses; to be distributed into…
– n = 4 categories: the four variables: need 3 ‘|’ to separate the crosses
– C(10+4-1 , 10) = C(13, 10) = 286
(b) Step 1: Assign 1 unit to each of the four variables: 1 way.
Step 2: Assign the remaining 6 units to the four variables:
6-combination from a multi-set of 4 categories
= C(6+4-1 , 6) = C(9,6) = 84
Final Answer = 1 x 84 = 84 (Multiplication Rule)
Example 3: How many triplets of the form (i,j,k) are there, when
(a) each i , j , k {1,…,n}
(b) each i , j , k {1,…,n} and 1 i  j  k n
Answer:
(a) Permutation: n3
(b) 3-combinations from a multi-set of n categories:
(Observation skills needed to relate problem to known scenario)
For example if 1 i  j  k 5, then we have 3-combinations from a multi-set of 5
categories: 3 X’s and 4 ‘|’s
(1,1,2) being represented as XX|X|||
(1,2,4) being represented as X|X||X|
(2,3,5) being represented as |X|X||X
Therefore in general, answer is C(n+3-1 , 3)
= (n+2)!/ (3! x (n-1)!)
= (n+2)(n+1)n / 6
The Algebra of Combinations
• Theorem: For all n  1 and 0  r < n,
C(n, r) + C(n, r + 1) = C(n + 1, r + 1).
• Proof:
• Basic step: n = 1.
– r must be 0.
– C(1, 0) + C(1, 1) = 1 + 1 = 2.
– C(2, 1) = 2.
– Therefore, the statement is true for n = 1.
• Inductive step
– Assume that the statement is true for any set of n elements, for some n  1,
and any r, 0  r < n.
– Let S be a set of n + 1 elements.
– Let x  S.
– Each (r + 1)-combination of S either includes x or does not include x.
– Each (r + 1)-combination of S which does not include x may be viewed as an
(r + 1)-combination of S – {x}.
– There are C(n, r + 1) such (r + 1)-combinations.
– For each of the (r + 1)-combinations that do include x, remove the x.
– The result is an r-combination of the S – {x}.
– There are C(n, r) such r-combinations.
– Thus, the total number of (r + 1)-combinations of S is
C(n, r) + C(n, r + 1).
– Therefore,
C(n, r) + C(n, r + 1) = C(n + 1, r + 1).
Common properties
(1) C(n,r) = C(n, n-r)
(2) Pascal’s Formula: C(n+1, r) = C(n, r-1) + C(n,r)
Proof of (1)
• Proven Algebraically:
C(n,r) = n! / ( r!  (n-r)! ) = n! / ( (n-r)!  (n-(n- r))! ) =
C(n, n-r)
• Proven using combinatorial reasoning (p331 of text)
Let A be a set with n elements.
Let the subsets of A of size r be B1, B2,…,Bk.
Each Bk can be paired up with a subset of A of size n–r: namely A –
B k.
All subsets of size n All subset of size n–r
B1
B2
…
A – B1
A – B2
…
0
0
1
0
2
1
3
0
1
1
1
2
1
3
1
1
2
2
3
2
1
3
3
1
1
2
3
1
3
1
The Binomial Theorem
• Theorem: Given any numbers a and b and any nonnegative integer n,
(a + b)n = k=0..n C(n, k)an – kbk.
• Proof: Use induction on n.
• Basic step: n = 0.
– (a + b)0 = 1.
– k=0..0 C(0, k)a0 – kbk = C(0, 0)a0b0 = 1.
– Therefore, the statement is true when n = 0.
• Inductive step
– Suppose the statement is true for some n  0.
– Then
(a + b)n + 1 = (a + b)(a + b)n
= (a + b) k=0..n C(n, k)an – kbk
= k=0..n C(n, k)an – k + 1bk
+ k=0..n C(n, k)an – kbk + 1
= an + 1 + k=1..n C(n, k)an – k + 1bk
+ k=0..n - 1 C(n, k)an – kbk + 1 + bn + 1
= an + 1 + k=1..n C(n, k)an – k + 1bk
+ k=1..n C(n, k – 1) an – k + 1bk + bn + 1
= an + 1 + k=1..n (C(n, k) + C(n, k – 1))an – k + 1bk
+ bn + 1
= an + 1 + k=1..n C(n + 1, k)an – k + 1bk + bn + 1
= k=0..n + 1 C(n + 1, k)an – k + 1bk.
Therefore, the statement is true for n + 1.
Thus, the statement is true for all n  0.

• Binomial Theorem:
 n  n k k
(a  b)    a b
k 0  k 
n
n
• Algebraic proof is by induction on n. (p341 of text)
• Combinatorial Proof:
(a+b)n = (a+b) (a+b) (a+b) … (a+b)
(n copies)
#1
#2
#3
#n
b
a
a
…
a
a
b
a
…
a
• What is the coefficient of an-kbk ?
• How many ways can we create the an-kbk term?
• Well, to create a term, we have to select either a or b from each
(a+b) group.
• Problem reduces to a n-permutation with repetitions (previous
section 2.3), of 2 types of objects: selecting n-k copies of a and k
copies of b: n!/(k!(n-k)!) = C(n,k)
A probability space is a sample space S , together with a probability
Pr[A] for each sample point w, such that
1. 0  P( A)  1
2. P ( )  0
3. If A and B are mutually disjoint, then the probability of the union is
P ( A  B )  P ( A) P ( B ), ifA  B  
P ( A  B )  P ( A) P ( B )  P ( A  B ), ifA  B  
Download