More sophisticated counting - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

More sophisticated counting

Description:

mods' out the effect of the unordered I's, the second quotient of 4! ... mods' out the effect of the unordered P's. Fall 2003. CMSC 203 Discrete Structures ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 17
Provided by: paula107
Category:

less

Transcript and Presenter's Notes

Title: More sophisticated counting


1
More sophisticated counting
  • Advanced CountingText sections 4.5 4.6

2
The Division Rule
  • Theorem Suppose a set A has n elements and is
    partitioned by the collection A1, A2, ..., Ap,
    where each partition set has m elements.
    Then p n/m.
  • In other words, if a set is partitioned into
    equal-sized partition sets, then the number of
    partition sets is the quotient of the size of the
    set with the size of any partition set.
  • For example, if a set has 100 elements and is
    partitioned in 20-element subsets, then there
    must be 5 subsets (equivalence classes).

3
Generalized Permutations
  • Permutations teach us how to count the number of
    orderings of the letters of COMPUTER (8!). What
    about the number of orderings of the letters of
    MISSISSIPPI?
  • In this case, we note that not all the letters
    are distinct. In particular, MISSISSIPPI
    IIIISSSSPPM, so although we are still searching
    for an ordering structures, there are
    sub-unorderings present, induced by the repeated
    letters, for which we have to account.

4
Generalized Permutations Take 1
  • Lets apply the Division Rule to negate the
    effect of the unordering portions of the overall
    order problem.
  • This leaves us with a total count of 11!/4!4!2!.
  • Here, the first quotient of 4! mods out the
    effect of the unordered Is, the second quotient
    of 4! mods out the effect of the unordered Ss,
    and the last quotient of 2! mods out the effect
    of the unordered Ps.

5
Generalized Permutations Take 2
  • If we model this problem, purely as a
    combination, and not a permutation at all, we can
    reason the task as 1. Choose 4 slots from 11
    for the Is 2. Choose 4 slots from the
    remaining 7 for the Ss 3. Choose 2 slots
    from the remaining 3 for the Ps 4. Place
    the M (only 1 way remaining).
  • This yields C(11,4)C(7,4)C(3,2)C(1,1)
    (11!7!3!)/(7!4!4!3!2!1!) 11!/(4!4!2!).

6
Generalized Permutation Theorem
  • Theorem Suppose a collection consists of n
    objects of whichn1 are of type 1,
    indistinguishable from each other n2 are of type
    2, indistinguishable from each other ...nk are
    of type k, indistinguishable from each otherand
    n1 n2 ... nk n. Then the number of
    distinct permutations of the n objects
    isC(n,n1)C(n-n1,n2)C(n-n1-n2,n3)...C(nk,nk)
    n! / (n1!n2!n3!...nk!).

7
Combinations with Repetition
  • In the last section, we saw how to count
    combinations, where order does not matter, based
    on permutation counts, and we saw how to count
    permutations where repetitions occur.
  • Now, we shall consider the case where we dont
    want order to matter, but we will allow
    repetitions to occur.
  • This will complete the matrix of counting
    formulae, indexed by order and repetition.

8
A Motivating Example
  • How many ways can I select 15 cans of soda from a
    cooler containing large quantities of Coke,
    Pepsi, Diet Coke, Root Beer and Sprite?
  • We have to model this problem using the chart
    Coke Pepsi Diet Coke Root Beer Sprite
  • A 111 111 111 111
    111 15
  • B 11 111111 111111
    1 15
  • C 1111 1111111 1111
    15
  • Here, we set an order of the categories and just
    count how many from each category are chosen.

9
A Motivating Example (contd.)
  • Now, each event will contain fifteen 1s, but we
    need to indicate where we transition from one
    category to the next. If we use 0 to mark our
    transitions, then the events become
  • A 1110111011101110111
  • B 1100111111011111101
  • C 0011110111111101111
  • Thus, associated with each event is a binary
    string with 1s things to be chosen and 0s
    transitions between categories.

10
Counting Generalized Combinations
  • From this example we see that the number of ways
    to select 15 sodas from a collection of 5 types
    of soda is C(15 4,15) C(19,15) C(19,4).
  • Note that zeros transitions categories -
    1.
  • Theorem The number of ways to fill r slots from
    n catgories with repetition allowed is C(r n
    - 1, r) C(r n - 1, n - 1).
  • In words, the counts are C(slots
    transitions, slots)or C(slots
    transitions, transitions).

11
Another Example
  • How many ways can I fill a box holding 100 pieces
    of candy from 30 different types of candy?
  • Solution Here slots 100, transitions 30 -
    1,so there are C(10029,100) 129!/(100!29!)
    different ways to fill the box.
  • How many ways if I must have at least 1 piece of
    each type?
  • Solution Now, we are reducing the slots to
    choose over to (100 - 30) slots, so there are
    C(7029,70) 99!/70!29!

12
When to Use Generalized Combinations
  • Besides categorizing a problem based on its order
    and repetition requirements as a generalized
    combination, there are a couple of other
    characteristics which help us sort
  • In generalized combinations, having all the slots
    filled in by only selections from one category is
    allowed
  • It is possible to have more slots than categories.

13
Integer Solutions to Equations
  • One other type of problem to be solved by the
    generalized combination formula is of the
    form How many non-negative integer
    solutions are there to the equation a b c
    d 100.
  • In this case, we could have 100 as or 99 as and
    1 b, or 98 as and 2 ds, etc.
  • We see that the slots 100 and we are ranging
    over 4 categories, so transitions 3.
  • Therefore, there are C(1003,100) 103!/100!3!
    non-negative solutions to a b c d 100.

14
Integer Solutions with Restrictions
  • How many integer solutions are there to a b
    c d 15, when a ³ 3, b ³ 0, c ³ 2 and d ³
    1?
  • Now, solution strings are 111a0b011c01d, where
    the a,b,c,d are the remaining numbers of each
    category to fill in the remaining slots.
  • However, the number of slots has effectively been
    reduced to 9 after accounting for a total of 6
    restrictions.
  • Thus there are C(93,9) 12!/(9!3!) solutions.

15
More Integer Solutions Restrictions
  • How many integer solutions are there to a b
    c d 15, when a ³ -3, b ³ 0, c ³ -2 and d ³
    -1?
  • In this case, we alter the restrictions and
    equation so that the restrictions go away. To
    do this, we need each restriction ³ 0 and balance
    the number of slots accordingly.
  • Hence a ³ -33, b ³ 0, c ³ -22 and d ³
    -11,yields a b c d 15321 21
  • So, there are C(213,21) 24!/(21!3!) solutions.

16
Summary
  • Theorem The number of integer solutions to a1
    a2 a3 ... an r, when a1 ³ b1, a2 ³ b2,
    a3 ³ b3 , ..., an ³ bn isC(rn-1-b1-b2-b3-...-bn
    , r-b1-b2-b3-...-bn).
  • Theorem The number of ways to select r things
    from n categories with b total restrictions on
    the r things is C(r n - 1 - b , r - b).
  • Corollary The number of ways to select r things
    from n categories with at least 1 thing from each
    category is C(r - 1 , r - n) (set b n).
Write a Comment
User Comments (0)
About PowerShow.com