Problem of the Day
Thursday, January 1, 2026
Problem:
One common system for controlling traffic flow involves three lights--a red light, yellow light, and green light--to indicate three traffic conditions, or states: "stop", "caution", and "go." A computer scientist waiting in a car at one of these lights realizes that the system, by allowing for more than a single light to be turned on at the same time, could actually be used to indicate as many as 8 different conditions:
- no lights on
- red light only on
- yellow light only on
- red and yellow light on
- etc.
- red, yellow, and green lights all on
Based on this realization, what minimum number of lights would be necessary for a traffic light to indicate the three conditions "stop", "caution", and "go."? And what maximum number of states could be indicated with a system of five traffic lights (for example red, orange, yellow, green, blue)?
| Minimum lights needed to indicate 3 states | Number of states possible with 5 lights | |
| a. | 2 | 5 |
| b. | 2 | 31 |
| c. | 3 | 31 |
| d. | 2 | 32 |
| e. | 3 | 32 |
The correct answer is d. The lights, regardless of their individual color, can be considered as a binary system in which each light is either on or off. The number of states that can be indicated by a single light is 2, with the light either being on or off—with a single light we can count from 0 to 1. With two lights, we can count 0, 1, 2, 3 in binary—four states, which is sufficient to indicate three states of traffic control.
We see that the number of states, then, is just 2 raised to whatever number of lights we have. 21 is two states, 22 is four states, 23 would be 8 states... and 25, for 5 lights, would be 32 different states.