Main content

## Pixar in a Box

### Unit 13: Lesson 2

Counting crowds- Start here!
- 1. Two headed robots
- Counting two-headed robots
- 2. Snake bots
- Building snake bots
- 3. Calculating factorials
- Calculating factorials
- 4. Casting problem
- Counting casts 1
- 5. Does order matter?
- Counting casts 2
- 6. Binomial coefficient
- Combinations

© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# 4. Casting problem

Now it's time for a really meaty problem! How can we count the number of possible casts when given a large set of robots to choose from?

## Want to join the conversation?

- I find it difficult to think of choosing actors without thinking of the parts that actors play. So when choosing 3 actors, I think... someone is playing Wall-e, someone is playing Eve, and someone is playing the Captain. In the case of abc and acb, this would mean that the actors playing Eve and Captain have changed. Therefore I can tell the difference between abc and acb. Why not use an example like putting the robots on a space ship with 3 seats? Would that make it more clear that abc and acb are the same?(4 votes)
- I think it only contains 6 sequences since you have 24 combinations and 4 people to kick out. Since 24/4 = 6, there is six in each box. Each six sequences contains one actor getting kicked out.(2 votes)
- Just reached 400,000 ENERGY POINTS!(1 vote)

## Video transcript

- Earlier, you created
a small crowd of robots by choosing just a few of the
possible robot combinations. Let's back up a bit and
go back to the example where robots consisted of
one head, and one body. If you have two heads, and two bodies, then you can make two times
two, or four, different robots. That's like having four
possible actors to choose from but you only need a cast
of three in your movie. Let's give our actors names: Alice, Bob, Carol, and Dave, or A, B, C, and D, for short. That leads to an interesting question: how many different casts of
three actors can you make when you have four actors to choose from? Remember that, to figure
out how many ways there are to combine our actors, we need to multiply our choices at each stage. In this case, we have four
choices for our first actor, three for the second,
and two for the third. So, it seems like we have 4 x
3 x 2, or 24, possible casts. Let's list out all 24 combinations. The first combination,
ABC, means we selected Alice then Bob and then Carol, but there's a subtlety lurking in there. There aren't 24 different casts. To see where the subtlety is, notice that the second combination, ACB, means we selected Alice
then Carol and then Bob. So, the first two combinations
use the same actors, just in a different order. The same is true for
the other combinations in the first box. It's the same cast. Just the order that we
picked from was different. In other words, all the combinations in the first box should be
counted as just one cast. Similarly, the second box is a cast consisting of Alice, Bob, and Dave. The total number of casts is, therefore, the number of boxes. So, how many boxes are there? Since there are six
combinations in each box, there must be 24 divided
by six, or four, boxes. So, there are four casts. But why is it that each group contains exactly six sequences? Why not three or four or any other number? The next interactive will help
you visualize this problem using a few other examples. Have fun!