Skip to main content
correct locked/unlocked typo
Source Link
Nate Eldredge
  • 29.7k
  • 4
  • 101
  • 150

I recently noticed a connection, while looking at a campy sort of problem.

The problem goes like this A strange sort of prison has 1200 cells and 1200 guards (each numbered 1-1200). Whenever a guard turns his key in a lock it either locks the cell or unlocks the cell. Every night guard 1 goes through and turns his key in each cell, locking all of them. Then guard 2 turns his key in each cell that is divisible by 2 (which unlocks each of these) and so on until all the guards have gone through their round. So the question is at the end of the night how many cells are locked, which cells are they.

So you can figure out pretty easily that if a cell has an even number of divisors then it will be lockedunlocked at the end of the night. Whereas if the cell has an odd number of divisors then it will end up locked. You can use the tau function to think about when a number will have an even number of divisors and when it will have an odd number of divisors. (I won't ruin the solution for anyone) While I was working on this I noticed that the probability of an integer having an odd number of divisors decreases by a factor of 1/2 whenever a new prime factor is added to the prime factorization of the integer. In other words to compute the probability that an integer has an odd number of divisors you can raise 1/2 to the number of distinct primes in the prime factorization.

Once you figure out which cells are locked at the end of the night this conclusion will probably seem pretty worthless but it got me interested in the connection between number theory and probability

I recently noticed a connection, while looking at a campy sort of problem.

The problem goes like this A strange sort of prison has 1200 cells and 1200 guards (each numbered 1-1200). Whenever a guard turns his key in a lock it either locks the cell or unlocks the cell. Every night guard 1 goes through and turns his key in each cell, locking all of them. Then guard 2 turns his key in each cell that is divisible by 2 (which unlocks each of these) and so on until all the guards have gone through their round. So the question is at the end of the night how many cells are locked, which cells are they.

So you can figure out pretty easily that if a cell has an even number of divisors then it will be locked at the end of the night. Whereas if the cell has an odd number of divisors then it will end up locked. You can use the tau function to think about when a number will have an even number of divisors and when it will have an odd number of divisors. (I won't ruin the solution for anyone) While I was working on this I noticed that the probability of an integer having an odd number of divisors decreases by a factor of 1/2 whenever a new prime factor is added to the prime factorization of the integer. In other words to compute the probability that an integer has an odd number of divisors you can raise 1/2 to the number of distinct primes in the prime factorization.

Once you figure out which cells are locked at the end of the night this conclusion will probably seem pretty worthless but it got me interested in the connection between number theory and probability

I recently noticed a connection, while looking at a campy sort of problem.

The problem goes like this A strange sort of prison has 1200 cells and 1200 guards (each numbered 1-1200). Whenever a guard turns his key in a lock it either locks the cell or unlocks the cell. Every night guard 1 goes through and turns his key in each cell, locking all of them. Then guard 2 turns his key in each cell that is divisible by 2 (which unlocks each of these) and so on until all the guards have gone through their round. So the question is at the end of the night how many cells are locked, which cells are they.

So you can figure out pretty easily that if a cell has an even number of divisors then it will be unlocked at the end of the night. Whereas if the cell has an odd number of divisors then it will end up locked. You can use the tau function to think about when a number will have an even number of divisors and when it will have an odd number of divisors. (I won't ruin the solution for anyone) While I was working on this I noticed that the probability of an integer having an odd number of divisors decreases by a factor of 1/2 whenever a new prime factor is added to the prime factorization of the integer. In other words to compute the probability that an integer has an odd number of divisors you can raise 1/2 to the number of distinct primes in the prime factorization.

Once you figure out which cells are locked at the end of the night this conclusion will probably seem pretty worthless but it got me interested in the connection between number theory and probability

Post Made Community Wiki
Source Link
LaLone
  • 131
  • 5

I recently noticed a connection, while looking at a campy sort of problem.

The problem goes like this A strange sort of prison has 1200 cells and 1200 guards (each numbered 1-1200). Whenever a guard turns his key in a lock it either locks the cell or unlocks the cell. Every night guard 1 goes through and turns his key in each cell, locking all of them. Then guard 2 turns his key in each cell that is divisible by 2 (which unlocks each of these) and so on until all the guards have gone through their round. So the question is at the end of the night how many cells are locked, which cells are they.

So you can figure out pretty easily that if a cell has an even number of divisors then it will be locked at the end of the night. Whereas if the cell has an odd number of divisors then it will end up locked. You can use the tau function to think about when a number will have an even number of divisors and when it will have an odd number of divisors. (I won't ruin the solution for anyone) While I was working on this I noticed that the probability of an integer having an odd number of divisors decreases by a factor of 1/2 whenever a new prime factor is added to the prime factorization of the integer. In other words to compute the probability that an integer has an odd number of divisors you can raise 1/2 to the number of distinct primes in the prime factorization.

Once you figure out which cells are locked at the end of the night this conclusion will probably seem pretty worthless but it got me interested in the connection between number theory and probability