113.  10,000 digits of e problem
   The following is a distribution of the first 10,000 digits of e: 0 974 1 989 2 1004 3 1008 4 982 5 992 6 1079 7 1008 8 996 9 968 It is speculated that the number 6 appears a disproportionately high number of times and thus the digits are not distributed randomly. Test the hypothesis that these digits form a random sample such that the outcome of 10,000 truly random digits would pass the test 95% of the time.
Answer
Problem 113 Answer
Problem 113 Answer
The digits pass the test of randomness.
Michael Shackleford, A.S.A.
Solution
Problem 113 Answer
Problem 113 Solution
Let Q be the chisquared goodness of fit statistic.
Q = The sum for i=1 to 10 of ( (N_{i}  np_{i})^{2}/np_{i} )
= The sum for i=1 to 10 of ( (N_{i}  1000)^{2}/1000 )
= (676+121+16+64+324+64+6241+64+16+1024)/1000 = 8.61
According the the chisquared table with 9 degrees of freedom a Q statistic of greater
than 16.92 shold fail the test. 8.61 is well under 16.92 so it should pass the test. In
other words the digits do appear to be random.
At a level of significance such that 10,000 random digits passed 60% of the time the
10,000 digits of e would still pass, but at a 50% level they would not.
Michael Shackleford, A.S.A.
  190.  100 coin problem
   There is a table in a dark room with 100 coins. You can't see anything nor feel which sides are up. 80 are heads up and 20 are tails up. Another table in the room has nothing on it. How can you get the same number of coins tails up on both tables with at least one penny on each table?
Answer
Problem 190 Answer
Problem 190 Answer
First, move any 20 pennies to the other table, keeping the same side on each penny up.
Second, flip all 20 pennies on the other table.
Explanation
Initially table 1 will have 80 heads and 20 tails, and table 2 will have 0 heads and 0 tails.
Let t be the number tails moved, and h be the number of heads.
After the move table 1 will have 80h heads and 20t tails, and table 2 will have h heads and t tails.
After the flip table 1 will have 80h heads and 20t tails, and table 2 will have t heads and h tails.
So, at this point table 1 has 20t tails and table 2 has h tails. We moved 20 coins: h heads, and t tails, so h+t=20, or h=20t. 20t and h must be the same amount, thus both tables have the same number of tails, although we don't know what that number is.
Thanks to Dan Florentin for this problem.
Michael Shackleford, A.S.A.
  26.  100 single women problem
   The king has 100 young ladies in his court each with an individual dowry. No two dowrys are the same. The king says you may marry the one with the highest dowry if you correctly choose her. The king says that he will parade the ladies one at a time before you and each will tell you her dowry. Only at the time a particular lady is in front of you may you select her. The question is what is the strategy that maximizes your chances to choose the lady with the largest dowry?
Hint: You should let x ladies go by and choose the first one with a dowry greater than the maximum of the first x. Of course you will pass the highest one if she is among the first x, but that is part of the game.
Answer
Problem 26 Answer
Problem 26 Answer
You should let 37 ladies go by and select the first
one with a dowry greater than the maximum of the
first 37 dowrys.
Michael Shackleford, A.S.A.
Solution
Problem 26 solution
Problem 26 Solution
Let x be the number of ladies you pass before choosing
the next lady with a dowry greater than the first
x ladies. Let max _{x} be the maximum dowry
in the first x ladies.
The probability of winning is sum for i=x+1 to 100
of the probability that the highest dowry is in the
ith position multiplied by the probability that you
choose it if it is in that position.
This is based on the condition probability formula:
Pr(A)=Sum for i=1 to n of Pr( A  B_{i} ) * Pr( B_{i} ),
where the sum for i=1 to n of Pr(B_{i})=1.
For all i the probability that the
highest dowry is in that position is 1/100.
The probability that you will choose the dowry if
it is in the ith position is equal to the probability
that the highest of the first i1 dowries belongs
to one of the first x ladies. This equals x/(i1). If
the highest dowry of the first i1 were not in the first x ladies
you would choose it before getting to the largest dowry,
thus losing the game.
For example if you let 30 ladies pass the probability that the
highest dowry is in the 75th postion and that you will choose it
equals 1/100 * 30/74.
Let A denote the overall probability of winning.
The proability of winning given x is the sum for i=x+1 to 100
of x/(i1) * 1/n. This equals:
Pr(1/n * [ 1 + x/(x+1) + x/(x+2) + ... + x/99 ] ).
Some value of x must be optimal to maximize this formula. This value
of x must the first such that Pr(Ax+1)  Pr(Ax) < 0.
Pr(Ax+1)  Pr(Ax) = 1/n * [ 1/(x+2) + 1/(x+3) + 1/(x+4) + ... + 1/99  x/(x+1) ].
let y=x+1.
Pr(Ax+1)  Pr(Ax) = 1/n * [ 1/(y+1) + 1/(y+2) + 1/(y+3) + ... + 1/99  (y1)/y ]. =
Pr(Ax+1)  Pr(Ax) = 1/n * [ 1/(y+1) + 1/(y+2) + 1/(y+3) + ... + 1/99  1 + 1/y ]. =
Pr(Ax+1)  Pr(Ax) = 1/n * [ 1/y + 1/(y+1) + 1/(y+2) + 1/(y+3) + ... + 1/99  1 ].
If Pr(Ax+1)  Pr(Ax) = 0, then 1/y + 1/(y+1) + 1/(y+2) + 1/(y+3) + ... + 1/99 = 1.
Theorem: The integral from r to n of 1/x = log(n)  log(r) = log(n/r).
The equation above the theorm is an approximation of the integral in the theorem. By
applying the theorem log(100/y) = 1.
Taking e to the power of both sides: 100/y = e.
y=100/e.
Since e=~2.7182818 y=~36.79, since x=y1 x=~35.79.
Since the integral is an underestimate of the series look at some specific
values of Pr(A) for values of x close to 35.79:
x A
 
