A two-player game is played with two piles of stones, with sizes m , n . On a player's turn, that player can remove any positive integer number of stones from one pile, or the same positive integer number of stones from each pile. A player loses when they are unable to take a stone. If 1 ≤ m , n ≤ 3 0 , for how many of the 3 0 × 3 0 = 9 0 0 starting positions does the first player have a winning strategy?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
First I will present a proof, and then an interesting feature, involving the golden ratio, that you may not have seen or known, and want to try and prove.
Since this game is impartial (i.e. both players have identical abilities), and guaranteed to finish with a victory for one of the players, it is possible to identify each possible position as being either an N-position (advantageous to the next player, i.e. winning for the player to move) or a P-position (advantageous to the previous player). From an N-position, it is possible to make a move that results in a P-position, from a P-position all moves result in an N-position. The question is thus to determine the number of N-positions.
I will use the notation ( a , b ) , with a ≤ b , to refer to game positions. (Note that the two piles are identical with respect to the rules of the game, so the constraint a ≤ b is justified.) I will call a position "smaller" than another position, if it preceeds the other in lexicographical order, i.e.
( a , b ) < ( c , d ) ⟺ a < b or ( a = b and c < d )
The point is that any move will always result in a smaller position. This ordering therefore provides a way to work bottom-up. With all that set up, we can get to work.
First of all, ( 0 , 0 ) is obviously a P-position. Therefore, all positions of the form ( 0 , n ) or ( n , n ) , with n > 0 , are N-positions, since the player to move can reach the P-position in one go. The smallest position from which it is not possible to reach ( 0 , 0 ) is ( 1 , 2 ) , which we can thus identify as a P-position. Now we find that all positions ( 1 , n ) , ( 2 , n ) and ( n − 1 , n ) with n > 2 are N-positions, since the player to move can reach ( 1 , 2 ) . The smallest position that does not belong to any of these is ( 3 , 5 ) . Again, it is a P-position. The next one you'll find is ( 4 , 7 ) . The generalization might be obvious by now, but I'll prove it rigorously.
In general, the n -th P-position (starting from P 0 = ( 0 , 0 ) ) is P n = ( a n , b n ) , where a n is the smallest integer x > a n − 1 with x = b k for all k < n , and b n = a n + n . To prove this, we need to establish that this conforms to the properties of P-positions and N-positions given above.
First we demonstrate that from any P-position P i it is impossible to move to another P-position P j (with i > j ). If it were possible, we would need to have a i = a j , b i = b j , a i = b j , b i = a j or b i − a i = b j − a j . All of these trivially cannot be true based on the definition above (the second for instance follows from b i = a i + i > a j + i > a j + j = b j ).
Now to demonstrate that from any N-position ( x , y ) one can move to a P-position. We can distinguish the following cases ( k is always some integer):
This concludes the proof.
The algorithm for determining the P i 's can be easily applied to identify all P-positions (excluding ( 0 , 0 ) ) for piles of at most 30 stones:
( 1 , 2 ) , ( 3 , 5 ) , ( 4 , 7 ) , ( 6 , 1 0 ) , ( 8 , 1 3 ) , ( 9 , 1 5 ) , ( 1 1 , 1 8 ) , ( 1 2 , 2 0 ) , ( 1 4 , 2 3 ) , ( 1 6 , 2 5 ) , ( 1 7 , 2 8 )
There are thus 11 P-positions. Remember though that we asserted a ≤ b , so without this constraint there are 22. The number of N-positions is therefore 9 0 0 − 2 2 = 8 7 8
Now for an interesting feature: the n -th P-position is given by
P n = ( ⌊ n ϕ ⌋ , ⌊ n ( ϕ + 1 ) ⌋ ) ,
where ⌊ x ⌋ is the floor of x , i.e. the largest integer smaller than or equal to x , and ϕ is the golden ratio: ϕ = 2 1 ( 1 + 5 ) = 1 . 6 1 8 …
Therefore, the general answer to this problem (replacing 30 with N ), is
N 2 − 2 ⌊ ϕ + 1 N + 1 ⌋
I happened to have heard of this game before, I don't know its name, but I remember this remarkable feature. I might present a proof later as a comment to this post, but I'll gladly let someone beat me to it.
Thanks for the observation about the game: I had spotted the Fibonacci pairs ( ( 1 , 2 ) , ( 3 , 5 ) , ( 8 , 1 3 ) , … ) but would not have got the general formula without your hint.
I'll sketch a proof which may not be the most efficient but which I think is sound. Apologies that it is a bit tricky to write-out.
First of all we can use the Fibonacci Numbers to represent all integers as sequence of zeroes and ones (like binary). For example 1 0 1 0 0 1 represents 1 + 5 + 8 + 1 3 . N.B. we can chose to always write numbers without adjacent 1's since by the Fibonacci Relation successive ones as that would give the next Fibonacci number e.g. 1 1 0 0 = 3 + 5 = 8 could be written 1 0 0 0 0 .
Let us consider the set of all numbers, O which have their final 1 at an odd number of places from the end of their Fibonacci Representation. This means the final 1 is in the 1 , 3 , 8 , 2 1 … position, i.e. 1 , 1 0 0 , 1 0 1 , 1 0 0 1 , 1 0 0 0 0 , 1 0 0 0 1 … are the first numbers in O The remaining Natural Numbers, E , with their final 1 at even number of places from the end can be formed by adding a terminal zero to numbers in O . This generates the following pairs L : ( 1 , 1 0 ) , ( 1 0 0 , 1 0 0 0 ) , ( 1 0 1 , 1 0 1 0 ) , ( 1 0 0 1 , 1 0 0 1 0 ) … . In decimal these correspond to ( 1 , 2 ) , ( 3 , 5 ) , ( 6 , 1 0 ) , ( 9 , 1 5 ).
These turn out to be the losing pairs, and their relationship with the Fibonacci numbers implies the result about ϕ . To prove this all we need to show is that the gaps are all different (the pairs are clearly disjoint.)
Using the Fibonacci Relation we can see that when we subtract corresponding elements of O from those in E the result is to shift all the 1's right, except for the final 1 which stays put. For example 1 0 0 1 0 1 moves to 1 0 0 1 1 which in decimal corresponds to 17 moving to 11. [N.B. This example corresponds to the fact that 17 is the first element of the \(11^{th}/) losing pair.]
To reverse the process we write a Natural Number in Fibonacci Form with either the final 1 either at the end, or at an even number of steps from the end (rewriting with a pair of 1's at the end off necessary) and then shift all the 1's left, except for a 1 at the final position which is left alone. For example 9 which can be expressed as \(10001\) maps to 1 0 0 0 0 1 which represents 14. [N.B. This example corresponds to the 9 t h losing pair starting with 1 4 . I'll omit the details but we can show that using this map each Natural Number maps to different number in E .
All we are left to do is establish that the n t h term is ϕ . I'll leave out the details but intuitively when we shift the Fibonacci numbers in the representation of n we approximately multiply by ϕ . The way we define the map ensures that we get an underestimate. N.B. the ratio of terms within losing pairs is approximately ϕ (always slightly greater).
I really enjoyed figuring this out: writing up was tricky, but once you play around with addition/subtraction in the Fibonacci bases (which is very similar to binary, just a different carrying rule) it should make sense. Would be interested to see different approaches.
My way explains various features, for sample the fact of why you can always subtract the largest possible pair of Fibonacci Numbers from losing pairs to still get a losing pair (e.g. ( 1 2 , 2 0 ) − ( 8 , 1 3 ) ) = ( 4 , 7 ) , and of course why you get Fibonacci Pairs at alternate Fibonacci positions e.g. ( 2 1 , 3 4 ) at position 1 3 .
One small correction: If the game begins with (16,25), the first player can remove two from each pile.
The complete list of losing positions is: L 1 L 2 L 3 L 4 L 5 L 6 L 7 L 8 L 9 L 1 0 L 1 1 = ( 1 , 2 ) = ( 3 , 5 ) = ( 4 , 7 ) = ( 6 , 1 0 ) = ( 8 , 1 3 ) = ( 9 , 1 5 ) = ( 1 1 , 1 8 ) = ( 1 2 , 2 0 ) = ( 1 4 , 2 3 ) = ( 1 6 , 2 6 ) = ( 1 7 , 2 8 ) plus their reverses ( 2 , 1 ) , ( 5 , 3 ) , etc.
Proof: Let L = { L k , (and their reverses) } be the set of positions listed above, and W be the other positions. We will show that:
Case 1: If a position is in L then there is no move that leaves another position in L
Case 2: If a position is in W then there is always a move that takes all stones, or leaves a position in L
This will prove that all positions in L are losing, and all positions in W are winning.
Note - the winning condition "a player is unable to take a stone" can only happen if there are no stones (since taking one stone is a legal move), therefore a player wins if he takes the last remaining stone.
In the cases below we assume without loss of generality that the position ( m , n ) has m ≤ n .
Case 1: No position in L has a pile with the same number of stones as any other position in L , therefore the move "take stones from one pile" cannot leave a position in L .
Further, each position L k = ( m , m + k ) . So the move "Remove k stones from each pile" cannot leave a position in L , since the value of k is different for each of these members.
Case 2: (i) : If the position is ( m , m ) then the move "take m stones from each pile" wins.
(ii) : If the position is ( m , m + k ) then we have sub-cases:
(a): If there exists L q = ( m , m + q ) and k > q then the move "take k − q stones from the second pile" leaves L q . Or if q > k , then the move "remove m − l stones from each pile" leaves L k = ( l , l + k ) . This works because the sizes of piles in L q are greater than those in L k whenever q > k .
(b): If there exists L q = ( m − q , m ) then the move "take k + q stones from the second pile" leaves the reverse of L q . We clearly must have m + k > m − q ..
Since all values from 1 through 1 8 appear in a member of L , those two cases are exhaustive for m < 1 9 . So we have remaining:
(c): If m ≥ 1 9 we must have k ≤ 1 1 because of the stipulation of 3 0 being the maximum pile size. In this case, the move "remove m − l stones from each pile" leaves L k = ( l , l + k ) .
Conclusion: there are 2 2 losing positions in L : the 1 1 listed above, and their reverses. So the number of winning positions is 9 0 0 − 2 2 = 8 7 8 .
Examples: ( 9 , 1 2 ) wins by case 2(ii)(a) with k = 3 , q = 6 ; we remove 5 stones from each pile to leave L 3 = ( 4 , 7 ) .
( 9 , 2 2 ) wins by case 2(ii)(a) with k = 1 3 , q = 6 ; we remove 7 stones from the second pile to leave L 6 = ( 9 , 1 5 ) .
( 2 4 , 2 6 ) wins by case 2(ii)(c) , we remove 2 1 stones to leave L 2 = ( 3 , 5 ) .
The game's called Wythoff's game . The complete solution is given here .
Just noticed that I omitted to prove that L 1 is a losing position. This can be done by considering L 0 = ( 0 , 0 ) and applying the same logic as Case 1. But we don't count L 0 in the final reckoning as it's not a valid start position.
I also glossed over positions that feature piles of size 0 - these should be included in W , and the winning move is "remove all stones from the non-zero pile".
The algorithm to generate the L list is as follows:
L 1 = ( 1 , 2 ) is the smallest losing position, by inspection.
Any position ( 1 , n ) , ( 2 , n ) , or ( n , n + 1 ) now is winning because it can be reduced to L 1 . The next losing position must be the one that does not fit in any of those categories, but all possible moves reduce it to a position already considered. That is, L k = ( l = smallest number that does not yet appear , l + k ) .
Within the 900 starting positions, there are 22 of them at which the second player has a winning strategy. (We will also refer this kind of positions as sure-lose positions . The positions such that the first player has a winning strategy are called sure-win positions ). Eleven of these sure-lose positions are:
( 1 , 2 ) , ( 3 , 5 ) , ( 4 , 7 ) , ( 6 , 1 0 ) , ( 8 , 1 3 ) , ( 9 , 1 5 ) , ( 1 1 , 1 8 ) , ( 1 2 , 2 0 ) , ( 1 4 , 2 3 ) , ( 1 6 , 2 6 ) , ( 1 7 , 2 8 ) ,
and the other eleven losing positions are just the "reverse" of them, namely, ( 2 , 1 ) , ( 5 , 3 ) , ⋯ , ( 2 8 , 1 7 ) .
Since the game does not allow a draw, and it is terminating in a finite number of steps, the total number of sure-win and sure-lose positions is 900, therefore the number of sure-win is 900-22= 878 .
To see how we can get the list of sure-lose positions, one way is to use a tabular (or lattice) representation. Consider the set of coordinates { ( m , n ) : m = 0 , 1 , … 3 0 ; n = 0 , 1 , … 3 0 } , and we assign to each pair ( m , n ) a number S ( m , n ) ∈ { 0 , 1 } , where S ( m , n ) = 1 if and only if it is a sure-win position (therefore S ( m , n ) = 0 if it is a sure-lose position).
We observe the following: - S ( 0 , 0 ) = 0 , since if on a player's turn there is no stone in both piles, the player loses by definition. - If S ( m , n ) = 0 then S ( m , n + x ) = S ( m + x , n ) = S ( m + x , n + x ) = 1 for all x > 0 because the first player can remove x stones from either or both of the piles. So now we know that S ( 0 , x ) = S ( x , 0 ) = S ( x , x ) = 1 for all x > 0 (Draw a picture to see it :-) - S ( m , n ) = 0 if and only if S ( m , n − x ) = S ( m − x , n ) = S ( m − x , n − x ) = 1 for all admissible x > 0 . This is because a position is sure-lose when all of the possible moves give a sure-win position to its opponent! For example, S ( 1 , 2 ) = 0 because S ( 0 , 2 ) = S ( 1 , 1 ) = S ( 1 , 0 ) = S ( 0 , 1 ) = 1 . - Similarly, S ( 2 , 1 ) = 0 . Then one also knows that S ( 2 + x , 1 ) = S ( 2 , 1 + x ) = S ( 2 + x , 1 + x ) = 1 for all x > 0 . Again, please draw a picture in order to help our eyes to see the pattern.
Since there are only 31 rows and 31 columns, it is not hard to continue the observation above even if we don't generalize. Thus we get the 22 sure-lose positions mentioned above.
Some notes:
One can simplify the process above by noticing that the difference of the coordinates of the sure-lose positions are 0 , 1 , 2 , 3 , … . For example, the first one is ( 0 , 0 ) with 0 − 0 = 0 , the second (pair) is ( 1 , 2 ) , ( 2 , 1 ) , with |2-1|=1. The n -th pair is determined by the following algorithm: take the smallest positive integer a n that has not been used in the previous pairs, then the new pair is ( a n + n , a n ) , ( a n , a n + n ) . For example, a 2 = 3 , so the second pair is ( 3 , 5 ) , ( 5 , 3 ) . Then a 3 = 4 , so the third pair is ( 4 , 7 ) , ( 7 , 4 ) , and so forth.
A more efficient algorithm to calculate a n is the integer part of
n ⋅ 2 5 + 1 . (Verify it!)
We work backwards to find all losing positions with m ≤ n . The key is that if ( x , y ) is winning iff there exists k ≥ 1 such that one of ( x − k , y − k ) , ( x , y − k ) , and ( x − k , y ) is losing.
For m = 0 , ( 0 , 0 ) is losing, so ( 0 , n ) is clearly winning for n ≥ 1 .
For m = 1 , ( 1 , 1 ) is winning, so ( 1 , 2 ) is losing and ( 1 , n ) is winning for n ≥ 3 .
For m = 2 , ( 2 , n ) is winning for all n ≥ 2 , since ( 2 , 1 ) is losing.
In general, it's easy to see that for fixed m , there exists at most one value of n such that ( m , n ) is losing. Now order the losing pairs as ( m 0 , n 0 ) , ( m 1 , n 1 ) , … with m i ≤ n i and m 0 < m 1 < ⋯ , starting with ( m 0 , n 0 ) = ( 0 , 0 ) . A simple induction on i shows that ( m i , n i ) exists with n i − m i = i and m i the least integer not in the set { m 0 , n 0 , … , m i − 1 , n i − 1 } . Indeed, m i cannot lie in the set or else two losing pairs would intersect. On the other hand, if it is the smallest integer not in the set, then ( m i , m i ) , … , ( m i , m i + i − 1 ) must all be winning by the inductive hypothesis, while ( m i , m i + i ) is losing since the differences i , i + 1 , i + 2 , … do not belong to any losing pairs with smaller sum of coordinates and m i is too large to be in a smaller (previous) losing pair by construction.
It follows that ( 1 , 2 ) , ( 3 , 5 ) , ( 4 , 7 ) , ( 6 , 1 0 ) , ( 8 , 1 3 ) , ( 9 , 1 5 ) , ( 1 1 , 1 8 ) , ( 1 2 , 2 0 ) , ( 1 4 , 2 3 ) , ( 1 6 , 2 6 ) , ( 1 7 , 2 8 ) are the 1 1 losing pairs with both terms at most 3 0 , so the answer is 3 0 2 − 2 ⋅ 1 1 = 8 7 8 .
Denote the position where there are a stones in the first pike and b n the second pile by (a,b). We consider the case a < b, and the case a > b follows analogously. Note that (a,a), (a,0), (0,a) are winning positions for player 1. So this settles the case a = b.
First, we claim that (1,2) is a losing position for P1. Since P1 can only transform it into a winning position for P2, ((1,1),(1,0),(0,1),(0,2)), P1 loses. Then (m,m + 1) is a winning position for P1 where m > 1 since P1 can transform it into (1,2). Now consider (m, m + 2). (1,3), (2,4) are winning positions (can be transformed into (1,2) or (2,1)), and (3,5) isn't, since Move 1 can only transform one of the piles into less than 3 stones, with the other having 5, which is a winning position, or transform it into (m, m + 1), (m,m) , (m+1,m) or the previous case, and with m > 1. So P1 loses, (3, 5) is a losing position.
Continuing similarly, we can find that (4,7), (6,10), (8, 13), (9, 15), (11, 18), (12, 20), (14, 23), (16, 26), (17, 28). So there are a total of 11 losing positions in this case. If a > b, there are 11 losing positions too (namely (2,1), (5,3), etc...). So there are a total of 900 - 22 = 8 7 8 winning positions.
Let us represent a position with m stones in one pile, and n stones in the other pile, with m ≤ n as the pair ( m , n ) .
First of all I will define a sequence of pairs (which will turn out to be the losing positions). We start with a 0 = 0 , b 0 = 0 and then define recursively:
This generates the set of pairs L : ( 0 , 0 ) , ( 1 , 2 ) , ( 3 , 5 ) , ( 4 , 7 ) , ( 6 , 1 0 ) , ( 8 , 1 3 ) ( 9 , 1 5 ) , ( 1 1 , 1 8 ) , ( 1 2 , 2 0 ) , ( 1 4 , 2 3 ) , ( 1 6 , 2 6 ) , ( 1 7 , 2 8 ) , ( 1 9 , 3 1 ) … .
Firstly, it is clear that any move from L takes you out of L . This is because the pairs in L have disjoint elements (since a n and b n are disjoint and monotone increasing) and have different gaps (the sequence of gaps is just ( 0 , 1 , 2 , 3 , … ) ).
Secondly, let us show that if we start at a position ( α , β ) not in L with α ≤ β then you can always find a move into a position in L .
Note that every number will eventually feature in the sequence L . Defining a n as the smallest non-included number ensures there are no gaps. We must then have that α features in either the sequence of a 's or b 's, and we can consider these two cases separately.
If α is one of the a s, say α = a n then there are two possibilities if β < b n then the gap between them, k , is smaller than n and by removing the same amount of stones ( a n − a k ) from each pile we can reduce to ( a k , b k ) . If β > b n then we can just remove β − b n ) stones from the β pile to reduce to ( ( a n , b n ) .
If α is one of the b 's, say α = b n then we can just remove stones from the β pile (noting that a n < b n = α ≤ β ) to get to ( a n , b n ) .
We now can define a very simple winning strategy for Player 1 for all starting positions not in L . All he needs to do is move in such a way that after each of his move Player 2 is confronted with a position in L . We have shown both that this is possible on the first move, and since Player 2 cannot return a position in L It will also be possible on subsequent moves. Of course if Player 1 starts with a position of L then he is forced to move out of L , and player 2 can reproduce player 1's winning strategy.
We now know that any position in L loses and all other position win. There are 11 elements of L with piles of size between 1 and 30 or fewer (i.e. ( 0 , 0 ) and ( 1 9 , 3 1 ) and onward are outside the range ) each contributing two orders (e.g (1,2) could be m = 1 , n = 2 or m = 2 , n = 1 . Hence there are 22 losing positions from the 900 starting positions, leaving 878 winning positions.
(1,2) (3,5) (4,7) (6,10) (8,13) (9,15) (11,18) (12,20) (14,23) (16,26) (17,28)
Let (m,n) represent the configuration with m stones in pile 1 and n stones in pile 2. Let (m,n) be a WC (winning configuration) for player x (pX) if pX has a winning strategy for (m,n) Note that when m=n, p1 wins. If (m,n) is a WC for p2, note that for all (m,k), k > n, p1 can win by using his first move to reduce k to n. This is derived from p1's ability to remove stones from the pile with n stones Similarly, for (r,n), r > m, p1 will win. Lastly, for (m+q,n+q), q > 0, player 1 will be able to remove q stones from both piles and win. Note that (1,2) is a WC for p2. By continuing on, we find that (1,2), (3,5), (4,7), (6,10), (8,13), (9,16), (11,19), (12,21), (14,24), (15,26) and (17,29) [and the other order] are the only WC for p2. Hence, WC for p1 = 900 - 2*11 = 878
Problem Loading...
Note Loading...
Set Loading...
Let S be the set of nonnegative integers and v : S × S → { 1 , 2 } be a function from pairs ( m , n ) to two possible values : 1 if player 1 has a winning strategy in a current state where there are m , n stones in pile 1 , 2 respectively, and 2 otherwise.
We can represent the possible set of moves as v ( a , 0 ) = v ( 0 , a ) = v ( a , a ) = 1 for any a . Now we want to find all ( m , n ) such that v ( m , n ) = 2 .
One can see for m ≤ n (case m ≥ n will be similar), that v ( m , n ) = 1 if and only if m = n or m = 0 or ( m , n ) can be reduced to some ( p , q ) after player 1 makes his move, where v ( p , q ) = 2 . In other words, v ( m , n ) = 2 if and only if v ( p , q ) = 1 for all possible moves of player 1 .
Now ,let's consider ( p , q ) such that v ( p , q ) = 2 , p < q (if the pair exists). The necessary conditions are :
I. ( p − x , q ) , x > 0 , In other words v ( a , q ) = 1 for all 0 ≤ a < p
II. ( p , q − x ) , x > 0 , In other words, v ( p , a ) = 1 for all 0 ≤ a < q .
III. ( p − x , q − x ) , x > 0 . Note that there is an invariant on the difference of the number of stones since q − p = ( q − x ) − ( p − x ) In other words, if D = q − p , then v ( a , a + D ) = 1 for all 0 ≤ b < a .
Start with an originally empty set A and B . Claim that we can generate the next ( p , q ) such that v ( p , q ) = 2 , p < q with the following method : Find the least natural number not in A (let's say x ), and also the least not in B (let's say y ). way.
By the way, 'next' means if the previous pair such that v = 2 is ( p ′ , q ′ ) , then either p > p ′ or p = p ′ , q = q ′
The next ( p , q ) must be ( x , x + y ) (The reasons are below). Then we add x to A and y to B .
Reasons :
i) The least p must be equal to x . Otherwise p < x and so p ∈ A . But it means that v ( p , p + d ) = 2 for some d ∈ B . Since any new q must be such that q − p > d for any d ∈ B , then the state ( p . q ) can be reduced to ( p , p + d ) , by taking q − p − d > 0 stones from the 2nd pile and so v ( p , q ) = 1 . Hence, p = x .
ii) Given p , the least q must be such that q − p > d for any d ∈ B (since otherwise v ( p , q ) = v ( p , p + d ) = 1 for some d ∈ B as by the definition of the above's method, there is a p ′ < p such that v ( p ′ , p ′ + d ) = 2 and we can reduce get from ( p , q ) = ( p , p + d ) to p ′ , p ′ + d ) by taking p − p ′ > 0 stones from the 1st pile. ). Hence q − p = y .
With the above's method we will get ( 1 , 2 ) , ( 3 , 5 ) , ( 4 , 7 ) , ( 6 , 1 0 ) , ( 8 , 1 3 ) , ( 9 , 1 5 ) , ( 1 1 , 1 8 ) , ( 1 2 , 2 0 ) , ( 1 4 , 2 3 ) , ( 1 6 , 2 6 ) , ( 1 7 , 2 8 ) , ( 1 9 , 3 1 ) , ⋯ and their reverses. We stop at ( 1 7 , 2 8 ) since the next element ( 1 9 , 3 1 ) has its 2nd number bigger than 3 0 , We have 1 1 × 2 = 2 2 pairs of ( p , q ) such that v ( p , q ) = 2 (losing positions for player 1 ) where p , q ≤ 3 0 .
Hence there are 9 0 0 − 2 2 = 8 7 8 starting positions where first player have a winning strategy.