34
06/19/22 1 One, two, three, we’re… One, two, three, we’re… Counting Counting

2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

Embed Size (px)

DESCRIPTION

2/24/20163 Basic Counting Principles The sum rule: If a task can be done in n 1 ways and a second task in n 2 ways, and if these two tasks cannot be done at the same time, then there are n 1 + n 2 ways to do either task. Example: The department will award a free computer to either a CS student or a CS professor. How many different choices are there, if there are 530 students and 15 professors? There are = 545 choices.

Citation preview

Page 1: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 1

One, two, three, we’re…One, two, three, we’re…

CountingCounting

Page 2: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 2

Basic Counting PrinciplesBasic Counting PrinciplesCounting problemsCounting problems are of the following kind: are of the following kind:““How manyHow many different 8-letter passwords are different 8-letter passwords are there?”there?”““How manyHow many possible ways are there to pick 11 possible ways are there to pick 11 soccer players out of a 20-player team?”soccer players out of a 20-player team?”Most importantly, counting is the basis for Most importantly, counting is the basis for computing computing probabilities of discrete eventsprobabilities of discrete events..(“What is the probability of winning the (“What is the probability of winning the lottery?”) lottery?”)

Page 3: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 3

Basic Counting PrinciplesBasic Counting PrinciplesThe sum rule:The sum rule:If a task can be done in nIf a task can be done in n11 ways and a second ways and a second task in ntask in n22 ways, and if these two tasks cannot ways, and if these two tasks cannot be done at the same time, then there are nbe done at the same time, then there are n11 + + nn22 ways to do either task. ways to do either task.Example:Example: The department will award a free computer to The department will award a free computer to either a CS student or a CS professor. either a CS student or a CS professor. How many different choices are there, if there How many different choices are there, if there are 530 students and 15 professors?are 530 students and 15 professors?There are 530 + 15 = 545 choices.There are 530 + 15 = 545 choices.

Page 4: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 4

Basic Counting PrinciplesBasic Counting Principles

Generalized sum rule:Generalized sum rule: If we have tasks TIf we have tasks T11, T, T22, …, T, …, Tmm that can be that can be done in ndone in n11, n, n22, …, n, …, nmm ways, respectively, and ways, respectively, and no two of these tasks can be done at the same no two of these tasks can be done at the same time, then there are ntime, then there are n11 + n + n22 + … + n + … + nmm ways to ways to do one of these tasks.do one of these tasks.

Page 5: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 5

Basic Counting PrinciplesBasic Counting Principles

The product rule:The product rule:Suppose that a procedure can be broken down Suppose that a procedure can be broken down into two successive tasks. If there are ninto two successive tasks. If there are n11 ways ways to do the first task and nto do the first task and n22 ways to do the ways to do the second task after the first task has been done, second task after the first task has been done, then there are nthen there are n11nn22 ways to do the procedure. ways to do the procedure.

Page 6: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 6

Basic Counting PrinciplesBasic Counting PrinciplesExample:Example:How many different license plates are there How many different license plates are there that containing exactly three English letters ?that containing exactly three English letters ?Solution:Solution:There are 26 possibilities to pick the first There are 26 possibilities to pick the first letter, then 26 possibilities for the second one, letter, then 26 possibilities for the second one, and 26 for the last one. and 26 for the last one.

So there are 26So there are 26262626 = 17576 different 26 = 17576 different license plates.license plates.

Page 7: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 7

Basic Counting PrinciplesBasic Counting Principles

Generalized product rule:Generalized product rule:If we have a procedure consisting of If we have a procedure consisting of sequential tasks Tsequential tasks T11, T, T22, …, T, …, Tmm that can be done that can be done in nin n11, n, n22, …, n, …, nmm ways, respectively, then there ways, respectively, then there are nare n11 n n22 … … n nmm ways to carry out the ways to carry out the procedure.procedure.

Page 8: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 8

