how many ways are there to pass through city a where the arrows represent one-way streets? answer:...

18
How many ways are there to pass through city A where the arrows represent one- way streets? Answer: mn ways The counting principal: Suppose two experiments are to be performed. If experiment 1 can result in any of m possible outcomes and if for each of these outcomes of experiment 1, there are n possible outcomes of experiment 2, then together there are mn possible outcomes of the two experiments. The counting principal is also called the product rule. A .. . m roads .. . n roads

Upload: jonas-brown

Post on 25-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

• How many ways are there to pass through city A where the arrows represent one-way streets?

Answer: mn ways• The counting principal: Suppose two experiments are to be

performed. If experiment 1 can result in any of m possible outcomes and if for each of these outcomes of experiment 1, there are n possible outcomes of experiment 2, then together there are mn possible outcomes of the two experiments.

• The counting principal is also called the product rule.

A...m roads ... n roads

Page 2: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

Generalized Counting Principal

• If r experiments that are to be performed are such that the first one may result in any of n1 possible outcomes, and if for each of these n1 outcomes there are n2 possible outcomes of the second experiment, and if for each of the possible outcomes of the first two experiments there n3 possible outcomes of the third experiment, etc., then there is a total of possible outcomes of the r experiments.

• Example. How many different 7-place license plates are possible if the first 3 places are to be occupied by letters and the final 4 by numbers?

r21 ...nnn

0.175,760,00 10101010262626

Page 3: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

• How many “words” of length three can be formed from the letters a, b, c, d, and e if letters can be repeated? Solution. There 5 choices for the first letter, 5 choices for the second letter, and 5 choices for the third letter. Thus, the number of “words” is 53 = 125.

• Theorem. The number of ordered arrangements of n distinct objects of size r, 1 r n, where repetition is allowed is given by nr.

• Example. The latter theorem implies that b distinguishable balls can be distributed into u distinguishable urns in ub ways. Note that “distinguishable balls” can be interpreted as saying that the balls are ordered.

__...____

b blanks to be filled with labels 1 to u

Page 4: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

Triplets of nucleotides in DNA

• A description of the structure of a DNA molecule can be found at: http://www.accessexcellence.org/RC/VL/GG/nucleotide2.html

• A nucleotide is represented by one of the letters in the set {A,T,C,G}. A codon is defined to be a triplet of nucleotides. The order of the nucleotides in a codon is significant, and nucleotides can be repeated. These codons determine which amino acid is to be made.

• How many different codons are possible? How does this relate to the fact that there are only twenty amino acids?

Page 5: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

• Given a collection of n distinct objects, any ordered arrangement of these objects without repetition is called a permutation of the collection. If only r of the objects, 1 r n, are to be used in the ordered arrangement, then we have an r-element permutation.

• How many ways of listing three letters chosen from the collection a, b, c, d, and e are there? (Assume that no letter can be repeated.) That is, we are asked to find the number of permutations of size 3 for this collection of letters.Solution. We have 5 choices for the first element in the list. This leaves 4 choices for the second element. Once the first two are chosen, there are 3 choices remaining for the third element. This qualifies for the product rule since the number of choices only depends on the stage of the process and not on the particular letters which have been chosen. Thus, there are (5)(4)(3) = 60 ways to list three letters.

Page 6: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

• For any integer n 0, n factorial is defined by

0! = 1 n! = (n)(n-1)(n-2) … (3)(2)(1), for n 1.

• Note that n! grows very rapidly. Beware of arithmetic overflow if you try to calculate factorials explicitly on a calculator.

• Theorem. The number of r-element permutations of n objects is denoted by nPr and it equals

• Corollary. If r = n, then we have that the number of permutations of n objects is n!

