0% found this document useful (0 votes)
9 views20 pages

Lec 07 Counting2

Uploaded by

bdgamingtr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views20 pages

Lec 07 Counting2

Uploaded by

bdgamingtr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

CENG 2003

Assist. Prof. Dr. Zeynep Filiz EREN

LECTURE 7: COUNTING-2
Rosen 5th ed., §4.4 - 4.6
BINOMIAL COEFFICIENTS

(a + b)2 = a2 + 2ab + b2
(a + b)3 = a3 + 3ab2 + 3a2b + b3
(a + b)4 = a4 + 4ab3 + 6a2b2 + 4a3b + b4

Why am I showing
this to you? 1. Beautiful patterns
2. Recursive defn
3. New type of proof
4. Applications in more
complex counting
techniques

2
BINOMIAL COEFFICIENTS

(a + b)2 = a2 + 2ab + b2
(a + b)3 = a3 + 3a2b + 3ab2 + b3
(a + b)4 = a4 + 4a3b + 6a2b2 + 4ab3 + b4

What is coefficient
of a9b3 in (a + b)12?

A. 36
B. 220
C. 15
D. 6
E. No clue 3
BINOMIAL COEFFICIENTS

(a + b)4 = (a + b)(a + b)(a + b)(a + b)


æ4 ö æ4 ö æ4 ö æ4 ö æ4 ö
= çè0÷ø a4 + çè 1 ÷ø a3b + çè2÷ø a2b2 + çè3÷ø ab3 + çè4 ÷ø b4

Binomial Theorem: Let x and y be variables, and let


n be any nonnegative integer. Then

æn ö n
(x + y ) = åç ÷x y
n n- j j
j
j =0 è ø

4
BINOMIAL COEFFICIENTS

Binomial Theorem: Let x and y be variables, and let


n be any nonnegative integer. Then

æn ö n - j j
n
(x + y ) = åç ÷x y
n
j
j =0 è ø

What is the coefficient of a8b9 in the expansion of (3a +2b)17?

What is n? 17
æ17ö æ17ö 8 9 8 9
What is j? 9 ç ÷(3a) (2b) = ç ÷3 2 a b
8 9

è9ø è9ø
What is x? 3a 5

What is y? 2b
BINOMIAL COEFFICIENTS

(a + b)4 = (a + b)(a + b)(a + b)(a + b)


æ4 ö æ4 ö æ4 ö æ4 ö æ4 ö
= çè0÷ø a4 + çè 1 ÷ø a3b + çè2÷ø a2b2 + çè3÷ø ab3 + çè4 ÷ø b4

A. 10C6
B. 9C4
C. 9C5
D. 8C4 + 8C5
E. No clue

6
næn ö n - j j
BINOMIAL COEFFICIENTS (x + y ) = åç ÷x y
n
j
j =0 è ø

Sum each row of Pascal’s Triangle: Powers of 2


n æn ö n
Two proofs that åç j ÷ = 2 Suppose you have a set of
j =0 è ø
size n. How many
subsets does it have? 2n

How many subsets of size 0


does it have?
n C0
How many subsets of size 1
does it have?
n C1

How many subsets of size 2


does it have?
n C2 7

Count all subsets in this way, and we have the result!


æn ö n - j j
n
BINOMIAL COEFFICIENTS (x + y ) = åç ÷x y
n
j
j =0 è ø

Sum each row of Pascal’s Triangle: Powers of 2


n æn ö n
Two proofs that åç j ÷ = 2
j =0 è ø

Let x=1 and y=1 in Binomial


Theorem.
Done

n æn ö n - j j
åç j ÷1 1 = (1 + 1)n
j =0 è ø

næn ö n
åç j ÷ = 2 8
j =0 è ø
PASCAL’S IDENTITY

A relationship between the entries in Pascal’s !.

ænö æn -1ö æn -1ö


÷+ç Suppose T is a set, |T|=n. Let
ç ÷= ç ÷
è jø è j -1 ø è j ø a be an element in T, and let
S = T - {a}. Let’s count the
nCj subsets of size j. Note
that some of these contain
a, and some don’t.
How many contain a?
How many don’t? n-1Cj-1