Basic Counting PrinciplesBasic Counting PrinciplesThe sum and product rules can also be phrased The sum and product rules can also be phrased in terms of in terms of set theoryset theory..Sum rule:Sum rule: Let A Let A11, A, A22, …, A, …, Amm be disjoint sets. be disjoint sets. Then the number of ways to choose any element Then the number of ways to choose any element from one of these sets is |Afrom one of these sets is |A11 A A22 … … A Amm | = | =|A|A11| + |A| + |A22| + … + |A| + … + |Amm|.|.Product rule:Product rule: Let A Let A11, A, A22, …, A, …, Amm be finite sets. be finite sets. Then the number of ways to choose one element Then the number of ways to choose one element from each set in the order Afrom each set in the order A11, A, A22, …, A, …, Am m is is |A|A11 A A22 … … A Amm | = |A | = |A11| | |A |A22| | … … |A |Amm|.|.

Page 9: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 9

Inclusion-ExclusionInclusion-ExclusionHow many bit strings of length 8 either start with a How many bit strings of length 8 either start with a 1 or end with 00?1 or end with 00?Task 1:Task 1: Construct a string of length 8 that starts Construct a string of length 8 that starts with a 1.with a 1.There is one way to pick the first bit (1), There is one way to pick the first bit (1), two ways to pick the second bit (0 or 1),two ways to pick the second bit (0 or 1),two ways to pick the third bit (0 or 1),two ways to pick the third bit (0 or 1),......two ways to pick the eighth bit (0 or 1).two ways to pick the eighth bit (0 or 1).Product rule:Product rule: Task 1 can be done in 1 Task 1 can be done in 12277 = 128 = 128 ways.ways.

Page 10: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 10

Inclusion-ExclusionInclusion-ExclusionTask 2:Task 2: Construct a string of length 8 that ends Construct a string of length 8 that ends with 00.with 00.There are two ways to pick the first bit (0 or 1), There are two ways to pick the first bit (0 or 1), two ways to pick the second bit (0 or 1),two ways to pick the second bit (0 or 1),......two ways to pick the sixth bit (0 or 1),two ways to pick the sixth bit (0 or 1),one way to pick the seventh bit (0), andone way to pick the seventh bit (0), andone way to pick the eighth bit (0).one way to pick the eighth bit (0).Product rule:Product rule: Task 2 can be done in 2 Task 2 can be done in 266 = 64 = 64 ways.ways.

Page 11: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 11

Inclusion-ExclusionInclusion-ExclusionSince there are 128 ways to do Task 1 and 64 ways Since there are 128 ways to do Task 1 and 64 ways to do Task 2, does this mean that there are 192 bit to do Task 2, does this mean that there are 192 bit strings either starting with 1 or ending with 00 ?strings either starting with 1 or ending with 00 ?No, because here Task 1 and Task 2 can be done No, because here Task 1 and Task 2 can be done at at the same timethe same time..When we carry out Task 1 and create strings When we carry out Task 1 and create strings starting with 1, some of these strings end with 00.starting with 1, some of these strings end with 00.Therefore, we sometimes do Tasks 1 and 2 at the Therefore, we sometimes do Tasks 1 and 2 at the same time, so same time, so the sum rule does not applythe sum rule does not apply..

Page 12: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 12

Inclusion-ExclusionInclusion-ExclusionIf we want to use the sum rule in such a case, If we want to use the sum rule in such a case, we have to subtract the cases when Tasks 1 we have to subtract the cases when Tasks 1 and 2 are done at the same time.and 2 are done at the same time.How many cases are there, that is, how many How many cases are there, that is, how many strings start with 1 strings start with 1 andand end with 00? end with 00?There is one way to pick the first bit (1), There is one way to pick the first bit (1), two ways for the second, …, sixth bit (0 or 1),two ways for the second, …, sixth bit (0 or 1),one way for the seventh, eighth bit (0).one way for the seventh, eighth bit (0).Product rule:Product rule: In 2 In 255 = 32 cases, Tasks 1 and 2 = 32 cases, Tasks 1 and 2 are carried out at the same time.are carried out at the same time.

