2026 AMC 10B Problem 9
A library offers 5 desks arranged in a row from left to right for quiet studying. Students arrive one at a time and sit down at a desk. If possible, each student avoids sitting next to another student. Otherwise they will, if possible, sit next to one student rather than two. How many possible seating configurations (which seats are occupied) for one to five students are there?
Show solution without answering
Key insight
Build the patterns one student at a time: from each pattern of taken desks, find where the next student may sit, and count each different pattern once.
Solution
Number the desks from left to right. A "configuration" is just the list of desks that are taken, for example "desks and ". We need all the lists that can really happen when there is one student, then two, then three, four and five.
The next student's choice depends only on which desks are taken right now. So build the lists one student at a time.
The rule for a new student, in order:
- first choice: an empty desk with no student beside it;
- if there is none: an empty desk with one student beside it;
- if there is none of those either: a desk with a student on both sides.
- One student. The room is empty, so any desk is fine. That gives patterns: desk , desk , desk , desk or desk .
2. Two students. Wherever the first student sits, there is still a desk that is not beside them. (If the first student is at desk , desks and are free of neighbors. If the first student is anywhere else, a desk at the far end is.) So the second student never sits beside the first. The pairs of desks that are not side by side are
Each one can happen: the first student takes one desk of the pair and the second takes the other. That gives patterns.
- Three students. Take each two-student pattern and see where the third student may sit.
| Desks taken | Empty desks with no neighbor | Third student sits at | Patterns made |
|---|---|---|---|
| none (, , each have one neighbor) | , or | and and | |
| none ( and have one neighbor, has two) | or | and | |
| none (, , each have one neighbor) | , or | and and | |
Some patterns show up more than once, and we count each only once. The different ones are
That gives patterns. (The ones that never happen are three in a row: and and .)
- Four students. Now only two desks are empty, and the fourth student takes the one with fewer neighbors (either one if they tie). Do the same for each three-student pattern.
| Desks taken | The two empty desks | Fourth student sits at | Desk left empty |
|---|---|---|---|
| (two neighbors), (two neighbors) | or | or | |
| (two neighbors), (one neighbor) | |||
| (two neighbors), (one neighbor) | |||
| (one neighbor), (one neighbor) | or | or | |
| (one neighbor), (two neighbors) | |||
| (one neighbor), (one neighbor) | or | or | |
| (one neighbor), (two neighbors) |
The desk left empty is always , or , never an end desk. So there are patterns: and and .
- Five students. The last student takes the last desk. That is pattern.
6. Add the stages.
The answer is .
Why this works
When people or objects arrive one at a time and follow a rule, the next move depends only on the picture right now. So you can build every possible picture stage by stage, using the pictures from the stage before. Different arrival orders often lead to the same picture, so always count the different pictures, not the routes to them.
Alternative approach
Count what is missing instead. This is a good way to check the lists.
With no rule at all, each desk is either taken or empty, so there are patterns, and of them have at least one student. Now remove the ones the rule makes impossible:
- Two students side by side (and nobody else): and and and . That is patterns. They cannot happen because the second student can always find a desk with no neighbor.
- Three students in a row (and nobody else): and and . That is patterns. The table in Step 3 shows they never appear.
- Four students with an end desk empty: and . That is patterns. The table in Step 4 shows they never appear.
So patterns can happen.
Concise solution
A shorter write-up, the way contest solutions are usually written. It may take a different route from the solution above.
Build the reachable sets of taken desks stage by stage.
- One student: any desk, sets.
- Two students: a desk with no neighbor always exists, so exactly the pairs that are not side by side: .
- Three students: each force ; gives ; gives ; gives . That is different sets (every triple except ).
- Four students: from each triple the newcomer takes the empty desk with fewer neighbors (either one if they tie); the desk left empty is always , or , so sets.
- Five students: set.
Total: .
The answer is .
Review in the AoPS books
- Intermediate Counting & Probability, Chapter 13: Events With States (§13.4)
- Introduction to Counting & Probability, Chapter 1: Counting Is Arithmetic
- Prealgebra, Chapter 15: Problem-Solving Strategies (§15.2)
- Introduction to Counting & Probability, Chapter 2: Basic Counting Techniques (§2.2)
Similar problems
Problem © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. Solution and commentary are original to this site.