Download presentation

Presentation is loading. Please wait.

Published byLara Steff Modified over 2 years ago

1
One Potato, Two Potato, … Mathematics of Elimination John A. Frohliger St. Norbert College

2
Selecting Someone to be “It” Stand around in a circle and go from person to person chanting, “One potato, two potatoes, three potatoes, four, five potatoes, six potatoes, seven potatoes, more.” Whoever was indicated when we got to “more” was out of the circle. Continue playing “One Potato” in this manner until only one person was left. That person was “It.”

3
Problem 338 inThe Amazing 1000 Puzzle Challenge 2 (Carlton Books ) Decimated In Roman times, soldiers who were to be punished were forced to form a line, and every tenth one was executed. This is the origin of the word “decimate.” If you were one of 1000 soldiers lined up in a circle, with every second soldier being executed until only one remained, in which position would you want to be in order to survive?

4
Solution in the Back (You want to start in position) 976. Take 2 to the power of 10, which gives you the lowest number above 1000. 2 10 = 1024 Then use the formula. 1024 – 2(1024 – 1000) = 976

5
The “Original” Version The Josephus Problem Flavius Josephus, first century Jewish historian. According to legend, during the Jewish-Roman war, Josephus and forty soldiers were trapped by the Roman army. They decided to commit suicide instead of surrendering to the Romans. Their plan was to form a circle and kill every third one until none remained.

6
The “Original” Version The Josephus Problem Josephus did not want to die, so he figured out which position would be the last one standing and took that position. Once he was the only one left, he allowed himself to be captured by the Romans.

7
Generalized Problem Suppose you have n people in a circle. Pick a number m. Go around removing every m th person until only one remains. Where was that person in the original circle?

8
Notation for Finding the Solution Number the people from 1 to n. Start the count at Person 1. Let R(n, m) be the number of the person (in the original lineup) who remains until the end if we remove every m th person. We want to find R(n, m).

9
Example Start with n = 9 people. Remove every m = 3 nd person. Find R(9, 3), the number of the last person remaining.

10
n = 9, m = 3 1 2 3 4 56 7 8 9

11
1 2 4 56 7 8 9

12
1 2 4 5 7 8 9

13
1 2 4 5 7 8

14
1 2 5 7 8

15
1 2 5 7

16
1 2 7

17
1 7

18
1 Conclusion: R(9, 3) = 1

19
New Example Find R(10, 3). (Same example as before, with n raised from 9 to 10) Start with n = 10 people. Remove every m = 3 d person.

20
n = 10, m = 3 1 2 3 4 5 6 7 8 9 10

21
n = 10, m = 3 1 4 5 6 7 8 9 10 Remove the m = 3 d person. 2

22
n = 10, m = 3 1 4 5 6 7 8 9 10 Instead of continuing as before, 2

23
n = 10, m = 3 1 8 4 1 5 2 6 36 3 7 4 8 5 9 6 10 7 Instead of continuing as before, renumber the remaining 9 people, starting at the next person. Old Number New Number Old Number New Number 2 9

24
n = 10, m = 3 Note: The original number for each person is m = 3 more than the new number 1 8 4 1 5 2 6 36 3 7 4 8 5 9 6 10 7 2 9 Old Number New Number Old Number New Number

25
n = 10, m = 3 Note: The original number for each person is m = 3 more than the new number ALMOST 1 8 4 1 5 2 6 36 3 7 4 8 5 9 6 10 7 2 9 Old Number New Number Old Number New Number

26
n = 10, m = 3 We know from the n = 9, m = 3 example, that the last remaining person is the one newly numbered R(9, 3) = 1. 4 1 Old Number New Number Old Number New Number

27
n = 10, m = 3 We know from the n = 9, m = 3 example, that the last remaining person is the one newly numbered R(9, 3) = 1. 4 1 Conclusion: The person was originally in the spot 4. R(10, 3) = 4 = 1 + 3 = R(9, 3) +3

28
Key for Finding R(n, m) for n > 1 Start with n people, numbered 1 thru n. 1 2 3 m - 1 m m + 1 m + 2 n n - 1

29
Key for Finding R(n, m) for n > 1 Start with n people, numbered 1 thru n. Remove Person m. 1 2 3 m - 1 m + 1 m + 2 n n - 1

30
Key for Finding R(n, m) for n > 1 Start with n people, numbered 1 thru n. Remove Person m. There are now n – 1 people remaining 1 2 3 m - 1 m + 1 m + 2 n n - 1

