GATE Computer ScienceHardGATE CS
In the game of Nim with piles of 9, 12, 17, 21, 30 and 6 stones, a move removes any positive number of stones from a single pile. How many different winning moves does the first player have (moves after which the position has Nim-sum 0)?
- A. 2
- B. 4
- C. 3
- D. 1
Correct answer: C. 3
The Nim-sum of the piles is 9 ⊕ 12 ⊕ 17 ⊕ 21 ⊕ 30 ⊕ 6 = 25. A move on pile p is winning exactly when p ⊕ 25 < p: this holds for 17 (to 8), 21 (to 12) and 30 (to 7), but not for 9, 12 or 6. So there are 3 winning moves.
More Discrete Mathematics questions
- Let F(0) = 0, F(1) = 1, F(n) = F(n − 1) + F(n − 2). What are the last two decimal digits of F(2024)?
- How many different equivalence relations can be defined on a set of 5 elements?
- How many onto (surjective) functions exist from a 5-element set to a 3-element set?
- In how many ways can 6 distinct letters be placed into their 6 addressed envelopes (one per envelope) so that no letter is in its own…
- What is the smallest positive integer x with x ≡ 2 (mod 3), x ≡ 3 (mod 5) and x ≡ 2 (mod 7)?
- How many spanning trees does the complete bipartite graph K₃,₃ have?