Page 13: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 13

Inclusion-ExclusionInclusion-ExclusionSince there are 128 ways to complete Task 1 and Since there are 128 ways to complete Task 1 and 64 ways to complete Task 2, and in 32 of these 64 ways to complete Task 2, and in 32 of these cases Tasks 1 and 2 are completed at the same cases Tasks 1 and 2 are completed at the same time, there aretime, there are128 + 64 – 32 = 160 ways to do either task.128 + 64 – 32 = 160 ways to do either task.

In set theory, this corresponds to sets AIn set theory, this corresponds to sets A11 and A and A22 that are that are notnot disjoint. Then we have: disjoint. Then we have:|A|A11 A A22| = |A| = |A11| + |A| + |A22| - |A| - |A11 A A22||

This is called the This is called the principle of inclusion-principle of inclusion-exclusion.exclusion.

Page 14: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 14

Tree DiagramsTree DiagramsHow many bit strings of length four do not have How many bit strings of length four do not have two consecutive 1s?two consecutive 1s?

Task 1Task 1 Task 2Task 2 Task 3Task 3 Task 4Task 4(1(1stst bit) bit) (2(2ndnd bit) bit) (3(3rdrd bit) bit) (4(4thth bit) bit)

0000

00 00111100

11 00 0011

11 0000 00

111100There are 8 strings.There are 8 strings.

Page 15: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 15

The Pigeonhole PrincipleThe Pigeonhole PrincipleThe pigeonhole principle:The pigeonhole principle: If (k + 1) or more If (k + 1) or more objects are placed into k boxes, then there is at objects are placed into k boxes, then there is at least one box containing two or more of the least one box containing two or more of the objects.objects.Example 1:Example 1: If there are 11 players in a soccer If there are 11 players in a soccer team that wins 12-0, there must be at least one team that wins 12-0, there must be at least one player in the team who scored at least twice.player in the team who scored at least twice.Example 2:Example 2: If you have 6 classes from Monday If you have 6 classes from Monday to Friday, there must be at least one day on to Friday, there must be at least one day on which you have at least two classes.which you have at least two classes.

Page 16: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 16

The Pigeonhole PrincipleThe Pigeonhole PrincipleThe generalized pigeonhole principle:The generalized pigeonhole principle: If N If N objects are placed into k boxes, then there is at objects are placed into k boxes, then there is at least one box containing at least least one box containing at least N/kN/k of the of the objects.objects.Example 1:Example 1: In our 60-student class, at least 12 In our 60-student class, at least 12 students will get the same letter grade (A, B, C, students will get the same letter grade (A, B, C, D, or F).D, or F).

Page 17: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 17

The Pigeonhole PrincipleThe Pigeonhole PrincipleExample 2:Example 2: Assume you have a drawer Assume you have a drawer containing a random distribution of a dozen containing a random distribution of a dozen brown socks and a dozen black socks. It is dark, brown socks and a dozen black socks. It is dark, so how many socks do you have to pick to be so how many socks do you have to pick to be sure that among them there is a matching pair?sure that among them there is a matching pair?

There are two types of socks, so if you pick at There are two types of socks, so if you pick at least 3 socks, there must be either at least two least 3 socks, there must be either at least two brown socks or at least two black socks.brown socks or at least two black socks.

Generalized pigeonhole principle: Generalized pigeonhole principle: 3/23/2 = 2. = 2.

Page 18: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 18

Permutations and Permutations and CombinationsCombinations

How many ways are there to pick a set of 3 How many ways are there to pick a set of 3 people from a group of 6?people from a group of 6?There are 6 choices for the first person, 5 for the There are 6 choices for the first person, 5 for the second one, and 4 for the third one, so there aresecond one, and 4 for the third one, so there are66554 = 120 ways to do this.4 = 120 ways to do this.This is not the correct result!This is not the correct result!For example, picking person C, then person A, For example, picking person C, then person A, and then person E leads to the and then person E leads to the same groupsame group as as first picking E, then C, and then A.first picking E, then C, and then A.However, these cases are counted However, these cases are counted separatelyseparately in the above equation.in the above equation.