31
Key for Finding R(n, m) for n > 1 Renumber them 1 thru (n - 1), starting at the next person in line. 1 2 3 m – 1 n - 1 m + 1 1 m + 2 2 n n - 1 Old Number New Number Old Number New Number

32
Key for Finding R(n, m) for n > 1 Renumber them 1 thru (n - 1), starting at the next person in line. Old Number = New Number + m Old Number New Number Old Number New Number 1 2 3 m – 1 n - 1 m + 1 1 m + 2 2 n n - 1

33
Key for Finding R(n, m) for n > 1 Renumber them 1 thru (n - 1), starting at the next person in line. Old Number = New Number + m ALMOST Old Number New Number Old Number New Number 1 2 3 m – 1 n - 1 m + 1 1 m + 2 2 n n - 1

34
Key for Finding R(n, m) for n > 1 Of the remaining n – 1 people, the last person standing has new number R(n – 1, m). m + 1 1 m + 2 2 Last Person Standing R(n - 1, m) Old Number New Number Old Number New Number

35
Key for Finding R(n, m) for n > 1 The last person was originally in position R(n, m) = R(n – 1, m) + m m + 1 1 m + 2 2 Last Person Standing R(n - 1, m) R(n, m) Old Number New Number Old Number New Number

36
Key for Finding R(n, m) for n > 1 The last person was originally in position R(n, m) = R(n – 1, m) + m ALMOST m + 1 1 m + 2 2 Last Person Standing R(n - 1, m) R(n, m) Old Number New Number Old Number New Number

37
Let’s get rid of the “ALMOST” part.

38
Go back to n = 10, m = 3 1 2 3 4 5 6 7 8 9 10

39
n = 10, m = 3 1 4 5 6 7 8 9 10 Remove person from Position m = 3. 2

40
n = 10, m = 3 1 8 4 1 5 2 6 3 7 4 8 5 9 6 10 7 After we renumber the people, all of the old numbers are m = 3 more than the new, except … 2 9

41
n = 10, m = 3 After we renumber the people, all of the old numbers are m = 3 more than the new, except … 1 8 4 1 5 2 6 3 7 4 8 5 9 6 10 7 2 9 … New Position 8 was Old Position 1 and New Position 9 was Old Position 2.

42
n = 10, m = 3 … New Position 8 was Old Position 1 and New Position 9 was Old Position 2. After we renumber the people, all of the old numbers are m = 3 more than the new, except … 1 8 4 1 5 2 6 3 7 4 8 5 9 6 10 7 2 9 To make sense of this, we need to talk about …

43
Modular Arithmetic Start with a positive integer k.

44
Modular Arithmetic Start with a positive integer k. In arithmetic mod k, the numbers are 1, 2, 3, …, k. You don’t list 0, negative numbers or numbers greater than k.

45
Modular Arithmetic Start with a positive integer k. In arithmetic mod k, the numbers are 1, 2, 3, …, k. You don’t list 0, negative numbers or numbers greater than k. To add numbers i and j, modulo k, 1.First find i + j.

46
Modular Arithmetic Start with a positive integer k. In arithmetic mod k, the numbers are 1, 2, 3, …, k. You don’t list 0, negative numbers or numbers greater than k. To add numbers i and j, modulo k, 1.First find i + j. 2.If i + j ≤ k, the answer is (i + j)(mod k) = i + j.

47
Modular Arithmetic Start with a positive integer k. In arithmetic mod k, the numbers are 1, 2, 3, …, k. You don’t list 0, negative numbers or numbers greater than k. To add numbers i and j, modulo k, 1.First find i + j. 2.If i + j ≤ k, the answer is (i + j)(mod k) = i + j. 3.If i + j > k, the answer is (i + j)(mod k) = i + j - k

48
Example with k = 12 The numbers are 1, 2, 3, …, 11, 12.

49
Example with k = 12 The numbers are 1, 2, 3, …, 11, 12. (3 + 7)(mod 12) = 10

50
Example with k = 12 The numbers are 1, 2, 3, …, 11, 12. (3 + 7)(mod 12) = 10 (9 + 7)(mod 12) = 16 – 12 = 4

51
Example with k = 12 The numbers are 1, 2, 3, …, 11, 12. (3 + 7)(mod 12) = 10 (9 + 7)(mod 12) = 16 – 12 = 4 Hey, you’ve done this before!

52
Math on a Clock The numbers are 1, 2, 3, …, 11, 12.

53
Math on a Clock The numbers are 1, 2, 3, …, 11, 12. 7 hours after 3 o’clock, the time is (3 + 7)(mod 12) = 10 o’clock.

