Math 103 04 Combinatorics

download Math 103 04 Combinatorics

of 7

Transcript of Math 103 04 Combinatorics

  • 8/11/2019 Math 103 04 Combinatorics

    1/7

    1

    Math 103Statistics andProbability

    Combinatorics

    CJD

    Fundamentals

    Experiment : Any process that generates a set of data.

    Observations : The recorded information as a result of an experiment

    Sample Space S : The set of all possible outcomes of an experiment.

    Sample Point : A particular outcome in the sample space.

    Event : A subset of a sample space.

    Simple Event : An event with only one element (sample point).

    Compound Event : The union of simple events.

    Null Space : Subset of sample space containing no elements.

    CJD

    Example

    Experiment: Toss a coin thrice.

    First Toss Second Toss Third Toss

    Tree Diagram for listing all sample points of sample space S

    H

    T

    T

    T

    T

    T

    T

    T

    H

    H

    H

    H

    H

    H

    S = { HHH, HHT, HTH, HTT, THH, THT, TTH, TTT }

    CJD

    Example (cont)

    SH2 = Event when exactly two heads appear= { HHT, HTH, THH }

    S1H = Event when the first toss results in a head= { HHH, HHT, HTH, HTT }

    SH = Event when all heads appear (a simple event)

    = { HHH }

    Venn Diagram

    HHH

    HHT

    HTH

    HTT

    THH

    TTT

    THT

    TTH

    S

    SH

    S1H SH2

  • 8/11/2019 Math 103 04 Combinatorics

    2/7

    2

    CJD

    SH2 = { HHT, HTH, THH }

    S1H = { HHH, HHT, HTH, HTT }SH = { HHH }

    Intersection : contains all sample points common to both events.A = SH2 S1H = { HHT, HTH }

    Mutually Exclusive Events : cannot occur simultaneously.

    B = SH2 SH = (SH2 and SH are mutually exclusive)

    Union : contains all sample points from first OR second set.

    C = SH2 S1H = {HHT, HTH, THH, HHH, HTT}

    Complement : contains sample points not in given set

    D = S1H = S S1H = { TTT , TTH, THT, THH }

    Operations on Events

    CJD

    Exercise

    Experiment : Roll a pair of dice. (one red, one white)

    What is the sample space?

    Find A = event of getting a total of more than 10 dots.Find B = event of getting an odd sum

    Find C = event of getting the same number of dots on each die

    Find the intersection of A and B

    Find the intersection of B and C

    Find the union of B and CFind the complement of the intersection of A and B

    CJD

    Combinatorics

    Combinatorial Reasoning underlies analysis

    in computer science (like algorithms),discrete operations, research problems and

    finite probability.

    Systematic analysis of different possibilities

    Exploration of logical structure of a problem

    Ingenuity

    We are primarily concerned with

    Counting Techniques.

    CJD

    Counting PrinciplesThe Addition PrincipleIf there are n1 different objects in the first set, n2 objects inthe second, , nm objects in the k

    th set,and if the different sets are disjoint (i.e. mutually exclusive orpairwise intersections are empty),

    Then the number of ways to select an object from one ofthe m sets is n1+n2++nk.

    The Multiplication Principle:If a first operation can be performed in n1 ways, and foreach of these a second operation can be performed in n2ways, , and for each way to perform the first (k-1)operations, the kth operation can be performed in nk ways.Then the number of ways to perform the k operations isn

    1

    n2

    nk

    .

  • 8/11/2019 Math 103 04 Combinatorics

    3/7

    3

    CJD

    Addition Principle Example200 students take Calculus, 500 take Statistics and 150

    take both, how many (distinct) students are in these twoclasses?

    Solution 1: Use Inclusion-Exclusion formula from Discrete Math.

    Solution 2 :

    Addition rule cannot be applied directly because the sets are

    not disjoint. So, categorize the data

    200 150 = 50 are in Calculus but not in Statistics

    500 150 = 350 are in Statistics but not in Calculus150 are in Calculus and Statistics.

    These 3 events are disjoint the addition principle applies.

    So the answer is

    50 + 350 + 150 = 550

    n (A B) = n (A) + n (B) n (A B)

    CJD

    Experiment : Roll a pair of dice. (one red, one white)

    How many outcomes are there?

    How many outcomes are there with no doubles (differentvalue on the two dice) ?

    Multiplication Principle Example

    6 outcomes on each die. 6 x 6 = 36 outcomes

    Think of rolling the dice in succession, say the red f irst.

    The red die can take any of 6 outcomes,The white die can take any of 5 value except the one on red.

    So there are 6 x 5 ways = 30 outcomes

    CJD

    Exercise

    How many even 4-digit numbers greater than 8000 can be

    formed using the digits 1, 2, 3, 6, 7 and 9 if each digit can beused at most once ?

    Solution:

    The first digit must be 9 so the number is bigger than 8000.

    The fourth digit must be 2 or 6 only two choices.

    The third digit can be any of 4 choices.

    The second digit can be any of 3 choices.

    So there are 1x3x4x2 = 24 such numbers

    CJD

    More Multiplication Exercises

    1. A multiple choice exam has 10 questions with 4 choices each.In how many ways can the exam be answered if each question isanswered with one of the choices ?

    Answer : 4 4 4 4 4 4 4 4 4 4 = 410 ways

    3. How many subsets does a set of 10 elements have ?

    Answer: For each subset, an element of the set may ormay not be included.So there are 2 2 2 2 2 2 2 2 2 2 = 210 ways.

    2. How many bit strings are there with 10 bits ?

    Answer: Each bit may be 0 or 1.

    So there are 2 2 2 2 2 2 2 2 2 2 = 210 ways.

  • 8/11/2019 Math 103 04 Combinatorics

    4/74

    CJD

    Addition and Multiplication Example

    There are 5 different computer books, 6 different mathbooks, and 8 different literature books.How many ways are there to p ick an (unordered) pair

    of two books not in the same category ?

    Solution:

    If computer and math are chosen, 5x6 = 30 waysIf computer and literature, 5x8 = 40 ways

    If math and literature, 6x8 = 48 ways.

    These 3 types of selection are disjoint,

    So there are 30 + 40 + 48 = 118 ways in all.

    CJD

    Permutations

    Permutation is the arrangement of all or part

    of a set of objects into distinguishable

    sequences.

    Each unique ordering is called a permutation.

    The ordering of the objects matters !!!

    CJD

    Permutation Example

    How many different three digit numbers can

    we make from 7, 8, and 9 if we use eachnumber only once?

    We have three numbers to choose from to place inthe hundreds place.After this, we have two left to put in the tens place.Lastly we have one number left over to put in theones place.

    3 2 1 = 6 ways

    These numbers are:

    987 978 897 879 789 798

    CJD

    Factorial

    Factorial : The operation of repeatedly multiplying a

    number times the next lower integer until reaching 1.

    n! = n (n-1) (n-2) 1

    For convenience, define 0! = 1

    In previous example, the number of ways is 3! = 6.

    How many three-digit numbers with distinct digits can be

    formed using the digits 6,7,8,9 and 0 ?

    Answer :

    5 4 3 = 60

    Calculator exercise on Factorials

  • 8/11/2019 Math 103 04 Combinatorics

    5/75

    CJD

    Permutation Formula

    The number of permutations of r objects from n distinct objects

    In earlier example, P(5,3) = 5! / 2!

    = (5 4 3 2 1) / (2 1)= 5 4 3 = 60

    )!(

    !),(

    rn

    nPrnPrn

    ==

    Example : How many ways are there to elect the president,

    vice president, secretary and treasurer of an organizationwith 50 members if all elected officers are different people?

    Answer : P(50,4) = 50 49 48 47 = 5,527,200 ways

    Calculator exercise on Permutations

    CJD

    Permutations in a Circle

    How many ways are there to seat 12 guests in acircular table with 12 equally spaced chairs ?

    Assume 2 circular permutations are the same if one is aresult of a rotation of the other.

    Solution :

    Fix one guest in a chair and arrange the other in

    11! ways.

    The number of permuations of n distinct objects

    arranged in a circle is ( n 1 ) !

    CJD

    Combinations

    Combination is the number of ways ofselecting r objects from n objects without

    regard to ordering

    Each unique selection is called a

    combination.

    Ordering of the selection does NOT matter !!!

    CJD

    Combination ExampleExample: 5 bowlers must enter a tournament with 3 primary

    players and 2 alternates. How many possible teamcombinations could there be?

    That is, how many ways can 3 players be selected from 5?Selecting the 3 automatically selects the 2 alternates.

    Solution :

    The first player can be chosen in 5 ways, the secondin 4 ways, and the third in 3 ways = 5 4 3 = 60 ways.

    But the ordering is not important.After the 3 have been chosen, we must remove theordering of 3 players.There are 3 2 1 = 6 such orderings.

    So there are 60 / 6 = 10 ways to field the team into the

    tournament.

  • 8/11/2019 Math 103 04 Combinatorics

    6/76

    CJD

    Combination Formula

    The number of permutations of r objects from n distinct objects

    )!(!

    !),(

    rnr

    n

    r

    nCrnC

    rn

    =

    ==

    In earlier example, C(5,3) = 5! / 3! 2!

    = (5 4 3 2 1) / ((3 2 1)(2 1))= 5 4 / 2 1 = 10

    Calculator exercise on Combinations

    CJD

    Permutation : Not all objects distinct

    The number of distinct permutations of n things of whichn1 are of a kind, n2 of a second kind, , nk of the kth kind

    where n= n1+ n2++ nk is

    !!!

    !

    2121 kk nnn

    n

    nnn

    n

    LL

    =

    This extends the combination formulafrom 2 groups (selected and unselected) to k groups.

    How many ways to arrange the letters in the wordNAMAMANATA ?

    Answer: 10!/(2!5!2!1!) = (10 9 8 7 6)/(2 2) = 7560 ways

    CJD

    Exercise

    How many ways can 3 red, 4 yellow and 2 blue

    bulbs be arranged in a string of Christmas lightswith 9 sockets?

    Solution : 9! / (3! 4! 2!)= 9 8 7 6 5 / 3 2 2 = 3 2 7 6 5

    = 1260 ways

    CJD

    rnCrnC

    r

    n

    rnr

    n

    rnr

    n==

    =

    =

    ),(

    )!(!

    !

    )(,

    Special Case

    )!(!

    !

    )(, rnr

    n

    rnr

    n

    =

    !!!

    !

    2121 kk nnn

    n

    nnn

    n

    LL

    =

    If k=2,

  • 8/11/2019 Math 103 04 Combinatorics

    7/77

    CJD

    A Combination Application

    XXXXXX

    SodaJuiceCoffee

    Select r objects (repetition allowed) from n types of objects

    282

    78

    6

    81=

    =

    =

    +

    r

    nr

    Example: How many different orders of 6 drinks if thereare 3 kinds of drinks? (Coffee, Juice, Soda)

    Question: How many domino tiles are there?Each tile is an unordered pair of 0 to 6 dots with doubles allowed.

    Answer: 2 selections from 7 objects = C(2+7-1,2)=C(8,2)=28

    CJD

    Exercises

    1. How many ways are there to assign 100 different diplomats to

    five different continents?

    2. How many ways are there to assign 100 different diplomats tofive different continents if to each continent 20 diplomats must beassigned ?

    3. How many ways can 100 identical diplomatic letters besent to five different continents ?

    Each diplomat has 5 ways to be assigned, so 5100 ways

    Arrange the diplomats in a row and distribute 20 identical briefcases for each continent.

    So 100!/(20!)5 ways.

    There are 100 orders from 5 different items,So C(100+5-1,100)=C(104,100)

    =104 103 102 101 / 4 3 2 1 = 4,598,126

    CJD

    Review

    Combination : n! / ( r! (n r )! )

    Order is not important.

    Count all orderings of the same elements as 1 only

    Permutation : n! / ( n r)!

    Order is important.

    Count each ordering separately.

    With replacement : n * n *

    Next selection is unaffected by previous selection.

    Without replacement : n * (n 1) *

    Previously selected elements

    can not be selected in future selections.

    CJD

    End