Lesson progress0 / 10 missions
Lesson 24.4 · Classification

Count Runs, Peaks, and Boundary Patterns

Choose one decisive position—such as the first run, a peak location, or the first forced tile—so every arrangement enters exactly one case.

exactly vs at leastfirst occurrencelocal peaksboundary fragments
Progress is saved in this browser.

One rule prevents double counting

Runs can overlap, a page pattern can begin partway through a block, and one arrangement may contain several interesting positions. Classify by a canonical feature—usually the first decisive position.

Every valid arrangement → exactly one case label
Audit question: Could one arrangement enter two cases? Could a valid arrangement enter none?
1
Foundation

Classify by the first decisive position

Not complete

Why “every run” overlaps

The string 11111000 contains a four-1 block beginning at positions 1 and 2. Counting it in both start cases would duplicate it.

Use the first occurrence

Assign the same string to the case “the first block 1111 begins at position 1.” It now has one label.

“Exactly three consecutive hits” rejects a run of four. “At least four consecutive 1s” includes longer runs.
Checkpoint
Need a hint?

Give an outcome one decisive position or feature, so it cannot appear in two rows.

2
Worked example 4

Count eight-shot patterns by the start of the three-hit run

Not complete

Build a valid pattern before checking. A run beginning at either end leaves four possible places for the separate hit. Each of the four interior starts leaves three: adjacent positions would extend the run to four. Total: 4 + 3 + 3 + 3 + 3 + 4 = 20.

original condition: Eight shots, exactly four hits, and exactly three of the four hits are consecutive. Four consecutive hits do not qualify.

Build a shot pattern

Click a shot to switch between miss and hit.

0hits
0longest run
first 3-run
Nooriginal-valid

Six non-overlapping cases

4+3+3+3+3+4=20

At the two ends, the fourth hit has four legal places. In each interior case, it has three.

original checkpoint
Need a hint?

After placing the triple, reject either adjacent position for the separate hit. At an end, only one adjacent position exists.

3
Run laboratory

Distinguish exact runs from “at least” runs

Not complete

The worked example uses eight digits made from 1 and 2. Here we rename every 2 as 0. This is a reversible relabeling, so the count stays the same. These are strings, not eight-digit numbers: a leading 0 is allowed. Assign each string to its first four-1 window, even when a longer run creates more windows.

0strings checked
0valid strings
0first-start cases
0largest case

Case counts by first start

Sample strings

Exercise 12 transfer: An 8-character binary string containing at least four consecutive 1s has 48 possibilities. Classifying by the first 1111 start gives case counts 16,8,8,8,8.
Checkpoint
Need a hint?

Assign a string to its first matching run. A longer run still has only one first position.

4
Guided Practice 3

Arrange 1–5 so positions 2 and 4 are local peaks

Not complete

Why are there 16 arrangements?

The largest number, 5, must be at a peak: position 2 or position 4. If 5 is at position 2, choose the number at position 1 in four ways. Of the three remaining numbers, put the largest at position 4; the other two can occupy positions 3 and 5 in two orders. This gives 4 × 2 = 8. Reversing the row gives eight more with 5 at position 4. The two cases cannot overlap, so 8 + 8 = 16.

x₁ < x₂ > x₃ < x₄ > x₅. Each shaded position must exceed both neighbors.

Build a permutation

low < peak > low < peak > low
Noall distinct
Noposition 2 peak
Noposition 4 peak
Novalid

Complete enumeration

The page checks all 5!=120 permutations and keeps only those with both required peaks.

120checked
16valid
original checkpoint
Need a hint?

The largest number 5 must occupy position 2 or position 4. These are your two main cases.

5
Peak laboratory

Count permutations from an exact peak signature

Not complete
120permutations
16matching
2required peaks
Yesfeasible

Matching samples

Challenge checkpoint

For 1–6 with peaks exactly at 2 and 5, split the positions into triples (1,2,3) and (4,5,6). Choose the first triple’s three values in 20 ways. Each triple must put its largest value in the middle, with its other two values in either order. This gives 20 × 2 × 2 = 80. Positions 3 and 4 cannot be peaks because each has a larger neighbor at 2 or 5.

Load “1–6, peaks 2 and 5.”

Need a hint?

A peak cannot be an endpoint. Adjacent positions cannot both exceed each other.

6
Exercise 3

Handle beginning and ending fragments of a repeating page pattern

Not complete
original pattern: Between every two text pages are three illustration pages. Its first page may occupy any of the three illustration positions; the last page may cut the cycle short.
72illustrations
24text pages
24complete 4-page blocks
0tail pages

All phases for 96 pages

All phases for 99 pages

original ambiguity disclosed: For 96 pages, every allowed starting phase gives 72 illustration pages. For 99 pages, the printed conditions permit 74 or 75 illustration pages. The page does not silently choose one.
Checkpoint
Need a hint?

Use complete groups of four pages first, then examine the remaining pages for each starting phase.

7
Test 24 · Question 11

Classify domino tilings by the first forced placement

Not complete

Count the L-board without a computer

Draw a horizontal dividing line above the bottom 2 × 2 block. Either no domino crosses it, or both columns have a crossing domino. One crossing alone would leave an odd number of cells in the bottom block.

Let T(n) count a 2 × n rectangle. At its left edge, use one vertical domino, leaving T(n−1), or two horizontal dominoes, leaving T(n−2). Thus T(n)=T(n−1)+T(n−2). Start with T(0)=1 (nothing left to fill) and T(1)=1.

n0123456
T(n)11235813