Page 19: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 19

Permutations and Permutations and CombinationsCombinations

So how can we compute how many different So how can we compute how many different subsets of people can be picked (that is, we subsets of people can be picked (that is, we want to disregard the order of picking) ?want to disregard the order of picking) ?

To find out about this, we need to look at To find out about this, we need to look at permutations.permutations.

A A permutationpermutation of a set of distinct objects is an of a set of distinct objects is an ordered arrangement of these objects.ordered arrangement of these objects.

An ordered arrangement of r elements of a set An ordered arrangement of r elements of a set is called an is called an r-permutationr-permutation..

Page 20: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 20

Permutations and Permutations and CombinationsCombinations

Example:Example: Let S = {1, 2, 3}. Let S = {1, 2, 3}.The arrangement 3, 1, 2 is a permutation of S.The arrangement 3, 1, 2 is a permutation of S.The arrangement 3, 2 is a 2-permutation of S.The arrangement 3, 2 is a 2-permutation of S.

The number of r-permutations of a set with n The number of r-permutations of a set with n distinct elements is denoted by distinct elements is denoted by P(n, r).P(n, r).

We can calculate P(n, r) with the product rule:We can calculate P(n, r) with the product rule:P(n, r) = nP(n, r) = n(n – 1)(n – 1)(n – 2) (n – 2) ……(n – r + 1).(n – r + 1).(n choices for the first element, (n – 1) for the (n choices for the first element, (n – 1) for the second one, (n – 2) for the third one…)second one, (n – 2) for the third one…)

Page 21: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 21

Permutations and Permutations and CombinationsCombinations

Example:Example: P(8, 3) = 8P(8, 3) = 8776 = 3366 = 336

= (8= (87766554433221)/(51)/(54433221)1)

General formula:General formula:P(n, r) = n!/(n – r)!P(n, r) = n!/(n – r)!

Knowing this, we can return to our initial Knowing this, we can return to our initial question:question:How many ways are there to pick a set of 3 How many ways are there to pick a set of 3 people from a group of 6 (disregarding the people from a group of 6 (disregarding the order of picking)?order of picking)?

Page 22: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 22

Permutations and Permutations and CombinationsCombinations

An An r-combinationr-combination of elements of a set is an of elements of a set is an unordered selection of r elements from the set.unordered selection of r elements from the set.Thus, an r-combination is simply a subset of the Thus, an r-combination is simply a subset of the set with r elements.set with r elements.Example:Example: Let S = {1, 2, 3, 4}. Let S = {1, 2, 3, 4}.Then {1, 3, 4} is a 3-combination from S.Then {1, 3, 4} is a 3-combination from S.The number of r-combinations of a set with n The number of r-combinations of a set with n distinct elements is denoted by C(n, r).distinct elements is denoted by C(n, r).Example:Example: C(4, 2) = 6, since, for example, the C(4, 2) = 6, since, for example, the 2-combinations of a set {1, 2, 3, 4} are {1, 2}, 2-combinations of a set {1, 2, 3, 4} are {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}.{1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}.

Page 23: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 23

Permutations and Permutations and CombinationsCombinations

How can we calculate C(n, r)?How can we calculate C(n, r)?Consider that we can obtain the r-permutation Consider that we can obtain the r-permutation of a set in the following way:of a set in the following way:First,First, we form all the r-combinations of the set we form all the r-combinations of the set(there are C(n, r) such r-combinations).(there are C(n, r) such r-combinations).Then,Then, we generate all possible orderings in we generate all possible orderings in each of these r-combinations (there are P(r, r) each of these r-combinations (there are P(r, r) such orderings in each case).such orderings in each case).

Therefore, we have:Therefore, we have:P(n, r) = C(n, r)P(n, r) = C(n, r)P(r, r)P(r, r)

Page 24: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 24

