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

which type of aspect you want from the student.

1701


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

2160


struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

766


How the c program is executed?

632


What is an lvalue?

636






How many levels of pointers can you have?

705


What are the preprocessor categories?

639


What is realloc in c?

581


Why should I use standard library functions instead of writing my own?

674


What language is c written?

577


When is a “switch” statement preferable over an “if” statement?

650


What is the difference between array and linked list in c?

601


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

570


List some applications of c programming language?

552


What is the scope of local variable in c?

578