There are N egg baskets and the number of eggs in each
basket is a known quantity. Two players take turns to remove
these eggs from the baskets. On each turn, a player must
remove at least one egg, and may remove any number of eggs
provided they all belong to the same basket. The player
picking the last egg(s) wins the game. If you are allowed to
decide who is going to start first, what mathematical
function would you use to decide so that you end up on the
winning side?
Answer Posted / lokesh
if the XOR of all the numbers of eggs is zero than second
player win else first player will win.
(From NIM game(game theory))
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is a null string in c?
If the size of int data type is two bytes, what is the range of signed int data type?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
Explain the difference between the local variable and global variable in c?
What are the benefits of c language?
What is merge sort in c?
Is flag a keyword in c?
How to write a multi-statement macro?
can any one provide me the notes of data structure for ignou cs-62 paper
What is bubble sort technique in c?
Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays
Why can arithmetic operations not be performed on void pointers?
Under what circumstances does a name clash occur?
Explain what is page thrashing?
I have seen function declarations that look like this