Permutations and Permutations and CombinationsCombinations

C(n, r) = P(n, r)/P(r, r)C(n, r) = P(n, r)/P(r, r) = n!/(n – r)!/(r!/(r – r)!)= n!/(n – r)!/(r!/(r – r)!) = n!/(r!(n – r)!)= n!/(r!(n – r)!)

Now we can answer our initial question:Now we can answer our initial question:How many ways are there to pick a set of 3 How many ways are there to pick a set of 3 people from a group of 6 (disregarding the people from a group of 6 (disregarding the order of picking)?order of picking)?C(6, 3) = 6!/(3!C(6, 3) = 6!/(3!3!) = 720/(63!) = 720/(66) = 720/36 = 206) = 720/36 = 20

There are 20 different ways, that is, 20 different There are 20 different ways, that is, 20 different groups to be picked.groups to be picked.

Page 25: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 25

Permutations and Permutations and CombinationsCombinations

Corollary:Corollary: Let n and r be nonnegative integers with r Let n and r be nonnegative integers with r n. n.Then C(n, r) = C(n, n – r).Then C(n, r) = C(n, n – r).

Note that Note that “picking a group of r people from “picking a group of r people from a group of n people”a group of n people” is the same as is the same as “splitting a group of n people into a group “splitting a group of n people into a group of r people and another group of (n – r) of r people and another group of (n – r) people”.people”.

Please also look at proof on page 252.Please also look at proof on page 252.

Page 26: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 26

Permutations and Permutations and CombinationsCombinations

Example:A soccer club has 8 female and 7 male members. For today’s match, the coach wants to have 6 female and 5 male players on the grass. How many possible configurations are there?

C(8, 6) C(7, 5) = 8!/(6! C(7, 5) = 8!/(6!2!) 2!) 7!/(5! 7!/(5!2!)2!) = 28= 2821 21 = 588= 588

Page 27: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 27