n-1Cj

9
This is an
VANDERMONDE’S IDENTITY example of a
combinatorial
proof. We
describe the
Let m, n, and r be nonnegative integers with r notset counted by
exceeding either m or n. Then the LHS and
RHS of the eqn,
and argue that
æm+ nö r æ m öænö they count the
ç ÷ = åç ÷ç ÷ same thing.
è r ø j=0 èr - jøè jø Look in Rosen.

A B
m items n items To choose r items,
take some from A
and some from B.
All possible ways
of doing this gives
the result. 10
COMBINATIONS WITH REPETITION

Suppose you want to buy 5 bags of chips from the


3 kinds you like at Meijer. In how many different
ways can you stock up?

Out of 7 items, we
are choosing 2 to
be bars.
From that, and our
understanding of
the model, we can
report the answer.

æ 7ö æ 7ö 11
ç ÷=ç ÷
è 2 ø è5 ø
COMBINATIONS WITH REPETITION

There are n+r-1Cr, r-sized combinations from a set


of n elements when repetition is allowed. n-1 bars
r items

Example: How many solutions are there to the equation

x1 + x 2 + x 3 + x 4 = 10
When the variables are nonnegative integers?
13C3

12
1 + 3 + 6 + 0 = 10
PERMUTATIONS WITH INDISTINGUISHABLE
OBJECTS

How many different strings can be made from the


letters in the word rat? 6

How many different strings can be made from the


letters in the word egg? 3

13
PERMUTATIONS WITH INDISTINGUISHABLE
OBJECTS

How many different strings can be made from the


letters in the phrase nano-nano?

Key thoughts: 8 positions, 3 kinds of letters to place.


In how many ways can we place the ns? 8 C4 , now 4 spots are left
In how many ways can we place the as? 4 C2 , now 2 spots are left
In how many ways can we place the os? 2 C2 , now 0 spots are left

æ 8 öæ 4öæ2ö 8! 4! 2! 8!
ç ÷ç ÷ç ÷ = × × =
è 4 øè 2øè2ø 4!4! 2!2! 2!0! 4!2!2!
14
PERMUTATIONS WITH INDISTINGUISHABLE
OBJECTS

How many distinct permutations are there of the


letters in the word APALACHICOLA?
12!
4!2!2!

How many if the two Ls must appear together?


11!
4!2!
How many if the first letter must be an A?
11! 15
3!2!2!
A LITTLE PRACTICE

A turtle begins at the upper left corner of an n x m


grid and meanders to the lower right corner.

How many routes could she take if she only moves


right and down?
16
A LITTLE PRACTICE

A turtle begins at the upper left corner of a m x n


grid and meanders to the lower right corner.

How many routes could she take if she only moves


right and down, and if she must pass through the
dot at point (a,b)? æa + bö æm- a + n - bö
ç ÷×ç ÷
17
è a ø è m- a ø
A LITTLE PRACTICE

In how many ways can 11 identical computer science


books and 8 identical psychology books be
distributed among 5 students? æ15ö æ12ö
ç ÷×ç ÷
è 11 ø è 8 ø

Hint: forget about the psychology books for the moment.

Hint: how can you combine your soln for the CS books with
your soln for the Psych books?
18
A LITTLE PRACTICE

In an RNA chain of 20 bases, there are 4 A’s, 5 U’s,


6 G’s, and 5C’s. If the chain begins either AC or
UG, how many such chains are there?

Let A denote the set of chains beginning with AC, and U


denote the set of chains beginning with UG. Count them
separately, and then sum.

First find |A|: 18 bases, 3 As, 5 Us, 6 Gs, and 4Cs.

(This is like the MISSISSIPPI problem.)

|A| = 18!/(3!5!6!4!) 19
¢ P.324 5, 15, 21.b, 31,
¢ P.342 3, 5, 7, 15, 31,

20

You might also like