Reasoning · Grade 6-2 Optimal Design

Problem

Most non-overlapping classes in one day

Nine classes run in one day. Each has a fixed start time and finish time. No two chosen classes may overlap. Find the most classes that can be attended.
Class Start time End time Home Cooking 6 a.m. 12 p.m. Writing Skills 11 a.m. 3 p.m. Kids’ Gymnastics 8 a.m. 11 a.m. Speech and Language 7 a.m. 10 a.m. Art Therapy 11 a.m. 1 p.m. Beginning Ballet 9 a.m. 12 p.m. Badminton 6 p.m. 8 p.m. Storytelling with Paintings 3 p.m. 7 p.m. Beginning Chinese 2 p.m. 5 p.m.
Your answer
How to solve
Strategy Draw a Diagram — Printed as a table, nine pairs of times are hard to compare; drawn as nine bars on one time line running from 6 a.m. to 8 p.m., the clashes jump out and the empty stretches of the day become visible. The second move is to re-sort the list -- not by the order printed and not by start time, but by finishing time -- because the class that finishes earliest is the one that leaves the most of the day still free, and that ordering turns the search into a single sweep left to right instead of a hunt through hundreds of combinations. Building the chain that way is a systematic list, and it produces the example. For the upper bound the trick is to stop looking at classes and look at moments instead: if a handful of clock times can be found so that every class is in session at one of them, then Mia's classes are forced to use up different moments, and counting the moments caps the answer.
1STEP 1

Put every class on one time line

Put all nine on one time line.

2STEP 2

Re-sort the timetable by finishing time

Re-sort them by finishing time.

3STEP 3

Build a chain of classes, always taking the earliest finisher available

Chaining earliest finishers gives four classes.

7{:}00→10{:}00, 11{:}00→13{:}00, 14{:}00→17{:}00, 18{:}00→20{:}00
4STEP 4

Check that the four really do fit

The four do not overlap.

10{:}00 < 11{:}00, 13{:}00 < 14{:}00, 17{:}00 < 18{:}00
5STEP 5

Pick four moments that catch every class

Pick four moments that catch every class.

4 + 2 + 2 + 1 = 9
6STEP 6

Count the moments to cap the answer at four

One class per moment caps it at four.

at most 1 class per moment × 4 moments = 4
7STEP 7

Notice the one other way to reach four

So the most attendable is 4 classes.

Answer
4 classes
4 + 2 + 2 + 1 = 9
The answer is a count of classes, so it should be a whole number between 1 and 9, and 4 is. A rough size check agrees: the four chosen classes take 3 + 2 + 3 + 2 = 10 hours out of the 14 hours from 6 a.m. to 8 p.m., which is a full but believable day, while five classes would need at least 2 + 2 + 3 + 3 + 3 = 13 hours of the 14 -- and those five shortest classes include Art Therapy, Kids' Gymnastics and Speech and Language, which all pile into the same morning, so they could never be squeezed in without clashing. The two halves of the answer also agree with each other: the schedule of four is exhibited, and the four moments 9:30 a.m., 11:30 a.m., 3:30 p.m. and 7 p.m. catch all nine classes and cap the count at four.
Takeaway

Always grab the class that finishes earliest -- and to prove nobody can do better, find a few moments that every single class is running through.

  • Put every class on one time line
  • Re-sort the timetable by finishing time
  • Build a chain of classes, always taking the earliest finisher available
  • Check that the four really do fit
  • Pick four moments that catch every class
  • Count the moments to cap the answer at four
  • Notice the one other way to reach four