54
Math on a Clock The numbers are 1, 2, 3, …, 11, 12. 7 hours after 3 o’clock, the time is (3 + 7)(mod 12) = 10 o’clock. 7 hours after 9 o’clock, the time is (9 + 7)(mod 12) = 16 – 12 = 4 o’clock.

55
One more time with n = 10, m = 3 1 2 3 4 5 6 7 8 9 10

56
One more time with n = 10, m = 3 1 4 5 6 7 8 9 10 Remove person from Position m = 3. 2

57
One more time with n = 10, m = 3 1 8 4 1 5 2 6 3 7 4 8 5 9 6 10 7 After we renumber the people, all of the old numbers are m = 3 more than the new … 2 9

58
One more time with n = 10, m = 3 1 8 4 1 5 2 6 3 7 4 8 5 9 6 10 7 After we renumber the people, all of the old numbers are m = 3 more than the new … … mod 10! 2 9 (8 + 3)(mod 10) = 1

59
One more time with n = 10, m = 3 1 8 4 1 5 2 6 3 7 4 8 5 9 6 10 7 After we renumber the people, all of the old numbers are m = 3 more than the new … … mod 10! 2 9 (9 + 3)(mod 10) = 2

60
“Almost” Formula for R(n, m) For n > 1, R(n, m) = R(n – 1, m) + m

61
Actual Formula for R(n, m) For n > 1, R(n, m) = (R(n – 1, m) + m)(mod n)

62
Disclaimer for Those Who Already Knew Modular Arithmetic Frequently, in arithmetic mod k, the numbers used are 0, 1, … k – 1, instead of 1, 2, 3, …, k. To add numbers i and j, modulo k, First find i + j. If 0 ≤ i + j < k, the answer is (i + j)(mod k) = i + j ; If k ≤ i + j, the answer is (i + j)(mod k) = i + j – k (*)

63
Disclaimer for Those Who Already Knew Modular Arithmetic Frequently, in arithmetic mod k, the numbers used are 0, 1, … k – 1, instead of 1, 2, 3, …, k. To add numbers i and j, modulo k, First find i + j. If 0 ≤ i + j < k, the answer is (i + j)(mod k) = i + j ; If k ≤ i + j, the answer is (i + j)(mod k) = i + j – k (*) * Actually, you get (i + j)(mod k) by taking i + j and subtracting enough copies of k until the answer is from 0 to k – 1 (or 1 to k in our case).

64
Pattern of R(n, 2) In the original problem, n = 1000 and m = 2. Look at the pattern leading up to R(1000, 2). R(2, 2) = 1 (Do it yourself.)

65
Pattern of R(n, 2) In the original problem, n = 1000 and m = 2. Look at the pattern leading up to R(1000, 2). R(2, 2) = 1 (Do it yourself.) R(3, 2) = (R(2, 2) + 2)(mod 3)

66
Pattern of R(n, 2) In the original problem, n = 1000 and m = 2. Look at the pattern leading up to R(1000, 2). R(2, 2) = 1 (Do it yourself.) R(3, 2) = (R(2, 2) + 2)(mod 3) = (1 + 2)(mod 3) = 3(mod 3) = 3

67
Pattern of R(n, 2) In the original problem, n = 1000 and m = 2. Look at the pattern leading up to R(1000, 2). R(2, 2) = 1 (Do it yourself.) R(3, 2) = (R(2, 2) + 2)(mod 3) = (1 + 2)(mod 3) = 3(mod 3) = 3 R(4, 2) = (R(3, 2) + 2)(mod 4)

68
Pattern of R(n, 2) In the original problem, n = 1000 and m = 2. Look at the pattern leading up to R(1000, 2). R(2, 2) = 1 (Do it yourself.) R(3, 2) = (R(2, 2) + 2)(mod 3) = (1 + 2)(mod 3) = 3(mod 3) = 3 R(4, 2) = (R(3, 2) + 2)(mod 4) = (3 + 2)(mod 4) = 5(mod 4) = 1

69
Continuing the Pattern n R(n, 2) =(R(n -1,2) + 2)(mod n) 21 33 41 53 65 77 81 9 3 10 5 11 7 12 9 13 11 1413 15 161

70
The Pattern If n is a power of 2, R(n, 2)=1

71
The Pattern If n is a power of 2, R(n, 2)=1 If n is not a power of 2, ♦Find the highest power of 2 that is less than n.

72
The Pattern If n is a power of 2, R(n, 2)=1 If n is not a power of 2, ♦Find the highest power of 2 that is less than n. ♦Starting at that number, count odd numbers until you get to n. That’s R(n, 2)

