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 / rahul

N%2

if it gives 0 then the person can choose to go second.if
nonzero then he should go first.But this logic is acceptable
only if there is atleast one egg in each basket.

Is This Answer Correct ?    2 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why isn't any of this standardized in c? Any real program has to do some of these things.

621


What is anagram in c?

510


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

1722


What is the difference between strcpy() and memcpy() function in c programming?

624


What are structure types in C?

660






Explain why can’t constant values be used to define an array’s initial size?

851


What is a macro?

653


What is the use of volatile?

602


how to execute a program using if else condition and the output should enter number and the number is odd only...

1652


What is the difference between near, far and huge pointers?

627


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

2978


What are the advantages of using Unions?

642


What is the difference between int main and void main in c?

589


What is function what are the types of function?

553


Tell me what is the purpose of 'register' keyword in c language?

614