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

Write a simple code fragment that will check if a number is positive or negative.

704


Differentiate fundamental data types and derived data types in C.

611


Do pointers store the address of value or the actual value of a variable?

606


how could explain about job profile

1447


Explain what are the different file extensions involved when programming in c?

631






void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2220


What are the disadvantages of a shell structure?

686


What is the difference between malloc() and calloc() function in c language?

598


What is s in c?

609


What is the g value paradox?

645


Explain the difference between call by value and call by reference in c language?

643


What is new line escape sequence?

805


Explain the difference between structs and unions in c?

574


What is the benefit of using const for declaring constants?

581


What are # preprocessor operator in c?

628