.r)!-(n

n! 1)r-(n2)-1)(n-n)(n(

Page 7: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

• Example. Suppose 3 distinguishable balls are to be distributed into 5 distinguishable urns in such a way that each urn contains at most one ball. This can be done in 5!/2! ways.

• Problem. How many distinct anagrams of the word BALL are there? If we treat the two L’s as distinct objects, we have 4! permutations of the four letters. However, the two L’s are not distinct and some of the permutations will correspond to the same anagram. In fact, there will be two permutations for every distinct anagram. We have 2(number of distinct anagrams) = (number of permutations of B, A, L1, L2). Thus, the number of distinct anagrams = 4!/2 = 12.

_________

3 blanks (for balls) to be filled with labels 1 to 5 (for urns). This give us the permutations of 5 labels of size 3.

Page 8: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

• How many distinct anagrams are there of the word BANANA? There are 6! permutations of the six letters where all letters are considered distinct. However, the two N’s are not distinct and the three A’s are not distinct. There are 2! ways to order the N’s and there are 3! ways to order the A’s. Thus,

(2!)(3!)(Number of distinct anagrams of BANANA) = (Number of permutations of B, A1, N1, A2 , N2 , A3).

• Theorem. If there are n objects with n1 of the first type, n2 of the second type, …, and nr of an rth type, where n1 + n2 + … + nr = n, then there are

ordered arrangements of the given objects where objects of the same type are indistinguishable. Note: These ordered arrangements are again called permutations (with indistinguishable objects)

)!n()!n)(!(n

n!

r21

Page 9: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

• Recall that the number of permutations of n distinct objects of size r is n!/(n-r)! If we don’t care about the order of the objects chosen, then we are asking for the number of subsets of size r chosen from the n objects. We see that each such subset can be ordered in r! ways. Thus, we have

Such a subset of size r is also called a combination, and the number of possible combinations of size r chosen from n distinct objects is denoted by or by nCr .

• Theorem.

ns).permutatioelement -r of(number r) size of subsets of(number r!

r

n

n.r0 ,r)!-(nr!

n!

r

n

Page 10: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

• Problem. How many thirteen card bridge hands chosen from an ordinary deck of 52 cards are there? Since we don’t care about the order in which the cards are received, we want the number of combinations, = 635,013,559,600.

• In order to see a connection between the number of permutations with two groups of indistinguishable objects and , suppose that we have ten objects lined up as

and then

we distribute 4 labels I (for “in the set”) and 6 labels N (for “not in the set”) in the ten spaces occupied by the objects. We can count this as or as permutations with indistinguishable objects

Of course, these two values are the same.

10987654321 a,a,a,a,a,a,a,a,a,a

.)!6)(!(4

10!

1352

4 10

4 10

Page 11: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

• In the expansion of the n terms (x+y)(x+y)(x+y)…(x+y) , we may choose x from n-i of the terms, and y from the remaining i terms to form a xn-iyi. We don’t care about the order in which the terms are chosen, so the number of ways to form the term xn-iyi is . Thus,

The latter result is known as The Binomial Theorem and it has a generalization called the Multinomial Theorem.

• Examples.

• The quantities are also called binomial coefficients.

.yyx3 xy3 xy)x( 312233

.yxi

nyx

n

nyx

1

nyx

0

n y)x( ni-n

n

0i

n011-n0nn

.yxy4yx6yx4 xy)x( 43221344

i

n

i

n

Page 12: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

Multinomial Coefficients

• If n1 + n2 + … + nr = n, we define

• As shown in the textbook,

represents the number of possible divisions of n distinct objects into r distinct groups of respective sizes n1, n2 , … nr.

• From previous work, we know that also

represents a permutation. The connection between the two interpretations can be made by considering r types of labels for the n objects.

.)!n)...(!n)(!(n

n!

n...nnn

n

r21r321

r321 n...nnn

n

r321 n...nnn

n

Page 13: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

Using the multinomial coefficients.

• (x1+ x2+ x3)2 =

• Problem. If 12 distinguishable balls are to be placed into 3 distinguishable urns in such a way that each urn has 4 balls, how many ways can this be done?

32312123

22

21

13

12

01

13

02

11

03

12

11

23

02

01

03

22

01

03

02

21

xx2xx2xx2xx x

xx x1,1,0

2xx x

1,0,1

2xx x

0,1,1

2

xx x2,0,0

2xx x

0,2,0

2xx x

0,0,2

2

Page 14: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

The number of integer solutions of equations• Suppose we have n indistinguishable balls and r

distinguishable urns. How many ways are there to distribute the balls into the urns (where some urns may be empty)? This is readily seen to be equivalent to finding the number of distinct nonnegative integer-valued vectors (x1, x2, ... , xr) such that x1+ x2+ ... + xr = n.

• To solve this problem with “nonnegative” replaced by “positive”, imagine that the n indistinguishable objects are lined up and that we want to divide them into r nonempty groups. To count the number of ways this can be done, we select r – 1 of the n – 1 spaces between adjacent objects as the dividing points (see below).

. spaces theof 1r Choose

00... 000

Page 15: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

The number of integer solutions of equations, continued

• Theorem. There are

• By making a simple change of variable we obtain: Theorem. There are

• Example. There are 2 positive integer-valued vectors satisfying x1 + x2 = 3.

vectorsvalued-integer positivedistinct 1r

1n

n. x...x xsatisfying )x, ... ,x,(x r21r21

vectorsvalued-integer enonnegativdistinct 1r

1rn

n. x ... x xsatisfying )x, ... ,x,(x r21r21

Page 16: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

More balls and urns• Suppose 12 indistinguishable balls are to be placed in 3

distinguishable urns with no urn left empty. The number of ways to do this is 55. Do you see why?

• Suppose 12 indistinguishable balls are to be placed in 3 distinguishable urns with some urns possibly empty. There are 91 ways to do this. Do you see why?

• Suppose an urn contains 11 distinguishable balls and a sample of 3 balls is to be selected (without replacement). How many different samples are there if (a) the order in which the balls are drawn is important? (b) the order in which the balls are drawn is not important?

• Tree diagrams provide a pictorial way to represent the possible cases in a counting problem.

Page 17: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

Two ways to count the same set of objects

• Often there are two ways to count the same set of objects and this leads to an interesting result since the two ways must give the same answer. This is known as a combinatorial argument.

• Problem. How many subsets of a given set with n elements are there (include the empty set and the given set)? • One way to count: Fill n blanks with one of two possible labels, I or N, for “in the set” or “not in the set”: __ __ __ ... __ Clearly, there are 2n ways to do this since order matters. • Second way to count: Add number of subsets of size k, k = 0,1, ..., n to get the total number of ways.

• Setting these two ways of counting equal we have:

• Note that the latter equality also follows from the binomial thm. Do you see how? Also, the set of all subsets of a given set A is called the power set of A.

.n

n...

1

n

0

n2n

Page 18: How many ways are there to pass through city A where the arrows represent one-way streets? Answer: mn ways The counting principal: Suppose two experiments

Stirling's Formula

• To estimate n! for large values of n, we use

• Example. By Stirling's formula,

.1en2nπ

n!lim that means ~ where

,en2nπ ~ n!

nnn

nn

.2

nπ~

(2n)!

)n!(2n

2n