No crossing: 13 × 2 = 26. Two crossings: the bottom row is forced horizontal, and the two top-right cells are also forced horizontal. Only a 2 × 4 rectangle remains: 5 ways. Total: 26 + 5 = 31.

For the first-cell split, horizontal first gives 2 × T(4) + T(2) = 12; vertical first gives 2 × T(5) + T(3) = 19. In each expression, the first term has no crossing and the second has two crossings. These disjoint cases again give 31.

Cover the fixed L-shaped board with 1×2 dominoes, each covering two edge-adjacent cells with no overlap or gap. Count placements on this fixed board; do not merge placements by rotating or reflecting them. Matching numbers in the drawing label the two cells of one domino. The upper-left cell must pair either horizontally or vertically—two disjoint, exhaustive first cases.

One tiling at a time

1 / 31

First-placement case table

Horizontal first12

tilings

Vertical first19

tilings

12+19=31

The enumeration always fills the first uncovered cell, so no tiling is repeated or omitted.

Checkpoint
Need a hint?

At the joint, zero or two dominoes cross. Count the remaining rectangles in each case.

8
Test 24 · Question 13

Classify a comparison tree by its first surviving group

Not complete

Eight objects have different positive integer weights, each at most 15 g. First split all eight objects into two groups of four and keep the group with greater total weight. Split those four into two pairs and keep the heavier pair. Compare that pair and keep the heavier object. No comparison is tied. The final object is actually the fifth-heaviest.

A proof you can follow without a search

Label the weights a₁ > a₂ > … > a₈. Let x=a₅ be the final winner. Its winning group of four must contain exactly one heavier object H: with none, it loses to the four largest; with two or more, x and its lighter final opponent cannot beat the other pair. Call the two lighter group members y > z. The best pair containing x is x+y, so survival requires x+y > H+z. Let t be the remaining lighter object and S the sum of the other three heavier objects.

  1. Winning the first comparison requires H+x+y+z > S+t. All values are integers, so H+z ≥ S+t−x−y+1.
  2. Winning the second requires H+z ≤ x+y−1. Combining them gives 2(x+y) ≥ S+t+2.
  3. Three different weights above x have sum at least (x+1)+(x+2)+(x+3)=3x+6. Also t≥1 and y≤x−1. Therefore 4x−2 ≥ 3x+9, so x≥11.
  4. Four distinct weights above x must fit below or at 15, so x≤11. Thus x=11. All the bounds must be equalities: y=10, t=1, and S=12+13+14=39. The remaining heavier weight H is 15.
  5. The first two comparisons now force 19 < H+z < 21. Thus H+z=20 and z=5.

The weights are 15, 14, 13, 12, 11, 10, 5, 1. Check: 15+11+10+5=41 > 14+13+12+1=40; 11+10=21 > 15+5=20; 11>10. These inequalities prove both necessity and possibility.

Optional enumeration check: The page checks all 6,435 possible eight-weight selections, each sorted and all four first-group cases. Exactly one complete set survives.
1complete set
11selected weight
5second-lightest
a₁heavier companion
Checkpoint
Need a hint?

Call the fifth-heaviest weight x. Compare the best pair containing x with the other pair, then combine this with the first comparison.

9
Independent practice

Runs, peaks, and boundaries workshop

Not complete

1. Eight shots, four hits, exact longest run 3

2. How many eight-character strings of 0s and 1s contain four consecutive 1s? Leading zero and longer runs are allowed.

3. Arrangements using each of 1–5 once, with peaks at positions 2 and 4

4. Exact peaks 2 and 5 among 1–6

5. Illustrations in 96 pages: Repeat T,I,I,I. The first page may be any of the three I positions, and the last page may stop anywhere in the cycle.

6. For 99 pages under this same T,I,I,I rule, how many different illustration totals are possible?

7. How many 1×2 domino tilings cover the fixed board: a 2-row × 6-column rectangle with a 2×2 block directly below its rightmost two columns?

8. Eight distinct positive integer weights are at most 15 g. Keep the strictly heavier group in successive splits into four, two, then one object. The survivor is fifth-heaviest. Find its weight (g).

Need a hint?

Correct all eight answers to complete the workshop: 20; 48; 16; 80; 72; 2; 31; 11. Count first run positions, split by the largest peak, and include each permitted starting phase. The two illustration totals at 99 pages are 74 and 75.

10
Exit ticket

Prove you can choose non-overlapping cases

Not complete

1. Start positions for a length-3 run in 8 places

2. Eight shots, exactly four hits, with longest hit run exactly 3: how many patterns?

3. Arrangements of 1–5 with peaks at positions 2 and 4

4. How many 1×2 domino tilings cover a 2-row × 6-column rectangle with a 2×2 block directly below its rightmost two columns? Count fixed placements.

5. Eight distinct positive integer weights are at most 15 g. In successive splits into groups of four, two, then one, keeping the strictly heavier group leaves the fifth-heaviest object. Find the second-lightest weight (g).

Need a hint?

Answers: 6; 20; 16; 31; 5. Run starts are positions 1–6. Shooting cases total 4+3+3+3+3+4. The peak cases give 8+8. The fixed-board tilings give 12+19. The weight proof forces the eight weights 15,14,13,12,11,10,5,1, so the second-lightest is 5.

Certificate of mastery

Run, Peak & Boundary-Pattern Architect

This certifies that the learner built complete, non-overlapping classifications for runs, peaks, fragments, tilings, and comparison trees.

Chapter 24 · Lesson 24.4