Stopping times in the game Rock-Paper-Scissors
SStopping times in the game Rock-Paper-Scissors
Kyeonghoon Jeong ∗ and Hyun Jae Yoo †‡ Abstract
In this paper we compute the stopping times in the game Rock-Paper-Scissors.By exploiting the recurrence relation we compute the mean values of stoppingtimes. On the other hand, by constructing a transition matrix for a Markov chainassociated with the game, we get also the distribution of the stopping times andthereby we compute the mean stopping times again. Then we show that themean stopping times increase exponentially fast as the number of the participantsincreases.
Keywords . The game Rock-Paper-Scissors, Markov chain, stopping times. : 60G40, 60J20
The game Rock-Paper-Scissors is perhaps the most famous game known world widelyfor choosing a winner among participants. The rule is very simple. Each player showsby hand one of Rock, Paper, or Scissors at the same time. The Rock beats the Scissorsand loses to the Paper. The Scissors beat the Paper and lose to Rock, and the Paperbeats the Rock and loses to the Scissors. See the picture in Figure 1. It is natural toask the ending time of the game when there are a certain number of participants inthe game.The purpose of this paper is to answer this question. When a number of partic-ipants is fixed, we will discuss the following questions: (i) the distribution of endingtime, (ii) the mean ending time. We will also investigate the asymptotic behaviorof the mean ending time as the number of participants increases. To summarize theresults, we have obtained a concrete formula for the distribution and the mean value ∗ Faculty of Liberal Education, Seoul National University, 1 Gwanak-ro, Gwanak-gu, Seoul 08826,Korea. E-mail: [email protected] † Department of Applied Mathematics and Institute for Integrated Mathematical Sciences,Hankyong National University, 327 Jungang-ro, Anseong-si, Gyeonggi-do 17579, Korea. E-mail:[email protected] ‡ Corresponding author a r X i v : . [ m a t h . P R ] M a y Jeong and Yoo of the ending time and showed that the mean ending time increases exponentially fastas the number of participants increases.This paper is organized as follows. In Section 2, we exploit the recurrence relationfor the mean stopping times of the game. Using exponential generating function, wecompute the mean stopping times. In Section 3 we introduce a Markov chain forthe game. The transition matrix of this Markov chain will have crucial roles in thecomputations of our interests. Using the transition matrix, we represent the massfunctions of the stopping times and compute the mean stopping times. In Section 4,we discuss the asymptotic behavior of the mean stopping times. In Section 5, we givethe proofs for the main results.Figure 1: The game Rock-Paper-Scissors ( picture taken from Wikipedia ) In this section we compute the mean ending time of the game started with a certainnumber of participants. Here we will elucidate the recurrence relation for the stoppingtimes. In the next section we will introduce a different method.For n ≥
2, let τ n be the ending time of the game with n participants, i.e., thetime of the final winner is determined. Let E n := E ( τ n ) be the expectation of τ n . Forsimplicity we let τ = 0, i.e., E = 0. For n ≥ j = 1 , · · · , n , let p ( n, j ) be theprobability that j persons survive after one round of the game with n participants.We then have the relation: for n ≥ k ≥ P ( τ n = k ) = n (cid:88) j =1 p ( n, j ) P ( τ j = k − . (2.1) topping times in the game Rock-Paper-Scissors E n = n (cid:88) j =1 p ( n, j )( E j + 1) , n ≥ . (2.2)From the rule of the game we easily see that p ( n, j ) = n − (cid:0) nj (cid:1) , j < n − (cid:0) (cid:1) n − (cid:0) − n − (cid:1) , j = n . (2.3)So we obtain (2 n − E n = 3 n − + n (cid:88) j =1 (cid:18) nj (cid:19) E j , n ≥ . (2.4)From this recurrence relation with the initial condition E = 0, we can easily calculate E = 32 , E = 94 , E = 4514 , E = 15735 , etc.Let us now compute the general formula for E n solving the equation (2.4). Put E = 0 for convenience. Define the exponential generating function of { E n } by E ( x ) := ∞ (cid:88) n =0 E n n ! x n = ∞ (cid:88) n =2 E n n ! x n . (2.5)By (2.4) it satisfies the following functional equation E (2 x ) − E ( x ) = 13 ( e x − − x ) + e x E ( x ) , that is, E (2 x ) = ( e x + 1) E ( x ) + 13 ( e x − − x ) . Now we have E (2 x ) e x − E ( x ) e x − e x − − xe x − . Let h ( x ) = 13 e x − − xe x − ∞ (cid:88) n =1 h n n ! x n . By calculation, we have h = , h = 0 , h = , h = , h = , h = − , etc. (And h n can be expressed using Bernoulli numbers.)If we put F ( x ) = E ( x ) e x − F (2 x ) = F ( x ) + h ( x ) implies2 n F ( n ) (0) = F ( n ) (0) + h n . Therefore we have E ( x ) e x − ∞ (cid:88) n =1 h n n !(2 n − x n . (2.6)Or equivalently F ( x ) = ∞ (cid:88) k =1 h (cid:16) x k (cid:17) . Finally, expanding (2.6), we arrive at Jeong and Yoo
Theorem 2.1
In the game Rock-Paper-Scissors with n participants, n ≥ , the meanstopping time is given by E n = n − (cid:88) k =1 (cid:18) nk (cid:19) h k k − . (2.7)For example, we have E = 4 h + 6 h + 4 h = 3 + once again. In this section we investigate the stopping times τ n with a different method. It turnsout to be convenient to introduce a stochastic matrix P in the state space N , the setof natural numbers, as follows. P := [ p ( i, j )] i,j ∈ N , where, as before, p ( i, j ) := P ( j persons survive after one round of the game of i persons) , and it was computed in (2.3). Here we take p ( i, j ) = 0 for j > i and we put p (1 , ≡ P are as follows. P = · · ·
23 13 · · ·
13 13 13 · · ·
427 29 427 1327 · · · ... ... ... ... ... . . . . It is obvious that for the Markov chain with the transition matrix P , the state 1 isrecurrent (actually absorbing) and all the other states are transient [1]. Thus in theMarkov chain there is only one trivial invariant measure δ , the Dirac measure at thepoint 1. We are interested in the ending time of the game. This is the hitting time ofthe state 1.Let { e i } i ∈ N be the canonical basis of the Hilbert space ( H , (cid:104)· , ·(cid:105) ) := l ( N ). For n ≥
2, let S [2 ,n ] be the projection onto the subspace span { e i : 2 ≤ i ≤ n } and wedefine P n := S [2 ,n ] P S [2 ,n ] . Let p ( · ,
1) := ( p ( i, i ∈ N ∈ H and denote ψ n := S [2 ,n ] p ( · , τ n : p n ( k ) := P ( τ n = k ) , k ∈ N . topping times in the game Rock-Paper-Scissors Theorem 3.1
In the game Rock-Paper-Scissors, let τ n be the stopping time of endingof the game. Then,(i) τ n has the mass function p n ( k ) = (cid:104) e n , P k − n ψ n (cid:105) = P k − n ψ n ( n ) . (ii) The moment generating function of τ n is M n ( t ) := E ( e tτ n ) = (cid:104) e n , e t I − e t P n ψ n (cid:105) = e t I − e t P n ψ n ( n ) , and hence the expectation and variance of τ n are respectively given by E n = E ( τ n ) = (cid:104) e n , ( I − P n ) − ψ n (cid:105) = 1( I − P n ) ψ n ( n )Var( τ n ) = (cid:104) e n , I + P n ( I − P n ) ψ n (cid:105) − (cid:104) e n , ( I − P n ) − ψ n (cid:105) = I + P n ( I − P n ) ψ n ( n ) − (cid:18) I − P n ) ψ n ( n ) (cid:19) . Example 3.2
We compute the mean ending times for some values of n . For n =2 , , P = (cid:104) (cid:105) , ψ = (cid:104) (cid:105) ,P = (cid:34)
13 13 (cid:35) , ψ = (cid:34) (cid:35) P =
13 13
29 427 1327 , ψ = . Therefore, E = 1 (cid:0) − (cid:1) (cid:18) (cid:19) = 32 ,E = 1( I − P ) ψ (3) = 94 (cid:34) (cid:35) (cid:34) (cid:35) (3) = 94 ,E = 1( I − P ) ψ (4) =
94 94 (4) = 4514 . These are the same as the corresponding values computed in Section 2.
Jeong and Yoo
In this section we discuss the asymptotic behavior of the mean value of ending time.The following is the main result for the asymptotics.
Theorem 4.1
In the game Rock-Paper-Scissors, the mean ending time increases ex-ponentially fast as the number of participants increases. More precisely, we have (cid:18) (cid:19) n ≤ E ( τ n ) ≤ n (cid:18) (cid:19) n . The lower and upper bounds we will get by considering the first exit times from thepresent number of participants in the game. For the exponential growth, however,we will introduce also a different method by which we can learn a little bit how thedynamics of the game proceeds. First we notice that since the mean ending time is represented by the inverses oftriangular matrices, it is very helpful to have knowledge of them. Lemma 4.2
Let A be an n × n triangular matrix with non-zero diagonal elements.If we put A = D + R , where D is the diagonal part of A , then we have A − = n − (cid:88) k =0 ( − D − R ) k D − . Proof.
We can write A = D ( I + D − R ). We notice that D − R is strictly trian-gular. Furthermore, it is nilpotent, i.e., ( D − R ) n = 0. Now we have A − = ( I + D − R ) − D − . By using the identity(1 + x ) m (cid:88) k =0 ( − x ) k = 1 − ( − x ) m +1 for x = D − R and m = n −
1, and the nilpotency of D − R , we have( I + D − R ) − = n − (cid:88) k =0 ( − D − R ) k . After the paper has been accepted for publication, by a discussion with Professor TomoyukiShirai, it was known that the asymptotic behavior could be substantially improved. See the NoteAdded in Proof. We have taken Lemma 4.2 and its proof from a note posted by Robert Lewis in google search. topping times in the game Rock-Paper-Scissors (cid:3)
From now, let us show the exponential growth of the mean ending time. By The-orem 3.1 we have E ( τ n ) = (cid:104) e n , ( I − P n ) − ψ n (cid:105) = n (cid:88) j =2 ( I − P n ) − ( n, j ) ψ n ( j ) . (4.1)Notice that the matrix I − P n is a lower triangular matrix of size ( n − × ( n − I − P n = D n − L n , where D n is the diagonal part of I − P n . We notice here that D n has strictly positivecomponents and L n is strictly lower triangular with nonnegative components. ByLemma 4.2 we have( I − P n ) − = n − (cid:88) k =0 ( D − n L n ) k D − n = D − / n (cid:34) n − (cid:88) k =0 (cid:16) D − / n L n D − / n (cid:17) k (cid:35) D − / n . We thus get( I − P n ) − = D − / n (cid:34) n − (cid:88) k =0 (cid:16) D − / n L n D − / n (cid:17) k (cid:35) D − n (cid:34) n − (cid:88) l =0 (cid:16) D − / n L n D − / n (cid:17) l (cid:35) D − / n . (4.2)Since all the matrix components of D n and L n are nonnegative and also ψ n haspositive components, we see from equations (4.1) and (4.2) that (taking just a singleterm with j = [ n/
2] in (4.1), and k = 0 and l = 1 in (4.2)) E ( τ n ) ≥ (cid:0) D − n L n D − n (cid:1) ( n, [ n/ ψ n ([ n/ , (4.3)where [ r ] means the integer part of a real number r . For 2 ≤ j ≤ n , the j th componentof D n , denoted by D n ( j ), is given by D n ( j ) = 1 − p ( j, j ) = 2 (cid:18) (cid:19) j − (cid:18) − j − (cid:19) , and ψ n ( j ) = p ( j,
1) = j j − . Jeong and Yoo
For 2 ≤ i ≤ n and 2 ≤ j < i , we have L n ( i, j ) = P n ( i, j ) = 13 i − (cid:18) ij (cid:19) . Therefore, plugging into (4.3) we get E ( τ n ) ≥ − (cid:18) (cid:19) n − n − (cid:18) n [ n/ (cid:19) − (cid:18) (cid:19) [ n/ − [ n/ [ n/ − . By Stirling’s formula we have (cid:18) n [ n/ (cid:19) ∼ n +1 √ πn . Thus finally we get E ( τ n ) ≥ C √ n (cid:18) / (cid:19) n , where C is a constant. This shows that the mean ending time grows exponentially asthe number of participants increases. For each n ≥
2, let T ( n )ex be the first exit time from the initial state in the gamestarting with n participants, namely, T ( n )ex := inf { k ≥ < n after k th round of the game } . (4.4)We have P ( T ( n )ex = k ) = n − (cid:88) j =1 p ( n, n ) k − p ( n, j ) = p ( n, n ) k − − p ( n, n ) k . (4.5)Obviously we have E ( τ n ) ≥ E ( T ( n )ex )= ∞ (cid:88) k =1 k P ( T ( n )ex = k )= ∞ (cid:88) k =1 k (cid:16) p ( n, n ) k − − p ( n, n ) k (cid:17) = 11 − p ( n, n ) ≥ (cid:18) (cid:19) n . This proves the lower bound. topping times in the game Rock-Paper-Scissors In this subsection we compute the upper bound for the asymptotic mean stoppingtimes of the game. The basic idea is to look at carefully the trajectory of decreasingnumbers of participants as the game goes on.Suppose that the game starts with n participants, call it an n -block game. Aswe have seen in the former subsection, we have to wait a certain time, say n ≥ n -block, then it goes into a small size, say j -blockgame. There we wait another exit time, say n , and then the game goes into furthersmaller block. The game continues this way and at a certain time it at last jumps into1-block, the end point. The number of jumps into smaller sized blocks runs between 1and n −
1. Therefore, we can compute the mean stopping time of the game as follows:(below we denote N := { } ∪ N ) E ( τ n ) (4.6)= n − (cid:88) k =1 (cid:88) 1, and using the formula p ( i, j ) in (2.3), particularly p ( i, i ) = 1 − (cid:0) (cid:1) i − (cid:0) − i − (cid:1) ≤ − (cid:0) (cid:1) i − , we get E ( τ n ) ≤ n − (cid:88) k =1 (cid:88) 1, and0 Jeong and Yoo applying multinomial expansion, we get E ( τ n ) ≤ n (cid:18) (cid:19) n − n − (cid:88) k =1 k (cid:88) 12 + 12 + · · · + 12 k (cid:19) n − ≤ n (cid:18) (cid:19) n . We now have shown Theorem 4.1. In this section, we provide with the proofs of the main results. Proof of Theorem 3.1. (i) For n ≥ k ≥ 1, it holds that p n (1) = p ( n, 1) = 3 n n p n ( k ) = n (cid:88) j =2 p ( n, j ) p j ( k − n (cid:88) j =2 j (cid:88) j =2 p ( n, j ) p ( j , j ) p j ( k − 2) = n (cid:88) j =2 n (cid:88) j =2 p ( n, j ) p ( j , j ) p j ( k − P n p · ( k − . In the third equation we have used the fact that p ( j , j ) = 0 for j > j . Repeatingthe argument we get the result.(ii) We use the above result to compute the moment generating function of τ n , M n ( t ) := E ( e tτ n ). M n ( t ) = ∞ (cid:88) k =1 e tk p n ( k )= ∞ (cid:88) k =1 e tk (cid:104) e n , P k − n ψ n (cid:105) = e t ∞ (cid:88) k =1 (cid:104) e n , (cid:0) e t P n (cid:1) k − ψ n (cid:105) = (cid:104) e n , e t I − e t P n ψ n (cid:105) . topping times in the game Rock-Paper-Scissors P n lie in the open interval (0 , M n ( t ) is welldefined in the neighborhood of t = 0. The mean value and the variance of τ n can becomputed by differentiating the function M n ( t ). The proof is completed. (cid:3) Note Added in Proof Here we give an improved result for the asymptotic behavior. We are grateful toProfessor Tomoyuki Shirai for giving us the comments and idea for the improvement.For two sequences f ( n ) and g ( n ) we write f ( n ) ∼ g ( n ), as usual, meaning thatlim n →∞ f ( n ) /g ( n ) = 1. Theorem 5.1 Let E n := E ( τ n ) be the mean ending time of the game Rock-Paper-Scissors started with n participants. Then we have E n = 13 (cid:18) (cid:19) n + r n , where r n = 13 12 n − (cid:32)(cid:18) (cid:19) n + n (cid:88) s =2 (cid:18) ns (cid:19) (cid:18) (cid:19) s ∞ (cid:88) l =1 l − s δ ( l ) n (cid:33) , with δ ( l ) the fractional part of log l : ≤ δ ( l ) = log l − [log ] < . The remainder r n satisfies r n = o ((3 / n ) , and hence particularly E ( τ n ) ∼ (cid:0) (cid:1) n , with the latter thelower bound.Proof. We recall some functions and their properties discussed in Section 2. h ( x ) = 13 e x − − xe x − ∞ (cid:88) n =1 h n n ! x n , (5.1) F ( x ) := E ( x ) e x − ∞ (cid:88) n =1 h n n !(2 n − x n . (5.2)We have shown the relation F ( x ) = ∞ (cid:88) k =1 h (cid:16) x k (cid:17) . (5.3)Let us introduce the function (cid:101) E ( x ) by the formula: (cid:101) E ( x ) e x − ∞ (cid:88) n =1 h n n !2 n x n = 13 e x − − xe x − . (5.4)Therefore, we get (cid:101) E ( x ) = ( e x − h (cid:16) x (cid:17) = 13 (cid:18) e x − − x (cid:19) = 13 ∞ (cid:88) n =2 n ! (cid:18) (cid:19) n x n . (5.5)2 Jeong and Yoo Thus, (cid:101) E ( x ) is the exponential generating function of the sequence (cid:101) E n := (cid:0) (cid:1) n . Onthe other hand, from (5.2) and (5.4) we have E ( x ) − (cid:101) E ( x ) e x − ∞ (cid:88) n =1 h n n !2 n (2 n − x n . By (5.2), the r.h.s. of the above equation is equal to F ( x/ 2) and using (5.3) we get R ( x ) := E ( x ) − (cid:101) E ( x ) = ( e x − ∞ (cid:88) k =1 h (cid:0) 12 ( x/ k ) (cid:1) =: ∞ (cid:88) k =1 R k ( x ) . (5.6)Let us obtain a series expansion of R ( x ) = (cid:80) ∞ n =2 r n n ! x n . Before going further, we firstheuristically show the bound r n ≤ c (5 / n . It can be shown that h ( x ) is convex andincreasing on the region x ≥ h (0) = 0. Therefore, for all k ≥ x > h ( x/ k ) ≤ (1 / k − ) h ( x/ ). Using this together with the inequality h ( x ) ≤ ce x , weget (constants may change with no harm) | E ( x ) − (cid:101) E ( x ) | ≤ ce x , and this proves thebound. For a rigorous proof, however, we need some more efforts. Let’s come back tothe expansion of R ( x ) in (5.6). By using the formula (5.5), we get R k ( x ) = ( e x − h (cid:0) 12 ( x/ k ) (cid:1) = (cid:16) (cid:16) e x/ k (cid:17) k − (cid:17) h (cid:0) 12 ( x/ k ) (cid:1) = (cid:16) k − (cid:88) l =1 e lx/ k (cid:17) (cid:16) e x/ k − (cid:17) h (cid:0) 12 ( x/ k ) (cid:1) = (cid:16) k − (cid:88) l =1 e lx/ k (cid:17) ∞ (cid:88) s =2 s ! (cid:18) (cid:19) s ( x/ k ) s . Expanding the exponential function in the first term, we get R k ( x ) = 13 ∞ (cid:88) n =2 n ! (cid:18) (cid:19) n (cid:18) k (cid:19) n x n + 13 k − (cid:88) l =1 ∞ (cid:88) m =0 m ! (cid:18) l k (cid:19) m x m ∞ (cid:88) s =2 s ! (cid:18) 32 12 k (cid:19) s x s = 13 ∞ (cid:88) n =2 n ! (cid:18) (cid:19) n (cid:18) k (cid:19) n x n + 13 k − (cid:88) l =1 ∞ (cid:88) n =2 n ! n (cid:88) s =2 (cid:18) ns (cid:19) (cid:18) (cid:19) s l n − s (cid:18) k (cid:19) n x n Therefore, we have r n = 13 ∞ (cid:88) k =1 (cid:18) (cid:19) n (cid:18) k (cid:19) n + k − (cid:88) l =1 n (cid:88) s =2 (cid:18) ns (cid:19) (cid:18) (cid:19) s l n − s (cid:18) k (cid:19) n . (5.7)We exchange the order in the second summation: ∞ (cid:88) k =1 2 k − (cid:88) l =1 · · · = ∞ (cid:88) m =0 2 m +1 − (cid:88) l =2 m ∞ (cid:88) k = m +1 · · · . topping times in the game Rock-Paper-Scissors k we get r n = 13 12 n − (cid:18) (cid:19) n + n (cid:88) s =2 (cid:18) ns (cid:19) (cid:18) (cid:19) s ∞ (cid:88) m =0 2 m +1 − (cid:88) l =2 m l n − s − mn . (5.8)In the second term, we change the oder of summation: since 2 m ≤ l < m +1 , we havelog l − < m ≤ log l , or m = [log l ], where [ a ] is the integer part of a , i.e., ∞ (cid:88) m =0 2 m +1 − (cid:88) l =2 m · · · = ∞ (cid:88) l =1 [log l ] (cid:88) m =[log l ] · · · . Putting [log l ] = log l − δ ( l ) with 0 ≤ δ ( l ) < 1, we have 2 − [log l ] n = l − n δ ( l ) n .Therefore, we have r n = 13 12 n − (cid:32)(cid:18) (cid:19) n + n (cid:88) s =2 (cid:18) ns (cid:19) (cid:18) (cid:19) s ∞ (cid:88) l =1 l − s δ ( l ) n (cid:33) . (5.9)This is the formula of the remainder in the statement of the theorem. We promptly seethat r n is finite. In order to get the bound of r n , let N be a fixed large number whichwill be determined later. Let us consider the summation over m in (5.8): (cid:80) ∞ m =0 a m ,where a m := m +1 − (cid:88) l =2 m l n − s − mn . We see that a m +1 = m +2 − (cid:88) l =2 m +1 l n − s − ( m +1) n = m +1 − (cid:88) l =2 m (cid:16) (2 l ) n − s − mn − n + (2( l + 1 / n − s − mn − n (cid:17) ≤ (cid:18) m +1 ) n − s (cid:19) − s a m ≤ (cid:18) m +1 (cid:19) n − ( s − a m ≤ e n m +1 − ( s − a m . Therefore, for any k ≥ a N + k ≤ (cid:32) k (cid:89) u =1 e n N + u (cid:33) − k ( s − a N ≤ (cid:16) e / N (cid:17) n − k ( s − a N ≤ (1 + ε ) n − k ( s − a N , where we have taken N large enough so that e / N ≤ ε . Thus the second terminside the bracket in (5.8) can be bounded by n (cid:88) s =2 (cid:18) ns (cid:19) (cid:18) (cid:19) s N (cid:88) m =1 2 m +1 − (cid:88) l =2 m l n − s − mn + (1 + ε ) n N +1 − (cid:88) l =2 N l n − s − Nn . (5.10)4 Jeong and Yoo Now for any 1 ≤ m ≤ N , n (cid:88) s =2 (cid:18) ns (cid:19) (cid:18) (cid:19) s m +1 − (cid:88) l =2 m l n − s − mn ≤ n (cid:88) s =2 (cid:18) ns (cid:19) (cid:18) (cid:19) s m ( m +1)( n − s ) − mn ≤ m n (cid:88) s =2 (cid:18) ns (cid:19) (cid:18) m +1 (cid:19) s n − s ≤ m (cid:18) m +1 (cid:19) n ≤ N (11 / n = o(3 n ) . (5.11)By (5.8), (5.10), and (5.11), we have r n = o(3 / n . The proof is completed. (cid:3) Acknowledgements We are grateful to Professor Tomoyuki Shirai for helping us with an improvementin asymptotics. The research by H.J.Yoo was supported by Basic Science ResearchProgram through the National Research Foundation of Korea (NRF) funded by theMinistry of Education (NRF-2016R1D1A1B03936006). References [1] J. R. Norris,