- Jun 3, 2001
- 5,239
- 0
- 0
Extra credit for class I can't seem to get quite right
Starts out like this, there are 10,000 cells, there are 10,000 workers too
What happens each day is that worker #1 goes and turns on all the cells (state 1).
Then worker #2 changes the state of all the even numbered cells to off (state 0), so it would do 2,4,6,8 until 10,000
Then worker #3 would change the state of all the cells divisible evenly by 3 (so if in state 1, it would go to state 0 and vice versa).
This basically happens all the way up to worker #10,000 (so after 5001, only one cell state would change).
At the end of the day, the cells are emptied, but the professor is looking for how many cells would be in state 1 at the end of the day, after worker #10,000 has done his thing, but the cells have not been emptied.
There is probably some pattern I'm missing too, I tried doing the problem with a smaller number of workers (like 100) and then scaling it to 10,000, but it didn't work out to well.
Starts out like this, there are 10,000 cells, there are 10,000 workers too
What happens each day is that worker #1 goes and turns on all the cells (state 1).
Then worker #2 changes the state of all the even numbered cells to off (state 0), so it would do 2,4,6,8 until 10,000
Then worker #3 would change the state of all the cells divisible evenly by 3 (so if in state 1, it would go to state 0 and vice versa).
This basically happens all the way up to worker #10,000 (so after 5001, only one cell state would change).
At the end of the day, the cells are emptied, but the professor is looking for how many cells would be in state 1 at the end of the day, after worker #10,000 has done his thing, but the cells have not been emptied.
There is probably some pattern I'm missing too, I tried doing the problem with a smaller number of workers (like 100) and then scaling it to 10,000, but it didn't work out to well.