160 likes | 351 Views
Discrete Structures Chapter 4 Counting and Probability. Nurul Amelina Nasharuddin Multimedia Department. Outline. Rules of Sum and Product Permutations Combinations: The Binomial Theorem Combinations with Repetition: Distribution Probability. Example: Lotto.
E N D
Discrete StructuresChapter 4 Counting and Probability Nurul Amelina Nasharuddin Multimedia Department
Outline • Rules of Sum and Product • Permutations • Combinations: The Binomial Theorem • Combinations with Repetition: Distribution • Probability
Example: Lotto • Pick 6 numbered balls out of 49 (numbered consecutively 1,2,3,…,49) without replacing them. How many ways can this be done (the order is important here) • First ball: 49 choices, Second : 48, Third: 47, Fourth: 46, Fifth: 45, Sixth: 44 • Total: 49 48 47 46 45 44 = 10,068,347,520 • So there are over 10 billion ways to pick the six balls
Example: Lotto • But the order is not important when playing Lotto 1 2 3 4 5 6 6 5 4 3 2 1 1 3 2 4 5 6 etc. are the same and should not be counted separate • So we can NOT use the permutation formula • We use the COMBINATION formula
Combinations • Permutation is an ordered selection, combination is an unordered selection • An r-combination of a set of n elements is an unordered selection of r elements from the set, repetition is not allowed: C(n, r) = n! / [ r!(n - r)! ] • Or: Number of subsets of size r that can be chosen from a set of n elements • Notes: (a) C(n, r) = P(n, r) / r! (b) C(n, n) = 1 (c) C(n, 0) = 1 (d) C(n, r) = C(n, n ‐ r)
Binomial Coefficient • The number of r-combination of a set with n distinct elements is denoted by C(n, r) • Note that C(n, r) is also denoted by and is called the binomial coefficient • “n choose r”
Example (1) • How many ways can 2 out of 3 paintings of an artist be selected for shipment to an exhibition? • Let the paintings correspond to {A,B,C} • There are 6 permutations, but only 3 combinations: {A,B},{A,C},{B,C}
Example (2) • Find the number of ways in which 3 components can be selected from a batch of 20 different components C(20, 3) = 20! / [ 3!(20 – 3)! ] = 20! / (3!17!) = 1140
Example (3) • In how many ways can a group of 4 boys be selected from 10 if (a) the eldest boy is included in each group? (b) the eldest boy is excluded? (c) What proportion of all possible groups contains the eldest boy?
Example (3) (a) Choose 3 from 9, since the eldest boy is fixed: C(9, 3) = 9! / [ 3! (9 - 3)! ] = 84 (b) If the eldest boy is excluded, it is actually choose 4 boys from 9: C(9, 4) = 9! / [ 4! (9 - 4)! ] = 126 (c) The number of all possible groups is C(10, 4) = 10! / [ 4! (10 - 4)! ] = 210 So the proportion of all possible groups containing the eldest boy is: 84 / 210 = 40%
The Binomial Theorem • In algebra, the sum of two terms, such as x + y is called binomial • The binomial theorem gives an expression for the powers of a binomial (x + y)n, for each positive integer n and all real numbers x and y • The expansion of (x + y)3 can be found using combinatorial reasoning instead of multiplying the three terms out
Multiplying the terms: (x + y)3 (x + y)3 = (x + y)(x + y)(x + y) = (xx + xy + yx + yy)(x + y) = xxx + xyx + yxx + yyx + xxy + xyy + yxy + yyy = x3 + 3x2y + 3xy2 + y3
Combinatorial reasoning: (x + y)3 • When (x + y)3 = (x + y)(x + y)(x + y) is expanded, terms of the form x3 , x2y, xy2, and y3 arise. • To obtain a term of the form x3 , an x must be chosen in each of the sums, and this can be done in only one way. Thus, the x3 term in the product has a coefficient of l. • x2y: choose x in two of the three sums (and consequently a y in the other sum). Hence, the number of such terms is the number of 2-combinations of three objects, • xy2: choose x from one of the three sums (and consequently take a y from each of the other two sums). This can be done in ways. • y3 : choose the y for each of the three sums in the product, and this can be done in exactly one way.
Binomial Theorem • Given any real numbers a and b and any nonnegative integer n, (a + b)n = =
Example (1) • What is the expansion of (x – 4y)4? (x +(– 4y))4 = • What is the coefficient of term x3y? Ans: -16
Example (2) • What is the coefficient of a5b7 in (a – 2b)12? The term is Ans: The coefficient is – 101376