Does anybody have a proper derivation for Nim? I don't want to see just Nim sums,binary conversions but also why we use those Nim sums and binary conversions,etc. Basically, teach it to me like i'm five. I'm a high school student who is doing this topic for my extended essay, and i dont have much knowledge of combinatorial game theory.(i can draw simple game trees and im reasonably familiar with surreal nos, im reading through On Numbers and Games right now, but again, i feel like some things are being left unexplained, such as why we have to convert hackenbush diagrams to binary code to get the values of the Games.) So the more basic you go, the better. Thank you.
2025-01-12 23:55:41.1736726141
Complete derivation for perfect play for Nim?
272 Views Asked by anonymous https://math.techqa.club/user/anonymous/detail At
1
There are 1 best solutions below
Related Questions in COMBINATORIAL-GAME-THEORY
- Probabilistic Game Theory
- Moves to P-positions in Nim
- Board game on a $m\times n$ board - winning strategy
- Perfect information game with heap of objects
- stacks with odd number of cards
- Number of connected sets intersecting a given set in $\mathbb{Z}^d$
- Numbers written on a board
- What is the optimal strategy in the "Factor Game"?
- Game for mathematicians about differentiation of polynomials and subtractions in their coefficients.
- The application of Nimbers to Nim strategy
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Refuting the Anti-Cantor Cranks
- Find $E[XY|Y+Z=1 ]$
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- What are the Implications of having VΩ as a model for a theory?
- How do we know that the number $1$ is not equal to the number $-1$?
- Defining a Galois Field based on primitive element versus polynomial?
- Is computer science a branch of mathematics?
- Can't find the relationship between two columns of numbers. Please Help
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- A community project: prove (or disprove) that $\sum_{n\geq 1}\frac{\sin(2^n)}{n}$ is convergent
- Alternative way of expressing a quantied statement with "Some"
Popular # Hahtags
real-analysis
calculus
linear-algebra
probability
abstract-algebra
integration
sequences-and-series
combinatorics
general-topology
matrices
functional-analysis
complex-analysis
geometry
group-theory
algebra-precalculus
probability-theory
ordinary-differential-equations
limits
analysis
number-theory
measure-theory
elementary-number-theory
statistics
multivariable-calculus
functions
derivatives
discrete-mathematics
differential-geometry
inequality
trigonometry
Popular Questions
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- How to find mean and median from histogram
- Difference between "≈", "≃", and "≅"
- Easy way of memorizing values of sine, cosine, and tangent
- How to calculate the intersection of two planes?
- What does "∈" mean?
- If you roll a fair six sided die twice, what's the probability that you get the same number both times?
- Probability of getting exactly 2 heads in 3 coins tossed with order not important?
- Fourier transform for dummies
- Limit of $(1+ x/n)^n$ when $n$ tends to infinity
I don't know how much clearer this will be than the proof on Wikipedia. But I've tried to minimize notation by sacrificing conciseness.
Setup
For Nim, I'll refer to "heaps of tokens" (rather than "rows of cards", etc.). A Nim "position" is just a particular setup, like "2 heaps of 5 tokens and 1 heap of 7 tokens".
Firstly, for those who are not already familiar with the strategy for Nim, I highly recommend this youtube video by Mathologer (Burkard Polster). To keep things simple, I'll focus only on normal play, where the player who takes the last token wins.
Balanced positions
We call a Nim position "balanced" if when you separate the heaps into distinct powers of $2$ (e.g. $13 = 8+4+1$), there are even numbers of each power of $2$.
For example, the position with heaps of sizes $3,5,7,8,9$ is balanced because "$1+2,1+4,1+2+4,8,1+8$" shows four $1$s, two $2$s, two $4$s, and two $8$s. $3,3,4,4=1+2,1+2,4,4$ is also balanced because there are two $1$s, two $2$s, and two $4$s. As a special case, the endgame position with no tokens is also balanced, since something like $0,0,0,0,0$ has zero powers of $2$, and zero is even.
$3,5,7$ is not balanced since there are three $1$s in $1+2,1+4,1+2+4$, and three is odd. $9$ is another unbalanced position since it has only one $8$.
Balanced positions can only become unbalanced
I claim that if you make a move (remove $1$ or more tokens from a single heap) in a balanced position, then you necessarily make it unbalanced.
Suppose we have a balanced position, and move in some heap to get a new number of tokens. If all the powers of $2$ in that heap were left exactly the same, it would be the same number, so some power of $2$ must change (either a new one we didn't have, or we lose an old one, or both). For example, moving from $7=1+2+4$ to $4$ loses both $1$ and $2$. Moving from $9=1+8$ to $7=1+2+4$ loses $8$ but gains $1$, etc.
But whatever change we make to the powers of $2$ in a single heap will unbalance things. For example, if we gain a $4$, then we're adding one to the even number of $4$s we had in the balanced position, and that makes the number of $4$s odd. If we lose a $2$, then we're subtracting one from the even number of $2$s we had in the balanced position, and that would make the number of $2$s odd. This doesn't depend on which power(s) of $2$ we gain or lose, since we can't gain or lose more than one of the same power of $2$ (e.g. $4+4$ would be written as $8$).
Unbalanced positions can be balanced
I claim that if the current position is unbalanced, then there is a move that balances it. Note that since it's unbalanced, there is an odd number of at least one power of $2$.
So suppose for example that $8$ is the largest power of $2$ with an odd amount (so there are an even number of $16$s, $32$s, etc.). Since there are an odd number of $8$s, there is at least one heap with an $8$ in it. For example, in the position $1,9,16,16$, the heap of size $9=1+8$ has an $8$. I claim that we can balance the position by removing tokens from any heap with an $8$ in it.
We could balance the position if we could "magically" replace the heap with one that removes the $8$, and add/removes lower powers as needed (remember, everything above $8$ already has an even amount).
[For example, if all the powers of $2$ that have an odd amount are $1$ and $2$ and $8$. Then we could balance the position if we could "magically" replace the heap with one that removes the $8$, and adds/removes the $1$ and the $2$ as needed. If our heap had $25=1+8+16$, then we could balance the position by leaving $18=2+16$ (which we can do by removing $7$).]
By removing the right amount, we can always do the above "magical" replacement when the desired new heap size is less than the original one. And the desired heap size can't be the same as the old one since the $8$s make the position unbalanced. But we'd have a problem if the desired size were more than the old one. In the worst case (with the highest possible desired size) we'd remove $8$, but need to add $1$ and $2$ and $4$, which sum to $7=8-1$, so the desired size is at most $1$ less than the starting one, and we can always get there by removing tokens from this heap.
The argument above doesn't depend on the number $8$: $1+2=4-1$, $1+2+4+8=16-1$, etc. So we really can always balance an unbalanced position by removing the right amount of tokens from a heap with the largest odd-amount power of $2$.
Conclusion
Since players only remove tokens, the total number of tokens will eventually go down to zero. Since the endgame position is balanced, if the starting position is unbalanced, the first player can win by repeatedly making balancing moves (the opponent has no choice but to keep unbalancing).
Gap
I didn't prove above that it's always possible to write a nonnegative integer as a sum of distinct powers of $2$, but since the OP mentioned "binary conversions", I assumed that wasn't my responsibility. That's also addressed here.