35 37.0709%
36 37.1015%
37 37.1043%
38 37.0801%
So the optimal strategy is to let 37 ladies pass and then
choose the first lady with a dowry larger than the greatest of the first 37.
In general the answer is going to be n/e, where n is the total
number of ladies. Because the answer must be an
exact integer and error in applying the theorem mentioned above you should
check the few integers just above the optimal value. As n increases the
error decreases. The probability of winning turns out to approach 1/e =~ 36.79%
as n approaches infinity (I'll leave this proof up to you).
Here are some optimal values of x for various values of n and
the probability of winning given x:
n x Pr(winning)
  
3 2 50.00%
4 2 43.83%
5 3 43.33%
6 3 42.78%
7 3 41.43%
8 4 40.98%
9 4 40.60%
10 4 39.87%
15 6 38.94%
20 8 38.42%
30 12 37.87%
50 19 37.42%
100 38 37.10%
1000 369 36.82%
For more information I suggest section 2.5 of Probability and Statistics,
second edition by Morris H. DeGroot.
Here another version of my solution to this problem
Let x be the number of ladies you pass before choosing
the next lady with a dowry greater than the first
x ladies. Let max_{x} be the maximum dowry
in the first x ladies.
The probability you will select the highest dowry is:
Sum for i=1 to 100x of: ( Probability that i of the
remaining ladies will have a dowry greater than max_{x} )
* (1/i).
This probability for any i is:
(100x)*(99x)*(98x)*...*(101xi) * x

100*99*98*...*(100i)
For example suppose you let 30 ladies go my first and planned to
choose the next one with a dowry greater than the maximum of
the first 30. max _{30} is the largest dowry of the
first 30 ladies. Let Pr(n _{i}) equal the probability
that there are i ladies left with a dowry greater than max _{x}.
The probability of you winning would be:
Pr(n_{1}) * 1 +
Pr(n_{2}) * 1/2 +
Pr(n_{3}) * 1/3 +
Pr(n_{4}) * 1/4 +
Pr(n_{5}) * 1/5 +
.
.
.
Pr(n_{70}) * 1/70.
To derive Pr(n_{i}) consider the probability that the i highest
dowrys fall in the last 100x ladies, multiplied the the probability that
the (i+1)th highest dowry falls in the first x ladies. For example:
Pr(n_{3}) = 70/100 * 69/99 * 68/98 * 30/97.
70/100 = Probability that the highest dowry is not in first 30.
69/99 = Probability that the second highest dowry is not in first 30 (99 positions left, 69
not if first 30).
68/98 = Probability that the third highest dowry is not in first 30.
30/97 = Probability that fourth highest dowry is in first 30.
Personally I had to use a spreadsheet to find that the maximum
probability was for x=37, which was 37.1%.
If you change the number of total ladies from 100 to any other number the strategy
seems to still be to let 37% of them go by first.
Michael Shackleford, A.S.A.
  127.  100 story building and a billiard ball problem
   It is your task to determine how high you can drop a billiard ball without it breaking. There is a 100 story building and you must determine which is the highest floor you can drop a ball from without it breaking. You have only two billiard balls to use as test objects, if both of them break before you determine the answer then you have failed at your task. How can you determine the breaking point in which the maximum necessary dropping is at a minimum. Click on 'answer' for just the minimum maximum and 'solution' for how to determine the breaking point under this minimum.
Answer
Problem 127 Answer
The minimum maximum number of droppings is 14.
Michael Shackleford, A.S.A., 10/31/1998
Solution
Problem 127 Solution
First drop the first ball from the 14th floor. If it breaks you can
determine the exact breaking point with the other ball in at most
13 more droppings, starting at the bottom and going up one floor
at a time.
If the first ball survives the 14 floor drop then drop it again
from the 27th (14+13) floor. If it breaks you can determine the exact
breaking point with at most 12 more droppings.
If the first ball survives the 27 floor drop then drop it again
from the 39th (14+13+12) floor. If it breaks you can determine the exact
breaking point with at most 11 more droppings.
Keep repeating this process always going up one less floor than the
last dropping until the first ball breaks. If it breaks on the x^{th} dropping you will only need at most 14x more droppings
with the second ball to find the breaking point. By the 11th dropping
of the first ball, if you get that far, you will have reached the
99th floor.
Thanks to Alon Amit for this problem.
Michael Shackleford, A.S.A., 10/31/1998
  84.  12 pearls and a scale problem
   In front of you are 12 pearls, 11 being real and one fake. The real ones all weigh the same and the fake one differs in weight from the real ones (may weigh more or less). With a balance scale and three weighings how can you weed out the fake one and determine whether it is too heavy or too light?
Answer
Problem 84 Answer
Problem 84 Answer
Note: The following solution may not be the only one possible. At least one other solution has been submitted to me.
First weigh any 4 pearls against any other 4.
If one side weighs heavier than the other then:
Label the pearls on the heavy side H, the pearls on the light side L, and the
4 other pearls G. Next, weigh two H pearls and two L pearls against 2 G pearls, 1 H pearl, and 1 L pearl
(HHLL vs GGHL).
If the HHLL side goes down then either one of the two H pearls on the left
side from step 2 is heavy or the L pearl on the right side of step 2 is light. Finally
weigh ( HL vs GG ). If the HL side goes down the H pearl is heavy, if the HL side goes up
the L pearl is light, if they stay the same the other H pearl is heavy.
If the HHLL side (from step 2) goes up then either one of the two L pearls on the left
side from step 2 is light or the H pearl on the right side of step 2 is heavy. Finally
weigh ( HL vs GG ). If the HL side goes down the H pearl is heavy, if the HL side goes up
the L pearl is light, if they stay the same the other L pearl is light.
If the two sides from step 2 stay the same you have left one H pearl and one L pearl.
Weigh ( HL vs GG ). If the left side goes down the H pearl is heavy, if it goes up the
L pearl is light.
If the two sides from step one stay the same then label the 8 pearls used in step 1 as
G and the 4 others pearls as B. For the second weighing weigh 3 B pearls against
3 G pearls ( BBB vs GGG).
If the left side goes down one of the B pearls is heavy. Weigh them 2 of
them against each other
the heavy side will have the heavy pearl, if the sides stay the same the
other pearl is heavy.
If the left side goes up one of the B pearls is light. Weigh them 2 of
them against each other
the light side will have the light pearl, if the sides stay the same the
other pearl is light.
If the two sides from the second weighing stay the same then the last B
pearl is heavy or light. Use the third weighing against a good pearl
to determine if it is heavy or light.
Michael Shackleford, A.S.A.
  80.  128 pennies and a blindfold problem
   You are blindfolded before a table. On the table are a very large number of pennies. You are told 128 of the pennies are heads up and the rest are tails up. How can you create two subgroups of pennies, each with the same number of heads facing up?
Answer
Problem 80 Answer
Problem 80 Answer
Create a subgroup of any 128 pennies. Then flip over all 128. That group of
128 and the group of all the remaining pennies will have the same number of heads
facing up.
Michael Shackleford, A.S.A., February 4, 1999
  118.  13 pirates and a safe problem
   Thirteen pirates put their treasure in a safe. They decide that the safe should be able to be opened if any majority of pirates agree but not be able to be opened if any minority agree. The pirates don't trust each other so they consult a locksmith. The locksmith puts a specific number of locks on the safe such that every lock must be opened to open the safe. Then he distributes keys to the pirates such that every pirate has some but not all of the keys. Any given lock can have multiple keys but any given key can only open one lock. What is the least number of locks required?
Answer
Problem 118 Answer
Problem 118 Answer
1716 locks are required.
Michael Shackleford, A.S.A.
Solution
Problem 118 Solution
Problem 118 Solution
The number of ways you can choose 7 out of 13 pirates is 13!/(7!*6!) = 1716, where x! = 1*2*...*x.
Next put 1716 locks on the safe, one for each way to group 7 pirates. For each lock give 7 keys to
a unique group of 7 pirates. This way any given lock
will have a keyholder in any group of 7 or more. For any group of 6 there will be exactly one lock
in which the other 7 pirates have the key. Obviously any group of less than 6 would also be missing
at least one key to at least one lock.
Here are the number of keys required for other numbers of pirates:
Number
of
Pirates Number of Locks
 
3 3
5 10
7 35
9 126
11 462
13 1,716
15 6,435
17 24,310
19 92,378
21 352,716
23 1,352,078
25 5,200,300
27 20,058,300
29 77,558,760
31 300,540,195
33 1,166,803,110
35 4,537,567,650
37 17,672,631,900
39 68,923,264,410
41 269,128,937,220
43 1,052,049,481,860
45 4,116,715,363,800
47 16,123,801,841,550
49 63,205,303,218,876
51 247,959,266,474,050
53 973,469,712,824,060
Michael Shackleford, A.S.A.
  204.  154 Rolls of the Dice in Craps
   On May 23, 2009, a craps player held the dice for 154 rolls at the Borgata casino in Atlantic City (source). What is the probability of going 154 rolls or longer in craps? Please give an expression of the answer and/or a numeric answer.
Answer
Problem 204 Answer
Problem 204 Answer
Question
On May 23, 2009, a craps player held the dice for 154 rolls at the Borgata casino in Atlantic City (source). What is the probability of going 154 rolls or longer in craps? Please give an expression of the answer and/or a numeric answer.
Answer
The answer is P1 + P2 + P3 + P4, where
[ P1 ] [12 3 4 5]^153 [1]
[ P2 ] [ 6 27 0 0] [0]
[ P3 ] = (1/36)^153 × [ 8 0 26 0] × [0]
[ P4 ] [10 0 0 25] [0]
The exact answer is:
P1 = 3.12763 × 10^{11}
P2 = 4.63460 × 10^{11}
P3 = 4.95558 × 10^{11}
P4 = 5.17044 × 10^{11}
The sum of these probabilities is 1.78882 × 10^{10} = 1 in 5,590,264,072
Acknowledgement: My thanks to BruceZ for this help with this problem.
Michael Shackleford, ASA — June 2, 2009
Solution
Problem 204 Solution
Problem 204 Solution
Question
On May 23, 2009, a craps player held the dice for 154 rolls at the Borgata casino in Atlantic City (source). What is the probability of going 154 rolls or longer in craps? Please give an expression of the answer and/or a numeric answer.
Answer
Solution
There are four possible states the shooter can be in. Let's define them as follows.
State 1 = Come out roll
State 2 = Point of 4 or 10
State 3 = Point of 5 or 9
State 4 = Point of 6 or 8
The probabilities are recursive. Let p(x,r) represent the probability of being in state x before roll r. Based on simple dice probabilities, p(x,r) can be expressed as follows:
(1) P(1,r) = (12/36)×p(1,r1) + (3/36)×p(2,r1) + (4/36)×p(3,r1) + (5/36)× p(4,r1)
(2) P(2,r) = (6/36)×p(1,r1) + (27/36)×p(2,r1)
(3) P(3,r) = (8/36)×p(1,r1) + (26/36)×p(3,r1)
(4) P(4,r) = (10/36)×p(1,r1) + (25/36)×p(4,r1)
In more plain simple English, equation (1) is saying that the probability of being in a come out roll before roll r is the sum of the following:
 Product of the probability of being in a come out roll the previous turn, and the probability of staying in a come out roll (12/36).
 Product of the probability of rolling for a 4 or 10 the previous roll, and the probability of making the point (3/36), resulting in a come out roll.
 Product of the probability of rolling for a 5 or 9 the previous roll, and the probability of making the point (4/36), resulting in a come out roll.
 Product of the probability of rolling for a 6 or 8 the previous roll, and the probability of making the point (5/36), resulting in a come out roll.
Equation (2) is saying the probability of rolling for a 4 or 10 before roll r is the sum of:
 Product of the probability of being in a come out roll the previous turn, and the probability of rolling a 4 or 10 (6/36).
 Product of the probability of rolling for a point of 4 or 10 the previous turn, and the probability of not rolling the desired point or a 7 (27/36).
Equation (3) is saying the probability of rolling for a 5 or 9 before roll r is the sum of:
 Product of the probability of being in a come out roll the previous turn, and the probability of rolling a 5 or 9 (8/36).
 Product of the probability of rolling for a point of 5 or 9 the previous turn, and the probability of not rolling the desired point or a 7 (26/36).
Equation (4) is saying the probability of rolling for a 6 or 8 before roll r is the sum of:
 Product of the probability of being in a come out roll the previous turn, and the probability of rolling a 6 or 8 (10/36).
 Product of the probability of rolling for a point of 6 or 8 the previous turn, and the probability of not rolling the desired point or a 7 (25/36).
Next, let's express the these four equations in the form of a matrix.
[ P(1,r) ] [12 3 4 5] [ P(1,r1) ]
[ P(2,r) ] [ 6 27 0 0] [ P(2,r1) ]
[ P(3,r) ] = (1/36) × [ 8 0 26 0] × [ P(3,r1) ]
[ P(4,r) ] [10 0 0 25] [ P(4,r1) ]
The intial roll is always a come out roll, so the initial state is:
[ 1 ]
[ 0 ]
[ 0 ]
[ 0 ]
The probability of each state before the 154th roll is expressed as follows. The reason we take the matrix to the 153rd power, and not the 154th, is there are 153 transformations since the initial state.
[ P(1,154) ] [12 3 4 5]^153 [1]
[ P(2,154) ] [ 6 27 0 0] [0]
[ P(3,154) ] = (1/36)^153 × [ 8 0 26 0] × [0]
[ P(4,154) ] [10 0 0 25] [0]
The exact answer is:
P(1,154) = 3.12763 × 10^{11}
P(2,154) = 4.63460 × 10^{11}
P(3,154) = 4.95558 × 10^{11}
P(4,154) = 5.17044 × 10^{11}
The sum of these probabilities is 1.78882 × 10^{10} = 1 in 5,590,264,072
Acknowledgement: My thanks to BruceZ for this help with this problem.
Michael Shackleford, ASA — June 2, 2009
  132.  21 squares in a big square problem
   The figure above is a square composed of 21 smaller squares. Each of the 21 smaller squares has a side of integer length and all 21 are different sizes. Find any solution for the size of the 21 smaller squares. Thanks to Terry W. Ryder of San Leandro, CA and New Scientist magazine for the problem and Terry for the graphic.
Answer
Problem 132 Answer
Problem 132 Answer
The following are the lengths of the various sides, according to
the lables in the image:
a=50
b=35
c=27
d=8
e=19
f=15
g=17
h=11
i=6
j=24
k=29
l=25
m=9
n=2
o=7
p=18
q=16
r=42
s=4
t=37
u=33
Thanks to Terry W. Ryder of San Leandro, CA and
New Scientist magazine for the problem and Terry for the graphic.
This problem inspired my friend Dick Tucker to not only solve the
problem but create a piece of art with it using acrylic plexiglas.
Michael Shackleford, A.S.A., February 23, 1999
Solution
Problem 132 Solution
Problem 132 Solution
Cosinder all the ways you can define the length of an edge of the outer
square, where each variable represents the length of the side or the
corresponding square in the image:
 a+b+c
 a+b+d+e
 a+f+g+h+e
 a+f+g+i+j
 k+l+m+n+g+h+e
 k+l+m+n+g+i+j
 k+l+m+o+p+j
 k+l+q+p+j
 k+l+q+r
 k+s+t+r
 u+t+v
 a+k+u
 a+l+s+u
 a+l+t
 b+f+l+s+u
 b+f+l+t
 b+f+m+q+t
 b+f+n+o+q+t
 b+g+o+q+t
 b+g+q+r
 b+h+i+p+r
 b+h+j+r
 c+d+h+i+p+r
 c+d+h+j+r
 c+e+j+r
Next take 21 of these equations and set them equal to 1. You can not
just use any 21, I would suggest taking out four from various places among
the list as opposed to four in a row. After taking out four of the above equations
I was left with the following matrix:
1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1 
1  1  0  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1 
1  0  0  0  1  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1 
1  0  0  0  0  1  1  0  1  1  0  0  0  0  0  0  0  0  0  0  0  1 
0  0  0  0  0  0  1  0  1  1  1  1  1  1  0  0  0  0  0  0  0  1 
0  0  0  0  0  0  0  0  0  1  1  1  1  0  1  1  0  0  0  0  0  1 
0  0  0  0  0  0  0  0  0  1  1  1  0  0  0  1  1  0  0  0  0  1 
0  0  0  0  0  0  0  0  0  0  1  1  0  0  0  0  1  1  0  0  0  1 
0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  1  1  1  0  1 
1  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  1  1 
1  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  1  0  1  1 
1  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  1  0  1 
0  1  0  0  0  1  0  0  0  0  0  1  0  0  0  0  0  0  1  0  1  1 
0  1  0  0  0  1  0  0  0  0  0  0  1  0  0  0  1  0  0  1  0  1 
0  1  0  0  0  1  0  0  0  0  0  0  0  1  1  0  1  0  0  1  0  1 
0  1  0  0  0  0  1  0  0  0  0  0  0  0  1  0  1  0  0  1  0  1 
0  1  0  0  0  0  1  0  0  0  0  0  0  0  0  1  0  1  0  0  0  1 
0  1  0  0  0  0  0  1  1  0  0  0  0  0  0  1  0  1  0  0  0  1 
0  0  1  1  0  0  0  1  1  0  0  0  0  0  0  1  0  1  0  0  0  1 
0  0  1  1  0  0  0  1  0  1  0  0  0  0  0  0  0  1  0  0  0  1 
0  0  1  0  1  0  0  0  0  1  0  0  0  0  0  0  0  1  0  0  0  1 
Then use Cramer's Rule to solve the equations. In Excel the MDETERM(a1:u21)
command will give you the determinant of the matrix bounded by a1 and u21,
making this process quick and mostly automated. If the determinant used for
the denominator is zero then choose a different set of 21 equations.
When solving for a..u ignore the deonominator determinant since it will
be the same for all 21 variables. After solving for all 21 looking for
common factors among the solutions and divide.
Thanks to Terry W. Ryder of San Leandro, CA and
New Scientist magazine for the problem and Terry for the graphic.
Michael Shackleford, A.S.A., February 23, 1999
  219.  23 prisoners and two light switches problem
   There is a prison with 23 prisoners. The warden brings all the prisoners to a meeting and explains that he set up a room with two switches, labeled A and B. Each can be in an on or off position only. Starting the next day, the warden will pick a prisoner at random, with replacement, once per day. That prisoner will be led to the switches room. He must then switch one, and only one, switch of his choice.
When any member of the group declares "We have all been to the switch room," the warden will check his records to see if it is true. If it is true, then each prisoner will be set free immediately. If not, they will all be given the death penalty immediately.
The warden explains they can have the rest of the day to discuss strategy. Then they will all be separated and will never have a chance to communicate again, except via how they set the switches.
One final detail, the warden will set the switches in their initial state at random and not inform the prisoners beforehand of the initial setting.
Answer Problem 219 Answer
There are various solutions to the problem but most are variants of the one below. I believe my answer will get the prisoners released in the least number of expected days.
 The prisoner called to the switch room on the first day will be designated the leader. If switch A is in the up position, then he will flip in the down position. If it is already down, he will flip switch 2 (the dummy switch). He will start his running count of visits to 1.
 Starting with the second day, do the following:
 If a nonleader is called, and switch A is down position, and he has never fipped switch A, then he will flip switch A to the up position. This is the way to announce that one more person has visited the switch room.
 Otherwise, if a nonleader is called into the switch room, and any of the conditions are not met, then he should flip switch B.
 If the leader is called back into the room and switch A is in the up position it means a new prisoner has entered. The leader will flip A down and add one to his running count.
 If the leader is called back into the room and switch A is in the down position then it will mean no new prisoner has entered the room since the last time he was there. He will flip switch B.
 When the leader reaches a running count of 23, he can safely declare that everyone has been to the switch room at least once.
This method requires an average of 22*23 + sum for i=1 to 22 of 23/(23i), which equals 591.8887 days.
Michael Shackleford, March 25, 2017
 
