A circle is two lines
transcript
Market stalls stand in a circle. No two neighbouring stalls may be booked. The last stall is next to the first. What is the largest total?
The values are five, one, one and five. As a line, you would take both fives. That gives ten. But in a circle, those two stalls are neighbours. A plan cannot book both of them.
The first and last stalls are neighbours. So a plan cannot book both. Every plan leaves out the first or the last. What remains is a line.
Leave out the last stall. The line five, one, one gives six. Now leave out the first stall. The line one, one, five gives six. Keep the larger: six.
A circle of one stall has no neighbour to clash with. Both lines would be empty, so the method would return zero. So take its value as a special case.
Every plan skips one end. Solve both lines. Full breakdown in the lecture.