3. Elementary Counting Problems 4.1,4.2. Binomial and Multinomial Theorems 2

3. Elementary Counting Problems 4.1,4.2. Binomial and Multinomial Theorems 2

3. Elementary Counting Problems 4.1,4.2. Binomial and Multinomial Theorems 2. Mathematical Induction Prof. Tesler Math 184A Fall 2017 Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 1 / 38 Multiplication rule Combinatorics is a branch of Mathematics that deals with systematic methods of counting things. Example How many outcomes (x, y, z) are possible, where x = roll of a 6-sided die; y = value of a coin flip; z = card drawn from a 52 card deck? (6 choices of x) (2 choices of y) (52 choices of z) = 624 × × Multiplication rule The number of sequences (x1, x2,..., xk) where there are n1 choices of x1, n2 choices of x2,..., nk choices of xk is n1 n2 nk. · ··· This assumes the number of choices of xi is a constant ni that doesn’t depend on the other choices. Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 2 / 38 Cartesian product The Cartesian Product of sets A and B is A B = f (x, y): x A, y B g By the Multiplication× Rule, this has size2 jA 2Bj = jAj jBj. × · Example: f1, 2g f3, 4, 5g = f(1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5)g × The Cartesian product of sets A, B, and C is A B C = f (x, y, z): x A, y B, z C g This has size×jA ×B Cj = jAj jBj jC2j. 2 2 × × · · This extends to any number of sets. Example Roll of a 6-sided die A = f1, 2, 3, 4, 5, 6g jAj = 6 Value of a coin flip B = fH, Tg jBj = 2 Cards C = fA , 2 ,...g jCj = 52 ~ ~ The example on the previous slide becomes jA B Cj = 6 2 52 = 624. × × · · Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 3 / 38 Notation We often will need an n-element set. For n > 1, define [n] = f1, 2, 3,..., ng and also [0] = . ; Again, you may have seen [x] used for greatest integer, but we instead use x for floor and x for ceiling. b c d e Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 4 / 38 Powers Let A be a set. Ak = A A A (k times) × × · · · × jAkj = jAjk Example [2] = f1, 2g, with size j[2]j = j f1, 2g j = 2. [2]3 = f(1,1,1), (1,1,2), (1,2,1), (1,2,2), (2,1,1), (2,1,2), (2,2,1), (2,2,2)g j[2]3j = 23 = 8 Example How many k letter strings are there over an n letter alphabet? 3-letter strings over the alphabet fa, b,..., zg: aaa, aab, aac,..., zzy, zzz There are 263 of them. In general, there are nk strings. Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 5 / 38 Power set The power set of a set is the set of all of its subsets: P(S) = f A : A S g ⊆ P([3]) = P(f1, 2, 3g) = f , f1g , f2g , f3g , f1, 2g , f1, 3g , f2, 3g , f1, 2, 3gg ; Be careful on use of vs. : 2 ⊂ 1 < P([3]) P([3]) f1g P([3]) f1g , f2g , f1, 2g P([3]) ; 2 2 2 f g P([3]) ff1gg P([3]) ff1g , f2g , f1, 2gg P([3]) ; ⊂ ⊂ ⊂ How big is jP(S)j? Equivalently, how many subsets does a set have? Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 6 / 38 Number of subsets of an n-element set First solution How many subsets does an n element set have? We’ll use [n]; the solution will work for any set of size n, but it’s easier to work with a specific set. Make a sequence of decisions: Include 1 or not? Include 2 or not? Include··· n or not? Total: (2 choices)(2 choices) (2 choices) = 2n ··· Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 7 / 38 Number of subsets of an n-element set First solution Include 1? ; No Yes 1 Include 2? ; { } 2 1 1, 2 Include 3? ; { } { } { } ([3]) 3 2 2, 3 1 1, 3 1, 2 1, 2, 3 P ; { } { } { } { } { } { } { } Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 8 / 38 Number of subsets of an n-element set Second solution Consider a subset S [n]. ⊆ Form the word w1 wn or a sequence (w1,..., wn) ··· 1 if i S; wi = 2 0 otherwise. Example: The subset S = f1, 3, 4g of [5] is encoded as a word 10110 or as a sequence (1, 0, 1, 1, 0). Each subset of [n] gives a unique word in f0, 1gn and vice-versa. j f0, 1gn j = 2n, so there are 2n words and thus 2n subsets. This is called a bijective proof . Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 9 / 38 Function terminology Consider a function f : P Q. For element x in the set P, the function assigns a value f!(x) in the set Q. f is one-to-one iff for all x, y P, when f (x) = f (y) then x = y. 2 This is also called an injection. This means every element of Q either has exactly one inverse, or has no inverse. If f is one-to-one then jPj 6 jQj. f is onto iff for every z Q, there is at least one x P with f (x) = z. 2 2 This is also called a surjection. This means every element of Q has at least one inverse. If f is onto then jPj > jQj. f is a bijection iff it is one-to-one and onto. This means every element of Q has exactly one inverse. If f is a bijection then jPj = jQj. Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 10 / 38 Function terminology f : P Q ! P Q For all functions, exactly one arrow leaves each element of P. One-to-one / Injection: At most one arrow hits each element of Q. Onto / Surjection: At least one arrow hits each element of Q. Bijection: Exactly one arrow hits each element of Q. Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 11 / 38 Number of subsets of an n-element set Second solution, continued Define f : P([n]) f0, 1gn as follows: ! for S [n], form the word f (S) = w = w1 wn, where ⊆ ··· 1 if i S; wi = 2 0 otherwise. f is one-to-one: Suppose f (S) = f (T) = w. We need to show this requires S = T. Both S and T are subsets of [n]. For each i = 1,..., n, if wi = 1 then i S and i T, 2 2 while if wi = 0 then i < S and i < T. Thus, S and T have the exact same elements, so S = T. f is onto: Given w f0, 1gn, we must construct an inverse in the domain. There may2 be more than one inverse; we just have to construct one. S = f i [n]: wi = 1 g is in the domain and satisfies f (S) = w. 2 Thus, f is a bijection. So jP([n])j (the number of subsets of an n-element set) equals j f0, 1gn j = 2n. Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 12 / 38 Number of subsets of an n-element set Third solution We will use Mathematical Induction (Chapter 2) to prove that the n number of subsets of [n] is 2 , for all integers n > 0: In general, the goal is to prove that a statement is true for all integers n > n0. Often, n0 is 0 or 1, but that’s not required. Base case: Show that the statement is true for n = n0. Sometimes it’s necessary to prove it specially for several other small values of n. Induction step: Assume that the statement holds for n. Use that to prove that it holds true for n + 1. Conclusion: the statement holds for all integers n > n0. Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 13 / 38 Number of subsets of an n-element set Third solution n For all integers n > 0, the number of subsets of [n] is 2 . Base case First we show the statement is true for the smallest value of n (in this case, n = 0). When n = 0, [n] = [0] = has just one subset, which is . ; ; The formula gives 2n = 20 = 1. These agree, so the statement holds for the base case. Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 14 / 38 Number of subsets of an n-element set Third solution Induction step n For some n > 0, assume that the number of subsets of [n] is 2 . Use that to prove the number of subsets of [n + 1] is 2n+1 Split the subsets of [n + 1] into P Q, where [ P is the set of subsets of [n + 1] that don’t have n + 1, and Q is the set of subsets of [n + 1] that do have n + 1. P is the set of subsets of [n]. By the induction hypothesis, jPj = 2n. Insert n + 1 into each set in P to form Q. Thus, jPj = jQj. E.g., for n = 2: P = , f1g , f2g , f1, 2g ; Q = f3g , f1, 3g , f2, 3g , f1, 2, 3g The total number of subsets of [n + 1] is jPj + jQj = 2(2n) = 2 n+1. (This is an example of the Addition Rule, to be covered next.) n Conclusion: For all integers n > 0, the number of subsets of [n] is 2 . Prof. Tesler Elementary Counting Problems Math 184A / Fall 2017 15 / 38 Addition rule Count the number of days in a year, as follows.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    38 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us