73
The Pattern If n is a power of 2, R(n, 2)=1 If n is not a power of 2, ♦Find the highest power of 2 that is less than n. ♦Starting at that number, count odd numbers until you get to n. That’s R(n, 2) ♦That is, if 2 k is the highest power of 2 less than n, R(n, 2) = 2(n – 2 n ) + 1.

74
Solution to Problem 338 The Amazing 1000 Puzzle Challenge 2 Of the 1000 original soldiers, the last one left was in position R(1000, 2).

75
Solution to Problem 338 The Amazing 1000 Puzzle Challenge 2 Of the 1000 original soldiers, the last one left was in position R(1000, 2). 1.The highest power of 2 less than 1000 is 2 9 = 512.

76
Solution to Problem 338 The Amazing 1000 Puzzle Challenge 2 Of the 1000 original soldiers, the last one left was in position R(1000, 2). 1.The highest power of 2 less than 1000 is 2 9 = 512. 2.The last soldier was in position R(1000, 2) = 2(1000 – 512) + 1 = 977

77
Comparison to Answer in the Book Our Solution: 1.The highest power of 2 less than 1000 is 2 9 = 512. 2.The last soldier was in position R(1000, 2) = 2(1000 – 512) + 1 = 977

78
Comparison to Answer in the Book Our Solution: 1.The highest power of 2 less than 1000 is 2 9 = 512. 2.The last soldier was in position R(1000, 2) = 2(1000 – 512) + 1 = 977 Book’s Solution: 1.The lowest power of 2 greater than 1000 is 2 10 = 1024. 2.The last soldier was in position 1024 – 2(1024 – 1000) = 976

79
Comparison to Answer in the Book Our Solution: 1.The highest power of 2 less than 1000 is 2 9 = 512. 2.The last soldier was in position R(1000, 2) = 2(1000 – 512) + 1 = 977 Book’s Solution: 1.The lowest power of 2 greater than 1000 is 2 10 = 1024. 2.The last soldier was in position 1024 – 2(1024 – 1000) = 976 The Book’s Answer is Correct

80
Comparison to Answer in the Book Our Solution: 1.The highest power of 2 less than 1000 is 2 9 = 512. 2.The last soldier was in position R(1000, 2) = 2(1000 – 512) + 1 = 977 Book’s Solution: 1.The lowest power of 2 greater than 1000 is 2 10 = 1024. 2.The last soldier was in position 1024 – 2(1024 – 1000) = 976 The Book’s Answer is Correct, if you start counting at 0 instead of 1.

81
Finding R(n, 2) using Base 2 Usually, we write numbers in base 10 (decimal) notation. 2071 2 x 10 3 + 7 x 10 1 + 1

82
Finding R(n, 2) using Base 2 In base 2, numbers are written as a sequence of 0’s and 1’s. 1101 = 13 (base 10) 1 x 2 3 + 1 x 2 2 + 1

83
Finding R(n, 2) using Base 2 1.Take n. (1000) 1.Take n in base 2 (111110100)

84
Finding R(n, 2) using Base 2 1.Take n. (1000) 2.Subtract the highest power of 2 less than n. (1000 – 512 = 488) 1.Take n in base 2 (111110100) 2.Remove the leading 1. (11110100)

85
Finding R(n, 2) using Base 2 1.Take n. (1000) 2.Subtract the highest power of 2 less than n. (1000 – 512 = 488) 3.Multiply by 2. (2 x 488 = 976) 1.Take n in base 2 (111110100) 2.Remove the leading 1. (11110100) 3.Add a 0 at the end. (111101000)

86
Finding R(n, 2) using Base 2 1.Take n. (1000) 2.Subtract the highest power of 2 less than n. (1000 – 512 = 488) 3.Multiply by 2. (2 x 488 = 976) 4.Add 1. (976 + 1 = 977) 1.Take n in base 2 (111110100) 2.Remove the leading 1. (11110100) 3.Add a 0 at the end. (111101000) 4.Change the last 0 to 1. (111101001 = 977)

87
Finding R(n, 2) using Base 2 1.Take n. (1000) 2.Subtract the highest power of 2 less than n. (1000 – 512 = 488) 3.Multiply by 2. (2 x 488 = 976) 4.Add 1. (976 + 1 = 977) 1.Take n in base 2 (111110100) 2.Remove the leading 1. (11110100) 3.Add a 0 at the end. (111101000) 4.Change the last 0 to 1. (111101001 = 977) (Shortcut: Move the 1 from beginning to end.)

