Download presentation
Presentation is loading. Please wait.
Published byHector O’Connor’ Modified over 8 years ago
1
Counting Overview ICS 6D Sandy Irani
2
Balls into Bins Distinguishable Balls Indistinguishable Balls No restrictions on the number of balls per bin At most one ball per bin m n r i balls in bin i For i = 1,…,m r 1 +r 2 +r 3 +…+r m = n n balls m bins Bins are distinguishable (labeled with numbers)
3
Distinguishable Balls into Distinguishable Bins (no restrictions) Ball1Ball2Ball3Ball4Ball (n-1)Ball n …. Each ball goes into exactly one bin. Each bin can get any number of balls.
4
Dist Balls/Dist Bins/No Restrictions Count the number of strings of length n over an alphabet with m characters. Char1Char2Char3Char4Char (n-1)Char n ….
5
Dist Balls/Dist Bins/No Restrictions How many ways to plan a schedule for n days. Each day, there are exactly m choices of activities. Day1Day2Day3Day4Day (n-1)Day n ….
6
Dist Balls/Dist Bins/No Restrictions How many ways to distribute n different items to m people? Item1Item2Item3Item4Item(n-1)Item n ….
7
Dist Balls/Dist Bins/No Restrictions How many ways to assign m different people to n jobs? (Each job needs one person. A person can get any number of jobs). Job1Job2Job3Job4Job(n-1)Job n ….
8
Indistinguishable Balls into Distinguishable Bins (No restrictions) Can have n m or m n Bin 1Bin 2Bin 3Bin m-1Bin m
9
Indist Balls/Dist Bins (No restrictions) How many ways to pick n items from m varieties? – Items of the same variety are the same – Large number of each variety – Order of selection does not matter # of variety j chosen = # balls in bin j Total number chosen = total number of balls
10
Indist Balls/Dist Bins (No restrictions) How many solutions to the equation: x 1 + x 2 + x 3 + ….+ x m = n Each x j is a non-negative integer (x j 0) x j = # balls in bin j
11
Indist Balls/Dist Bins (No restrictions) How many ways to distribute n identical items to m people? # items to person j = # balls in bin j
12
Dist Balls to Dist Bins At most one ball per bin Must have m n If balls are placed in order, the order of placement matters. Bin 1Bin 2Bin 3Bin m-1 1 Bin m 23 # choices for ball 1 # choices for ball 2 # choices for ball 3 # choices for ball n xxx …. x
13
Dist Balls to Dist Bins At most one ball per bin How many strings of length n from a set of m characters with no repetition? # choices for char 1 # choices for char 2 # choices for char 3 # choices for char n xxx …. x
14
Dist Balls to Dist Bins At most one ball per bin How many ways to distribute n different items to m people with at most one per person? # choices for item 1 # choices for item 2 # choices for item 3 # choices for item n xxx …. x
15
Dist Balls to Dist Bins At most one ball per bin How many ways to select n people from a group of m people in which each person chosen is assigned a distinct task? # choices for task 1 # choices for task 2 # choices for task 3 # choices for task n xxx …. x
16
Indist Balls to Dist Bins At most one ball per bin Must have m n The order of ball placement does not matter. Which bins have a ball? n of the m bins have a ball. # of ways to place balls = # ways to pick a subset of n from {1, 2, 3, …., m} Bin 1Bin 2Bin 3Bin m-1 Bin m
17
Indist Balls to Dist Bins At most one ball per bin How many ways to pick a committee of n people from a group of m people? How many binary strings of length m have exactly n 1’s?
18
Dist Balls/Dist Bin Fixed number per bin Restriction: exactly r j balls in bin j, for m j 1 r 1 +r 2 +r 3 +…+r m = n Pick r 1 balls for bin 1. Then pick r 2 balls for bin 2. …. Finally, pick r m balls for bin m.
19
Dist Balls/Dist Bin Fixed number per bin How many ways to assign n people to offices? There are m offices. Office j can hold r j people. r 1 +r 2 +r 3 +…+r m = n Pick r 1 people for office 1. Then pick r 2 people for office 2. …. Finally, pick r m people for office m.
20
Dist Balls/Dist Bin Fixed number per bin How many ways to plan a schedule for n days. Each day, there are exactly m choices of activities. Activity j appears r j times in the schedule. r 1 +r 2 +r 3 +…+r m = n Pick r 1 days for activity 1. Then pick r 2 days for activity 2. …. Finally, pick r m days for activity m.
21
Indist Balls/Dist Bin Fixed number per bin Restriction: exactly r j balls in bin j, for m j 1 r 1 +r 2 +r 3 +…+r m = n There are no decisions to make. Number of ways to place the balls = 1 Bin 1Bin 2Bin 3Bin m-1Bin m
22
Indist Balls/Dist Bin Fixed number per bin How many ways to distribute n identical chocolate bars to m kids so that each kid gets exactly the same number of chocolate bars? (n must be a multiple of m) Exactly 1 way to distribute the chocolate bars.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.