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 stream?
Is it better to bitshift a value than to multiply by 2?
How is a pointer variable declared?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
Is a house a shell structure?
How can you tell whether two strings are the same?
When can a far pointer be used?
What is the advantage of an array over individual variables?
Can you write a programmer for FACTORIAL using recursion?
Explain how do you determine the length of a string value that was stored in a variable?
How can I generate floating-point random numbers?
What are external variables in c?
What is static memory allocation? Explain
Is void a keyword in c?
What are valid operations on pointers?