88
R(n, m) for m ≠ 2 n R(n, 3) =(R(n - 1,3) + 3)(mod n) 22 32 41 54 61 74 87 9 1 10 4 11 7 12 10 13 142 155 168

89
R(n, m) for m ≠ 2 n R(n, 4) =(R(n - 1,4) + 4)(mod n) 21 32 42 51 65 72 86 9 1 10 5 11 9 12 1 13 5 149 1513 161

90
R(n, m) for various values of n and m

91
I don’t see nice patterns for m ≠ 2. Do you?

92
Variation Suppose you are Person 1, and you get to choose the number m.

93
Variation Suppose you are Person 1, and you get to choose the number m. You want to be the last person standing.

94
Variation Suppose you are Person 1, and you get to choose the number m. You want to be the last person standing. That is, you want R(n, m) = 1.

95
Variation Suppose you are Person 1, and you get to choose the number m. You want to be the last person standing. That is, you want R(n, m) = 1. Can you pick the right m?

96
Yes, if you know n. For instance, if n = 7,

97
Yes, if you know n. For instance, if n = 7, you could pick m = 11.

98
But, what if you don’t know how many people are in the circle? Is there some “magic” m that will work no matter how many people you start with? That is, is there an m so that R(n, m) = 1 for every n?

99
But, what if you don’t know how many people are in the circle? Answer: No, there is no such “magic” number m.

100
But, what if you don’t know how many people are in the circle? Answer: No, there is no such “magic” number m. For any m, if n happens to be m - 1, then Person 1 is the first person to be eliminated.

101
But, what if you don’t know how many people are in the circle? Answer: No, there is no such “magic” number m. Example: If you pick m = 6 but there are n = 5 people, you are the first one out.

102
What if you know roughly how many people there are? Suppose you don’t know exactly what n is, but you know it’s less than some number N. Could you find an m such that R(n, m) = 1 for any such n? For example, can you find a “magic” m if you know n ≤ 10?

103
Answer: Yes!

104
m = 2520 works for any n up to 10.

105
How Did He Do That? If I am Person 1 and there are n people in the circle, I can eliminate the person right before me if I chose m = n

106
How Did He Do That? If I am Person 1 and there are n people in the circle, I can eliminate the person right before me if I chose m = n or m = 2n

107
How Did He Do That? If I am Person 1 and there are n people in the circle, I can eliminate the person right before me if I chose m = n or m = 2n or m = 3n

108
How Did He Do That? If I am Person 1 and there are n people in the circle, I can eliminate the person right before me if I chose m = n or m = 2n or m = 3n or m equals any multiple of n, that is, if m = kn for any positive integer k.

109
How Did He Do That? After the person before me is eliminated, there are now n - 1 people and the count restarts at me. As before, the next time around, the person before me will be eliminated if m happens to be a multiple of n - 1.

110
How Did He Do That? After that person is eliminated, there are now n - 2 people remaining and the count restarts at me. Again, the new person before me will be eliminated if m happens to be a multiple of n - 2. And so on...

111
Moral: If I choose m to be any multiple of n, n - 1, n - 2, …, 3, 2, then each time around, the person right before me is eliminated.

112
Moral: If I choose m to be any multiple of n, n - 1, n - 2, …, 3, 2, then each time around, the person right before me is eliminated. I will be the last person standing!

113
Moral: If I choose m to be any multiple of n, n - 1, n - 2, …, 3, 2, then each time around, the person right before me is eliminated. I will be the last person standing! So if I know there are no more than N people in the circle, I can choose m to be any common multiple of N, N -1, N -2, …, 3, 2.

114
Moral: If I choose m to be any multiple of n, n - 1, n - 2, …, 3, 2, then each time around, the person right before me is eliminated. I will be the last person standing! So if I know there are no more than N people in the circle, I can choose m to be any common multiple of N, N -1, N -2, …, 3, 2. (m = N! works, but it’s pretty big.)

115
Moral: In our example where n is no bigger than N = 10, a common multiple of 2, 3, …, 10 is m = 5 x 7 x 8 x 9 = 2520.

116
Things to Think About If you are Person 2 or Person 3, or somebody else, is there a way of finding the right m so that you are the last person standing?

117
Things to Think About What if, instead of a single static m, it’s a sequence of numbers? For example, if the sequence is 5, 10, 15, …, first you remove the 5 th person, then the 10 th, then the 15 th, and so on. Who is the last one standing?

118
Things to Think About Is there a “magic” sequence of numbers so that Person 1 is always the last person standing?

119
Things to Think About Is there a “magic” sequence so that Person 2 (or 3 or …) is the last one standing?

120
Thank You!

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google