Illustrating the Locker Problem

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

A row of lockers starts with all lockers closed. A person walks by and opens every locker. A second person walks by and closes every other locker, starting with locker 2. A third person walks by and changes the state of every third locker, starting with locker 3. This continues up to an person changing the locker. Which lockers are open and which are shut after people pass by? This Demonstration illustrates this problem with .

Contributed by: Marc Brodie (Wheeling Jesuit University) (March 2011)
Open content licensed under CC BY-NC-SA



I first found this locker problem in G. L. Musser and W. F. Burger, Mathematics for Elementary Teachers: A Contemporary Approach, 4th ed., New York: John Wiley and Sons, 1996.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.