A certain hallway contains a row of lockers numbered from 1 to 30.

  • Context: Undergrad 
  • Thread starter Thread starter snipez90
  • Start date Start date
  • Tags Tags
    Row
Click For Summary

Discussion Overview

The discussion revolves around a problem involving a row of lockers numbered from 1 to 30, which are initially closed. The problem describes a sequence of operations performed by 30 students who toggle the state of the lockers based on their position in line. The main question is how many lockers remain closed after all students have completed their operations.

Discussion Character

  • Exploratory
  • Mathematical reasoning

Main Points Raised

  • Post 1 outlines the problem and the procedure followed by each student in toggling the lockers.
  • Post 2 presents a visual representation of the locker states but does not clarify the final count of closed lockers.
  • Post 3 mentions a variant of the problem with 1000 lockers, suggesting that the problem's complexity may be perceived differently based on the number of lockers.

Areas of Agreement / Disagreement

The discussion does not reach a consensus on the final number of closed lockers, and participants express varying perspectives on the problem's complexity.

Contextual Notes

There are no explicit assumptions or limitations discussed, but the problem's nature may lead to different interpretations based on the number of lockers involved.

snipez90
Messages
1,095
Reaction score
5
A certain hallway contains a row of lockers numbered from 1 to 30. All the lockers are initially closed. 30 students are lined up in the hallway. The first student walks down the row and opens up all the lockers. The second student closes all the lockers numbered 2, 4, 6, ..., 30. The third student performs an operation on the lockers numbered 3, 6, 9, ..., 30; if a locker was open, he closes it and if a locker was closed, he opens it. For the n-th student, he operates on the lockers numbered by multiples of n; if a locker was open, he closes it and if a locker was closed, he opens it. How many lockers remain closed after all 30 students finish their walks?
 
Mathematics news on Phys.org


Answer:
24
Proof: (sorry, I don't know how to hide the proof)

Code:
oooooooooooooooooooooooooooooo
 c c c c c c c c c c c c c c c
  c  o  c  o  c  o  c  o  c  o
   o   o   c   o   o   c   o
    c    o    o    c    c    c
     c     o     c     o     o
      c      o      o      c
       c       c       c
        o        o        o
         c         o         c
          c          o
           c           o
            c            o
             c             o
              c              o
               o
                c
                 c
                  c
                   c
                    c
                     c
                      c
                       o
                        o
                         c
                          c
                           c
                            c
                             c
 


25.

Door number n will be closed if n has an even number of divisors, and open if n has an odd number of divisors. The divisor function phi0(n) is odd iff n is a perfect square. Since there are five perfect squares between 1 and 30, there will be five open doors when all students finish their tasks. The other 25 doors will be closed.
 
Last edited:


When I first saw this problem it was asked with 1000 lockers, it still really easy to figure out with that number, but initially it makes it sound harder.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 20 ·
Replies
20
Views
9K
  • · Replies 16 ·
Replies
16
Views
13K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
5K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 7 ·
Replies
7
Views
17K