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?

Answers were Sorted based on User's Feedback



There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take..

Answer / guest

i need answer for it

Is This Answer Correct ?    4 Yes 2 No

There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take..

Answer / playboy

There are N buckets & each contains n eggs in it.
Then let opponent to start a game.
If opponent picks x eggs then u choose n-x from perticular
bucket.

This way u can win...

Is This Answer Correct ?    2 Yes 2 No

There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take..

Answer / khushboo

It is said that there are N egg bags with eggs in it. So
every bag should have eggs..
Now answer depends on Number of Bags containing only one bag

Suppose there is
1. all bag contains more then 1 egg then I will choose first
2. only one bag with one egg then I will choose second
3. Two bags contain one egg I will choose third..

So It depends on how I reach to the last bag in first place

Is This Answer Correct ?    1 Yes 2 No

There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take..

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

There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take..

Answer / guest

n-1 if n is odd and n+1 if n is even

Is This Answer Correct ?    0 Yes 2 No

There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take..

Answer / guest

n-1 if n is odd and n+1 if n is even

Is This Answer Correct ?    0 Yes 2 No

There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take..

Answer / ghfhj erwe

0

Is This Answer Correct ?    1 Yes 4 No

There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take..

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

More C Interview Questions

What is dynamic dispatch in c++?

0 Answers  


c pgm count no of lines , blanks, tabs in a para(File concept)

2 Answers  


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

0 Answers   TCS,


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

0 Answers  


What does the error message "DGROUP exceeds 64K" mean?

0 Answers   Celstream,






Determine the result of performing two successive block transfers into the same area of a frame buffer using the binary arith operations

0 Answers  


cavium networks written test pattern ..

0 Answers   Cavium Networks,


Difference Between embedded software and soft ware?

1 Answers   Bosch,


Write any data structure program (stack implementation)

1 Answers   HTC,


a c code by using memory allocation for add ,multiply of sprase matrixes

0 Answers  


Explain the array representation of a binary tree in C.

0 Answers   Genpact,


What are the average number of comparisons required to sort 3 elements?

2 Answers   DRDO,


Categories