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
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
pierrot's divisor program using c or c++ code
Explain the bubble sort algorithm.
What are directives in c?
Is c programming hard?
c language interview questions & answer
In C language, the variables NAME, name, and Name are all the same. TRUE or FALSE?
How can you determine the maximum value that a numeric variable can hold?
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
Why is it important to memset a variable, immediately after allocating memory to it ?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
What is the use of linkage in c language?
How macro execution is faster than function ?
Distinguish between actual and formal arguments.
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none