Documents
Resources
Learning Center
Upload
Plans & pricing Sign in
Sign Out

Counting Techniques.ppt - CLC

VIEWS: 141 PAGES: 15

									COUNTING TECHNIQUES




  PERMUTATIONS
      AND
  COMBINATIONS
    Computer Science, Statistics and Probability all involve
    counting techniques which are a branch of mathematics
    called combinatorics (ways to combine things).

For dinner you have the following choices:
        APPETIZERS                         MAINS




     soup       salad         chicken    shrimp    hamburger

      DESSERTS
                           How many different combinations
                           of meals could you make?


                
                            We'll build a tree diagram to
    ice cream
                            show all of the choices.
Notice the number of choices at each branch      We ended up with
                                                 12 possibilities
    2         3         2
 choices   choices   choices                  soup, chicken, ice cream

2  3  2 = 12                                soup, chicken, 

                     shrimp                   soup, shrimp, ice cream
                                              soup, shrimp, 
                                              soup, hamburger, ice cream
                                              soup, hamburger, 
                                              salad, chicken, ice cream
                                              salad, chicken, 
                      shrimp                  salad, shrimp, ice cream
                                              salad, shrimp, 
 Now to get all                               salad, hamburger, ice cream
 possible choices we
                                              salad, hamburger, 
 follow each path.
 Multiplication Principle of Counting
 If a task consists of a sequence of choices in which
 there are p selections for the first choice, q selections for
 the second choice, r selections for the third choice, and
 so on, then the task of making these selections can be
 done in               pqr
 different ways.

If we have 6 different shirts, 4 different pants, 5 different pairs
of socks and 3 different pairs of shoes, how many different
outfits could we wear?

                   6  4  5  3 = 360
      A permutation is an ordered arrangement
      of r objects chosen from n objects.
        For combinations order does not matter but for
        permutations it does.
There are three types of permutations.
The first is distinct with repetition.      This means there are n
                                            distinct objects but in
this means different
                                            choosing r of them you
                                            can repeat an object.
Let's look at a 3              There are 10 choices for the first number
combination lock               There are 10 choices for the second number
with numbers 0                 and you can repeat the first number
through 9
                               There are 10 choices for the third number
                               and you can repeat

By the multiplication principle there are 10  10  10 = 1000 choices
This can be generalized as:

Permutations: Distinct Objects with Repetition
The number of ordered arrangements of r objects
chosen from n objects, in which the n objects are
distinct and repetition is allowed, is nr


                   What if the lock had four choices
                   for numbers instead of three?



                 104 = 10 000 choices
   The second type of permutation is distinct, without
   repetition.
   Let's say four people have a race. Let's look at the
   possibilities of how they could place. Once a person has
   been listed in a place, you can't use that person again (no
   repetition).
First place would be         Based on the multiplication principle:
choosing someone from        4  3  2  1 = 24 choices
among 4 people.
Now there are only 3 to
choose from for second
place.
Now there are only 2
to choose from for
third place.                    4th      3rd       2nd      1st
Only one possibility for
fourth place.
    nPr, means the number of ordered arrangements of r objects
    chosen from n distinct objects and repetition is not allowed.

                                n!
                       nP 
                         r
                            n  r  !
                                 4!      4  3  2 1
                       4P                            24
In the last example:
                         4
                             4  4 !        0!
If you have 10 people
racing and only 1st, 2nd
and 3rd place how many                          0! = 1
possible outcomes are
there?                   10!       10  9  8  7!
               10 P                               720
                   3
                      10  3 !         7!
  A combination is an arrangement of r
  objects chosen from n objects regardless
  of order.

 nCr , means the number combinations of r objects chosen
 from n distinct objects and repetition is not allowed.

               n!                               n
  n Cr                                or        
         n  r  ! r!                          r
Order doesn't matter here so the combination 1, 2, 3 is not
different than 3, 2, 1 because they both contain the same
numbers.
You need 2 people on your committee and you have 5 to
choose from. You can see that this is without repetition
because you can only choose a person once, and order
doesn’t matter. You need 2 committee members but it
doesn't matter who is chosen first. How many
combinations are there?
                                  5!       5  4  3!
                      5 C2                           10
                              5  2 !2! 3!2!
    The third type of permutation is involving n objects that
    are not distinct.
How many different combinations of letters in specific
order (but not necessarily English words) can be formed
using ALL the letters in the word REARRANGE?

      E        R       N       R       A     A     G       E      R
 The "words" we form will have 9 letters so we need 9 spots to
 place the letters. Notice some of the letters repeat. We need
 to use R 3 times, A 2 times, E 2 times and N and G once.
      9C3  6C2      4C2      2C1  1C1
                       84  15  6  2  1 = 15 120 possible "words"
 First we choose
                       That leaves               That leaves
 positions for the
                       6 positions               2 positions
 R's. There are 9                                            That leaves
                       for 2 A's.  That leaves   for the N.
 positions and we'll                                         1 position
 choose 3, order                   4 positions
                                   for 2 E's.                for the G.
 doesn't matter
This can be generalized into the following:

    Permutations Involving n Objects
         That Are Not Distinct
   The number of permutations of n objects
    of which n1 are of one kind, n2 are of a
  second kind, . . ., and nk are of a kth kind
                         is given by
                                 n!
                        n1 ! n2 !  nk !
               where n  n1  n2              nk
A national hamburger chain used to advertise that it
fixed its hamburgers “256 ways” since customers
could order whatever toppings they wanted. How
many toppings must have been available?
    For each topping, the choice is yes (put it on my
    burger!) or no (leave it off!).
                           2n = 256
                       log 2n = log 256
                       n log 2 = log 256
                                  log256
                             n
                                    log2
                          n=8
    There must have been 8 possible toppings.
      Group Assignment
For each of the following numbers, make up
a counting problem that has the number as
its answer.
1. 52C3
2. 12C3
3. 25P11
4. 25
               Homework
• Pg 609 – 611 #11, 13, 17, 19, 25, 35, 39, 45,
  51

								
To top