Download Eenie, Meenie, Miney Mo - Department of Mathematics

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Location arithmetic wikipedia , lookup

Transcript
Eenie, Meenie, Miney Mo
By
Liliana Munoz
Arizona Teacher Institute
Math 910 001 Thesis
In partial fulfillment of the M.A. Degree in Middle School Mathematics Teaching Leadership
Department of Mathematics
University of Arizona
April 2010
1
Introduction:
This old problem was introduced by first century historian, Flavius Josephus. During a
war between Romans and Jews, he was among forty-one Jews captured by Romans in a cave.
They preferred suicide to that situation and decided to sit around a circle and begin to kill third of
every three remaining persons from beginning of the circle, until no one is alive (at last, there
were two persons alive who should kill themselves). Josephus that didn’t want to suicide
calculated that he and his friend should sit where to remain alive (to be those last two persons).
The problem known as Josephus problem is something similar to the problem of the Eenie,
Meenie, Miney, Mo. The purpose of the game is stay alive by choosing the right spot.
Problem 1:
There are 1,000 people, numbered 1 to 1,000 around a circle. We start from person
number 1 and eliminate (kill) second of every two remaining persons until one person remains.
Given the n, determine the number of that person. For example, if n=10, elimination is done this
way: 2, 4, 6, 8, 10, 3, 7, 1, 9 and finally 5 wins. Assuming we have n=1,000 and k=2, what is the
number of the remaining person? Can you describe a quick way of determining the winner for
other N with k=2?
If you start with every other one and dump on the second instead of the first, then the
numbers of the survivors for a group of n would be
N(Number
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
W(Winning 1
3
1
3
5
7
1
3
5
7
9
11
13
15
1
3
of people)
2
person)
The eliminations process to find the winning person and the last person to be eliminated
works like this:
Number of
Row 1
Row 2
Row 3
Row 4
1
1
1
9
5
2
2
3
1
9
3
3
5
5
4
4
7
5
5
9
6
6
7
7
8
8
9
9
10
10
people
5 is winning person
The last number to survive is number 5 and the last person to be eliminated is 9.
Here is another example of elimination to find the winning person for 20 people. Suppose
we have 20 people arranged in a circle. Beginning with the first person, I proceed to count
around the circle removing every second person until everyone is removed and only one person
is left.
Number Row 1 Row 2 Row 3 Row 4 Row 5
3
of
people
1
1
1
1
17
9
9 is the winning
person
2
2
3
5
1
3
3
5
9
9
4
4
7
13
5
5
9
17
6
6
11
7
7
13
8
8
15
9
9
17
10
10
19
11
11
12
12
13
13
14
14
15
15
16
16
17
17
18
18
19
19
20
20
17
4
First row I have the following numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10…20
Second row, I removed every second number from the first round. Every multiple of 2 was
removed. So now I have 1,3,5,7,9,11,13,15,17, and 19.
Third row, I end up with the following numbers: 1, 5, 9, 13 and 17. Fourth row, I have 17, 1, and
9.
Fifth row, I have 9 and 17, which leaves me with number 9 as the winning person and the last
number to be eliminated 17.
N=
1
2
3
4
5
6
7
8
9
10
20
1
1
3
1
3
5
7
1
3
5
9
Number
of
People
Winner
Number
Working with this problem, I noticed that the pattern always starts with 1.
After completing my table, I realized that when N was a power of 2, like 2^1(2), 2^2(4),
2^3(8)…. For each increased by 1 in number of people, the winning number increased by 2 until
I hit the next power of 2. Every single power of 2 has a winning number of 1 and then skipping
every 2 numbers. When starting counting the people around the circle, I noticed that all even
numbers were eliminated during the first round. This made me realized that I ended up with half
of the people I started with (N/2).
For the second round, I noticed that my numbers left were double and increased by 1 (2N
+ 1). This means that I had left odd numbers only. So person 2 will always be the first person to
5
be eliminated.(Ex; 1,3,5,7...) After exploring the winning numbers of the sequence, I noticed that
mod 4 could be used obtaining the following pattern;
1
2
3
4
5
6
7
8
9
10
20
1
1
3
1
3
5
7
1
3
5
9
1
1
3
1
3
1
3
1
3
1
1
1 using mod 4 if N is an even number.
3 using mod 4 if N is an odd number
I thought this was kind of an interesting pattern even though all winning numbers are odd mod 4
was used for this sequence.
After making observations that helped me see the pattern in my problem, I came up with a
method of solving it. I called N the number of people in the circle and k=2 is the number for
every second remaining person. 2^m is a power of 2. Let say we want to find the winner for
1,000 people; we would apply the following method to solve the problem.
For N=1,000 and k=2
Winning Number = 2(N – 2^m) + 1
WN= 2(1000-2^9) +1
WN= 2(1000-512) +1
WN= 2* 488 + 1
WN= 976 + 1
WN= 977
The last person remaining and declare winner is 977.
6
I found that the trick for this method is to subtract off the nearest power of 2, then
multiply by 2 and add 1. I multiplied by since my sequence is every 2 numbers and then I added
1 since it is the first number of the pattern.
Problem 2:
Now assuming that we have N=1000 and K=2. What is the number of the last person
eliminated? Using the method already mentioned; Winning Number = 2(N – 2^m) + 1.
We already know that the winning number is 977; we need to subtract the closest power
of 2 from
977, which is 2^9(512) so the last person to be eliminated is 465.
The following table shows how this pattern works and what would be the winning person for the
number of people arranged in a circle.
Winner(skip 1, kill 1)
1
1
3
1
3
5
7
1
3
5
7
9
11
13
15
1
3
5
7
9
Number of people
2^1
2^2
2^3
2^4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
7
11
13
15
17
19
21
23
25
27
29
31
1 2^5
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
8
63
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
127
1
255
1
511
1
2^6
2^7
2^8
2^9
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
127
128
255
256
511
512
Problem 3:
What happens if k = 3?
Whenever a person is passed over, we can assign a new number. Thus 1 and 2 become n+1 and
n+2, then 3 is executed; 4 and 5 become n+3 and n + 4, then 6 is executed; : : :; 3k + 1 and 3k +
2 become n + 2k + 1 and n + 2k + 2, then 3k + 3 is executed; : : : then 3n is executed (or left to
survive).
Obviously, this pattern is not as easy as working with the previous one. The problem is
much more complicated since the pattern starts with 1 and 2.
9
What I noticed about this pattern is that every time the number of people is equal to the
last remaining numbers the next number will start with 2.and every time the number of people is
greater than the last remaining number the next number will start with 1. Like in the pattern
before, after the first round, half of the people were eliminated, in this case, 1/3 of the people are
eliminated so I still have 2/3 of the remaining people left (N/3). In the first round, all multiples of
three are eliminated All multiples of three are eliminated so 3+ 1 and 3N + 2 are left (i.e., 3, 6, 9,
12, 15, 18…) Person 3 will always be the first person to be eliminated.
Let’s say N=10
Number of
Row 1
Row 2
Row 3
Row 4
Row 5
Row 6
1
10
8
4
10
10
people
1
4 is the
winning
number
2
2
1
10
5
4
3
3
2
1
8
5
4
4
4
4
10
5
5
5
5
6
6
7
7
7
8
8
8
9
9
10
4
10
10
First row;
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Second row;
10, 1, 2, 4, 5, 7, 8
Third row
8, 10, 1, 4, 5
Fourth row;
4, 5, 8, 10
Fifth row;
10, 4, 5
Sixth row;
10 and 4
Seventh row;
Last remaining number is 4 and the last number to be eliminated is 10.
Another table
Number
Row 1
Row 2
Row 3
Row 4
Row 5
Row 6
of people
1
Row
7
1
13
11
8
2
11
11
2 is the
winning
person
2
2
14
13
11
4
2
3
3
1
14
13
8
4
4
4
2
2
2
11
11
2
5
5
4
4
6
6
5
7
7
7
7
8
8
8
8
9
9
10
10
10
11
11
11
12
12
13
13
14
14
4
The winning person for a group of 14 people is 2 and the last number to be eliminated is 11.
Another example to find the winning person for a group of 22 people is seen the following chart.
Number R1
R2
R3
R4
R5
R6
R7
R8
25
25
25
17
17
7
7
of
people
1
1
17 is
winning
person
2
2
26
26
26
20
20
17
3
3
1
2
4
25
26
20
12
17
4
4
2
4
7
26
5
5
4
7
11
7
6
6
5
8
13
11
7
7
7
11
17
8
8
8
13
20
9
9
10
16
10
10
11
17
11
11
13
20
12
12
14
22
13
13
16
14
14
17
15
15
19
16
16
20
17
17
22
18
18
23
19
19
20
20
21
21
22
22
23
23
7
13
24
24
25
25
26
26
The winning person is 17 and the last person to be eliminated is 7.
For the next 1table, I noticed I could use mode 3 for the remaining numbers.
1
2
3
4
5
6
7
8
9
14
15
1
2
2
1
4
1
4
7
1
2
5
1
2
2
1
1
1
1
1
1
2
2
Number of
People
Winner(skip 2 , kill
1)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
1
2
2
1
4
1
4
7
1
4
7
10
13
2
5
8
11
14
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
14
17
20
2
5
8
11
14
17
20
23
26
29
1
4
7
10
13
16
19
22
25
28
31
34
37
40
43
46
2
5
8
11
14
17
20
23
26
29
32
35
38
15
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
41
44
47
50
53
56
59
62
65
68
1
4
7
10
13
16
19
22
25
28
31
34
37
40
43
46
49
52
55
58
61
64
67
70
73
76
79
82
85
88
91
94
16
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
97
100
103
1
4
7
10
13
16
19
22
25
28
31
34
37
40
43
46
49
52
55
58
61
64
67
70
73
76
79
82
85
88
91
94
97
100
103
106
109
112
115
17
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
118
121
124
127
130
133
136
139
142
145
148
151
154
157
2
5
8
11
14
17
20
23
26
29
31
34
37
40
43
46
49
52
55
58
61
64
67
70
73
76
79
82
18
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
85
88
91
94
97
100
103
106
109
112
115
118
121
124
127
130
133
136
139
142
145
148
151
154
157
160
163
166
169
172
175
178
181
184
187
190
193
196
199
202
205
208
19
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
211
214
217
220
223
226
229
232
235
1
4
7
10
13
16
19
22
25
28
31
The pattern always starts with either 1 or 2.
Now, we can answer this problem by doing the following:
Multiply the number of rows by three. If the number you get is an odd number, you will have to
subtract by 1, but if you get an even number, you will have to subtract by 2. The safe spot value
for skip 3 for a circle of 1000 is 604.
Another way to find the winning person is by doing the following method. If you start
counting from number one and eliminate every nth person starting with person number "n", the
sequence of best places to stand can be found in this chart. For example, if you eliminate every
third person, you can use trial and error to find out that for two people the best place to stand is
position 2. After that, the best place to stand can be found by adding three to the previous best
20
position, with the restriction that if the new position is higher than the number of people simply
reduce the position number by n.
Number of people
Best Position
1
1
2
2
3
2 + 3 = 5
5 - 3 = 2 less
4
2 + 3 = 5
5 - 4 = 1 less
5
1 + 3 = 4
6
4 + 3 = 7
7
1 + 3 = 4
8
4 + 3 =7
9
7 + 3 = 10
10
1 + 3 = 4
11
4 + 3 = 7
12
7 + 3 = 10
13
10 + 3 = 13
equal
14
1 3 + 3 = 16
16 - 14 = 2
15
2 + 3 = 5
16
5 + 3 = 8
17
8 + 3 = 11
7 - 6 = 1 less
10 - 9 = 1 less
21
Conclusion:
There are people standing in a circle waiting to be executed. After the first man is
executed, certain number of people are skipped and one man is executed. Then again, people are
skipped and a man is executed. The elimination proceeds around the circle (which is becoming
smaller and smaller as the executed people are removed), until only the last man remains, who is
given freedom. The task is to choose the place in the initial circle so that you survive.
The Joseph problem was very challenging and hard to find a formula that will work for
the safe spot when every third, fourth person and so for was eliminated. I found that the secret to
this problem was to start smaller and then work your way up.
22
Reference
Casburn L. and Phan T.: The Orthogonal Josephus Problem, July 2001
Joseph Problem: http://mathworld.wolfram.com/JosephusProblem.html
23