this is same as NIM
the concept is Grundy Numbers
just xor all the numbers
if it is zero 1st player will lose
else 1st player will win
assuming both play optimally

Arun,

On Fri, Aug 14, 2009 at 7:50 PM, sharad kumar <[email protected]>wrote:

> both
>
> On Fri, Aug 14, 2009 at 7:35 PM, ganesa thandavam <[email protected]>wrote:
>
>>
>> is the number of eggs same in all baskets ???
>>
>> On Aug 14, 7:00 pm, sharad kumar <[email protected]> wrote:
>> > 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?
>>
>>
>>
>
> >
>


-- 
Potential is not what U have, its what U think U have!!!
It is better to worn out than rust.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to