CombinationsCombinationsWe also saw the following:We also saw the following:

),(!)!(

!)]!([)!(

!),( rnCrrn

nrnnrn

nrnnC

This symmetry is intuitively plausible. For example, let us This symmetry is intuitively plausible. For example, let us consider a set containing six elements (n = 6).consider a set containing six elements (n = 6).Picking twoPicking two elements and elements and leaving fourleaving four is essentially the is essentially the same as same as picking fourpicking four elements and elements and leaving twoleaving two..In either case, our number of choices is the number of In either case, our number of choices is the number of possibilities to possibilities to dividedivide the set into one set containing two the set into one set containing two elements and another set containing four elements.elements and another set containing four elements.

Page 28: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 28

CombinationsCombinationsPascal’s Identity:Pascal’s Identity:

Let n and k be positive integers with n Let n and k be positive integers with n k. k.Then C(n + 1, k) = C(n, k – 1) + C(n, k).Then C(n + 1, k) = C(n, k – 1) + C(n, k).How can this be explained?How can this be explained?What is it good for?What is it good for?

Page 29: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 29

CombinationsCombinationsImagine a set S containing n elements and a set T Imagine a set S containing n elements and a set T containing (n + 1) elements, namely all elements containing (n + 1) elements, namely all elements in S plus a new element in S plus a new element aa..Calculating C(n + 1, k) is equivalent to answering Calculating C(n + 1, k) is equivalent to answering the question: How many subsets of T containing k the question: How many subsets of T containing k items are there?items are there?Case I:Case I: The subset contains (k – 1) elements of S The subset contains (k – 1) elements of S plus the element plus the element aa: C(n, k – 1) choices.: C(n, k – 1) choices.Case II:Case II: The subset contains k elements of S and The subset contains k elements of S and does not contain does not contain aa: C(n, k) choices.: C(n, k) choices.Sum Rule:Sum Rule: C(n + 1, k) = C(n, k – 1) + C(n, k). C(n + 1, k) = C(n, k – 1) + C(n, k).

Page 30: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 30

Pascal’s TrianglePascal’s TriangleIn Pascal’s triangle, each number is the sum of In Pascal’s triangle, each number is the sum of the numbers to its upper left and upper right:the numbers to its upper left and upper right:

1111 11

11 22 1111 33 33 11

11 44 66 44 11…… …… …… …… …… ……

Page 31: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 31

Pascal’s TrianglePascal’s TriangleSince we have C(n + 1, k) = C(n, k – 1) + C(n, k) andSince we have C(n + 1, k) = C(n, k – 1) + C(n, k) andC(0, 0) = 1, we can use Pascal’s triangle to simplify C(0, 0) = 1, we can use Pascal’s triangle to simplify the computation of C(n, k):the computation of C(n, k):

C(0, 0) = C(0, 0) = 11C(1, 0) = C(1, 0) = 11C(1, 1) = C(1, 1) = 11

C(2, 0) = C(2, 0) = 11C(2, 1) = C(2, 1) = 22C(2, 2) = C(2, 2) = 11C(3, 0) = C(3, 0) = 11C(3, 1) = C(3, 1) = 33C(3, 2) = C(3, 2) = 33C(3, 3) = C(3, 3) = 11

C(4, 0) = C(4, 0) = 11C(4, 1) = C(4, 1) = 44C(4, 2) = C(4, 2) = 66C(4, 3) = C(4, 3) = 44C(4, 4) = C(4, 4) = 11

kk

nn

Page 32: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 32

Binomial CoefficientsBinomial CoefficientsExpressions of the form C(n, k) are also called Expressions of the form C(n, k) are also called binomial coefficientsbinomial coefficients..How come?How come?A A binomial expressionbinomial expression is the sum of two is the sum of two terms, such as (a + b).terms, such as (a + b).Now consider (a + b)Now consider (a + b)2 2 = (a + b)(a + b).= (a + b)(a + b).When expanding such expressions, we have When expanding such expressions, we have to form all possible products of a term in the to form all possible products of a term in the first factor and a term in the second factor:first factor and a term in the second factor:(a + b)(a + b)22 = a·a + a·b + b·a + b·b = a·a + a·b + b·a + b·bThen we can sum identical terms:Then we can sum identical terms:(a + b)(a + b)22 = a = a22 + 2ab + b + 2ab + b22

Page 33: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 33

Binomial CoefficientsBinomial CoefficientsFor (a + b)For (a + b)3 3 = (a + b)(a + b)(a + b) we have= (a + b)(a + b)(a + b) we have(a + b)(a + b)3 3 = = aaa + aab + aba + abb + baa + bab + aaa + aab + aba + abb + baa + bab + bba + bbbbba + bbb(a + b)(a + b)3 3 = a= a33 + 3a + 3a22b + 3abb + 3ab22 + b + b33

There is only one term a3, because there is only one possibility to form it: Choose a from all three factors: C(3, 3) = 1.There is three times the term a2b, because there are three possibilities to choose a from two out of the three factors: C(3, 2) = 3.Similarly, there is three times the term ab2 (C(3, 1) = 3) and once the term b3 (C(3, 0) = 1).

Page 34: 2/24/20161 One, two, three, were Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: How many different 8-letter

05/06/23 34

Binomial CoefficientsBinomial CoefficientsThis leads us to the following formula:This leads us to the following formula:

jn

j

jnn bajnCba

0

),()(

With the help of Pascal’s triangle, this formula can With the help of Pascal’s triangle, this formula can considerably simplify the process of expanding powers considerably simplify the process of expanding powers of binomial expressions.of binomial expressions.For example, the fifth row of Pascal’s triangleFor example, the fifth row of Pascal’s triangle(1 – 4 – 6 – 4 – 1) helps us to compute (a + b)(1 – 4 – 6 – 4 – 1) helps us to compute (a + b)44::(a + b)(a + b)44 = a = a44 + 4a + 4a33b + 6ab + 6a22bb22 + 4ab + 4ab33 + b + b44

(Binomial (Binomial Theorem)Theorem)