 Download Download Presentation Counting Methods

# Counting Methods

Download Presentation ## Counting Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. Counting Methods Chapter 6

2. Section1.1 • Sum Principle: The size of a union of 2 disjoint sets is the sum of their sizes |A U B| = |A| + |B| if A  B = Ø |A U B| = |A| + |B| - |A  B| if A  B ≠ Ø

3. Product Principle • Version1: The size of the union of m disjoint sets, each of size n is m.n • Version2: If m different elements appear as the first elements of ordered pairs in a set S, and each first element appears with exactly n different elements in ordered pairs in S, then S contains m.n ordered pairs.

4. Product Principle • Ex: We have two classes of 15 and 10 students in each. We need to form a committee of 2 students, one from each class. How many different committees can we have?

5. The General Product Principle • Let S be a set of m-tuples such that: • There are n1 different first elements of m-tuples. • Given the first k-1 elements of an n-tuple, there are nk different kth elements appearing with them in m-tuples. Then there are n1.n2.n3 …… .nm m-tuples in S.

6. Permutations • An m-element permutation of S is a list of m distinct elements of S. Ex: S= {a,b,c,d} 3-element permutation of S: abc, bac, cab, bca …… 4x3x2 = 24 permutations

7. Permutations • An n-element permutation of an n-element set S, is called a permutation of S. • Ex: S = { a,b,c} The permutations of S: abc, acb, bac, bca, cab, cba

8. Permutations • In how many ways can a 10-person club choose 3 different people to be president, vice president, and a treasurer?

9. Functions • Theorem: The number of functions from an m-element set to an n-element set is nm. Ex: We have 5 different chairs and 7 colors to paint. In how many ways may we paint the chairs if all chairs must be in different colors? What if we may use the same color on several (or all) chairs?

10. Subsets ( section 6.2) • A set of n elements has 2n subsets. • A subset of n elements can be viewed as a function f : S  {0,1} f(x) = 0 iff x is not in S f(x) = 1 iff x is in S • Ex: {a,b} has 4 subsets. List them.

11. Subsets • The number of m-element subsets of an n-element set is given by n! / (n-m)! m! Proof: A given m-element subset can be listed in m! ways, so the product principle gives us: Number of m-element subsets . m! = number of m-element permutations So, number of m-element subsets= number of m-permutations/m!

12. Example • A 10 member club must select a president, a vice-president and a secretary treasurer. They must also select a 3 member social committee. In how many ways do they make each of these selections? In addition, the club members serve as big brothers for a children’s group, if 3 new children join that group, in how many ways may the 3 children select their big brothers?

13. Example • Write down the 2 element permutations, 2 element subsets, and 2 tuples from the set {a,b,c}

14. Multisets • A multiset chosen from a set S is specified by a function m from S to the non-negative integers. For each x in S, m(x) is called the multiplicity of x. The size of the multiset is the sum of the multiplicities of the elements of S. • Ex: what is the multiplicity of each letter in the word roof?

15. Multisets • The number of k-element multisets chosen from an n-element set is given by n+k-1 over k (combination) Ex: S= {1,2} List all multisets of S of total size 3.

16. Multisets • Ex: A bin of personal computer disks contains a large supply of disks from 4 different manufacturers. In how many ways may someone choose 6 discs from the bin?

17. Example • A ten-person club must select a president, a vice-president and a secretary treasurer. They must also select a 3 person committee. If the officers may not serve on the committee, in how many ways may both selections be made? Assume one person cannot be assigned more than one position.

18. The diagrams and the sum principle • Find the number of ways to deal with each case, then add the results together. Ex: We flip a coin. If it comes up head, we roll a die. If it comes up tail, we flip it again. How many outcomes are possible? Draw diagram.

19. The diagrams and the sum principle • Ex: 4 nickels, 3 dimes, 4 quarters. We select coins until we have 50 cents. In how many ways may we do this?

20. Counting Equivalence Classes • Consider 4 computers A,B,C,D to be connected as in the directed graph below. In how many different ways can we arrange the 4 computers? A B D C

21. Counting Equivalence Classes • Consider 5 computers to be connected in a linear network. In how many different ways can the computers be connected? A B C D E

22. Counting Equivalence Classes • Consider 5 computers A,B,C,D,E to be connected as follows, in how many different ways could you connect the computers? A B C D E

23. Ordered Distribution • An ordered distribution of the elements from a set S to a set T is a function that assigns a permutation of some (perhaps all or none) of the elements of S to each element of T in such a way that each element of S is in one and only one of these permutations.

24. Ordered Distribution • Ex: We have 3 computers. We have 4 jobs to be performed: A, B, C, D. In how many ways may the jobs be assigned to the computers?

25. Theorem • The number of ordered distributions of a k element set to an n element set is n(n+1) (n+2) ……… (n+k-1)= (n+k-1)!/(n-1)!

26. Ordered Distribution • Ex: In how many ways may 12 distinct books be placed on 3 shelves of a bookcase, assuming there is room on each shelf for all books.

27. Note • If the order in which jobs are received is irrelevant, nor is it important who receives what; then we are talking about multisets. (how many each gets is important)

28. Section 6.4 The Binomial Theorem and Pascal’s Triangle • Binomial is a polynomial that is a sum of 2 terms, at least one of which contains a variable. Ex: 1+x2, 3-4x, x+y

29. The Binomial Theorem • (x+y)0 = 1 • (x+y)1 = x + y • (x+y)2 = x2 + 2xy + y2 • (x+y)3 = x3 + 3x2y + 3xy2 + y3 • (x+y)4 = x4 + 4x3y + 6x2y2 + 4xy3 + y4 • (x+y)n = …………………………

30. The Binomial Theorem • Ex: (x + y)6 See example 37, example 38 page 267, 268

31. Pascal’s Triangle • Theorem: The number of ways to select k elements out of N to be in a subset is the same as the number of ways to select N-k elements out of N to be out of a subset.

32. Pascal’s Triangle

33. Pascal’s Triangle • Each entry is the sum of the two above it to the left and right. We call this property the Pascal property. • Example given in class.