Handshakes grow like n². Seating arrangements grow like n!. One finishes in a day; the other outlasts the universe. Today you compute both and learn the exact line the exam draws between them.
No reading — this page is the reading. Runestone doesn’t cover Unit 4 (search, efficiency, limits, simulation), so everything you need is right here.
Programs, Algorithms region. 4.6 gave you linear and quadratic. Today the growth rates get steeper — steep enough that the question stops being “how long?” and becomes “will it finish before the sun burns out?”
Now count every possible seating arrangement of the 32 people in this room. The answer has 36 digits — about 2.6 × 1035. Checking one arrangement per nanosecond, you’d still be going long after the universe ends.
Handshakes grow like n². Seating arrangements grow like n! (n factorial: n × (n−1) × … × 1). Those are different kinds of growth, and the CED sorts them into two bins:
| Growth | n = 10 | n = 20 | n = 50 | Verdict |
|---|---|---|---|---|
| n | 10 | 20 | 50 | reasonable polynomial |
| n² | 100 | 400 | 2,500 | |
| n³ | 1,000 | 8,000 | 125,000 | |
| 2n | 1,024 | 1,048,576 | ≈ 1.1 × 1015 | unreasonable exponential, factorial |
| n! | 3,628,800 | ≈ 2.4 × 1018 | ≈ 3.0 × 1064 |
Visit every city once and return home by the shortest route. The only guaranteed method is to check every route — and the number of distinct round trips through n cities is (n−1)! / 2.
| Cities | Distinct routes | At 1 billion routes per second |
|---|---|---|
| 10 | 181,440 | under a millisecond |
| 20 | ≈ 6.1 × 1016 | about 2 years |
| 50 | ≈ 3.0 × 1062 | ≈ 1046 years — the sun has about 5 billion left |
Ten cities is fine. Fifty cities outlives the sun. The problem is perfectly solvable — there’s a correct algorithm — it just can’t finish. Hold on to that; it matters on Friday.
Five growth rates on the same axes. The vertical axis always tops out at n³. Slide n up and watch which curves stay on the screen.
Five questions. Judge the growth, not how fast it feels for small n.
Your bank’s encryption works because breaking it by brute force means trying every possible key — about 2128 of them for a common key size. That’s exponential. Even at a trillion guesses a second, it would take around 1019 years.
Unreasonable time is a problem when you’re the one trying to solve something — and a shield when you’re the one being protected. You’ll see exactly how in Unit 7.