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 / 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 |
Post New Answer View All Answers
how should functions be apportioned among source files?
Write a program to check whether a number is prime or not using c?
What is the advantage of an array over individual variables?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
What is the use of #define preprocessor in c?
What is the difference between a free-standing and a hosted environment?
What is the difference between array and linked list in c?
What is nested structure with example?
What is the maximum no. of arguments that can be given in a command line in C.?
Write a program with dynamically allocation of variable.
What is the use of a semicolon (;) at the end of every program statement?
Define the scope of static variables.
How do you do dynamic memory allocation in C applications?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
What is call by value in c?