NIM

Binary numbers

Decimal (base 10)

(2018)_{10} = 2\times10^3 + 0\times10^2 + 1\times10^1 + 8\times10^0
(2018)10=2×103+0×102+1×101+8×100(2018)_{10} = 2\times10^3 + 0\times10^2 + 1\times10^1 + 8\times10^0

Binary (base 2)

(1011)_{2} = 1\times2^3 + 0\times2^2 + 1\times2^1 + 1\times2^0 = (11)_{10}
(1011)2=1×23+0×22+1×21+1×20=(11)10(1011)_{2} = 1\times2^3 + 0\times2^2 + 1\times2^1 + 1\times2^0 = (11)_{10}

Convert decimal to binary

1. Find the greatest power of two smaller than the original number

2. Set respective bit to 1

3. Subtract the power from the original number

4. Repeat until original number becomes 0

Method 1

Method 2 (works with other bases as well)

1. Divide the original number by 2

2. Add the remainder to the end of our answer

3. Replace the original number with the quotient

4. Repeat until original number becomes 0

Logic gates

(AND, OR, XOR)

The game

The rules

There are $$n$$ heaps of any number of objects. Two players take turns removing any amount of objects from a single heap. The first player who is unable to make another move loses the game.

The questions

The observations

The solution

The explanation

The end

https://en.wikipedia.org/wiki/Nim

https://www.jstor.org/stable/1967631?seq=3#metadata_info_tab_contents

https://answers.yahoo.com/question/index?qid=20110215140400AAa4jdJ

https://www.hackerrank.com/challenges/misere-nim-1/forum

https://brilliant.org/wiki/nim/

https://mathoverflow.net/questions/71802/analysis-of-misere-nim

Made with Slides.com