-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblems.json
More file actions
32 lines (32 loc) · 7.67 KB
/
problems.json
File metadata and controls
32 lines (32 loc) · 7.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"problems": [
{
"id": 0,
"name" : "Screwy Pirates",
"description": "Five pirates looted a chest full of 100 gold coins. Being a bunch of democratic pirates, they agree on the following method to divide the loot:<br><br>The most senior pirate will propose a distribution of the coins. Al pirates, including the most senior pirate, will then vote. If at least 50% of the pirates (3 pirates in this case) accept the proposal, the gold is divided as proposed. If not, the most senior pirate will be fed to shark and the process starts over with the next most senior pirate... The process is repeated until a plan is approved. You can assume that all pirates are perfectly rational: they want to stay alive first and to get as much gold as possible second. Finally, being blood-thirsty pirates, they want to have fewer pirates on the boat if given a choice between otherwise equal outcomes.<br><br>How will the gold coins be divided in the end?",
"solution": "If you have not studied game theory or dynamic programming, this strategy problem may appear to be daunting. If the problem with 5 pirates seems complex, we can always start with a simplified version of the problem by reducing the number of pirates. Since the solution to 1-pirate case is trivial, let's start with 2 pirates. The senior. pirate (labeled as 2) can claim all the gold since he will always get 50% of the votes from himself and pirate 1 is left with nothing.<br><br>Let's add a more senior pirate, 3. He knows that if his plan is voted down, pirate I will get nothing. But if he offers private 1 nothing, pirate I will be happy to kill him. So pirate 3 will offer private 1 one coin and keep the remaining 99 coins, in which strategy the plan will have 2 votes from pirate 1and 3.<br><br>If pirate 4 is added, he knows that if his plan is voted down, pirate 2 will get nothing. So pirate 2 will settle for one coin if pirate 4 offers one. So pirate 4 should offer pirate 2 one coin and keep the remaining 99 coins and his plan will be approved with 50% of the votes from pirate 2 and .4<br><br>Now we finally come to the 5-pirate case. He knows that if his plan is voted down, both pirate 3 and pirate 1 will get nothing. So he only needs to offer pirate 1 and pirate 3 one coin each to get their votes and keep the remaining 98 coins. If he divides the coins this way, he will have three out of the five votes: from pirates 1 and 3 as well as himself.<br>>Once we start with a simplified version and add complexity to it, the answer becomes obvious. Actually after the case n= 5, a clear pattern has emerged and we do not need to stop at 5 pirates. For any 2 + 1 pirate case (n should be less than 99 though), the most senior pirate will offer pirates 1, 3, -, and 2n 1- each one coin and keep the rest for himself.",
"QID": "2.1.1"
},
{
"id": 1,
"name" : "Tiger and Sheep",
"description": "One hundred tigers and one sheep are put on a magic island that only has grass. Tigers can eat grass, but they would rather eat sheep. Assume: A. Each time only one tiger can eat one sheep, and that tiger itself will become a sheep after it eats the sheep. B. All tigers are smart and perfectly rational and they want to survive. So will the sheep be eaten?",
"solution": "100 is a large number, so again let's start with a simplified version of the problem. If there is only 1tiger (n =1), surely ti will eat the sheep since it doesnot need to worry about being eaten. How about 2 tigers? Since both tigers are perfectly rational, either tiger probably would do some thinking as to what will happen if it eats the sheep. Either tiger is probably thinking: fi I eat the sheep, I will become a sheep; and then I will be eaten by the other tiger. So to guarantee the highest likelihood of survival, neither tiger will eat the sheep.<br><br>If there are 3 tigers, the sheep will be eaten since each tiger will realize that once it changes to a sheep, there will be 2 tigers left and it will not be eaten. So the first tiger that thinks this through will eat the sheep. If there are 4 tigers, each tiger will understand that if it eats the sheep, it will turn to a sheep. Since there are 3 other tigers, it will be eaten. So to guarantee the highest likelihood of survival, no tiger will eat the sheep.<br><br>Following the same logic, we can naturally show that if the number of tigers is even, the sheep will not be eaten. If the number is odd, the sheep will be eaten. For the case n= 100, the sheep will not be eaten.",
"QID": "2.1.2"
},
{
"id": 2,
"name" : "River Crossing",
"description": "Four people, A, B, C and D need to get across a river. The only way to cross the river is by an old bridge, which holds at most 2 people at a time. Being dark, they can't cross the bridge without a torch, of which they only have one. So each pair can only walk at the speed of the slower person. They need to get all of them across to the other side as quicklyaspossible. A is the slowest and takes 10 minutes to cross; B takes 5 minutes; C takes 2 minutes; and D takes 1 minute.<br><br>What is the minimum time to get all of them across to the other side?",
"solution": "The key point is to realize that the 10-minute person should go with the -5 minute person and this should not happen in the first crossing, otherwise one of them have to go back. So C and D should go across first (2 min); then send D back (1 min); A and B go across (10 min); send C back (2min); C and D go across again (2 min).<br><br>It takes 17 minutes ni total. Alternatively, we can send C back first and then D back in the second round, which takes 17 minutes as wel.",
"QID": "2.2.1"
},
{
"id": 3,
"name" : "Birthday Problem",
"description": "You and your colleagues know that your boss A's birthday is one of the following 10 dates:<br><br>Mar 4, Mar 5, Mar 8<br>Jun 4, Jun 7<br>Sep 1, Sep 5 <br>Dec 1, Dec 2, Dec 8<br><br>A told you only the month of his birthday, and told your colleague C only the day. After that, you first said: \"I don't know A's birthday; Cdoesn't know it either.\" After hearing what you said, C replied: \"I didn't know A's birthday, but now I know it.\" You smiled and said: \"Now I know it, too.\" After looking at the 10 dates and hearing your comments, your administrative assistant wrote down A's birthday without asking any questions. So what did the assistant write?",
"solution": "Don't let the \"he said, she said\" part confuses you. Just interpret the logic behind each individual's comments and try your best to derive useful information from these comments.<br><br>Let D be the day of the month of A's birthday, we have De {1,2,4,5,7,8}. If the birthday is on a unique day, C will know the A's birthday immediately. Among possible Ds, 2 and 7 are unique days. Considering that you are sure that C does not know A's birthday, you must infer that the day the C was told of is not 2 or 7. Conclusion: the month is not June or December. (If the month had been June, the day C was told of may have been 2; if the month had been December, the day C was told of may have been 7.)<br><br>Now C knows that the month must be either March or September. He immediately figures out A's birthday, which means the day must be unique in the March and September list. It means A's birthday cannot be Mar 5, or Sep .5 Conclusion: the birthday must be Mar 4, Mar8 or Sep 1.<br><br>Among these three possibilities left, Mar 4 and Mar 8 have the same month. So if the month you have is March, you still cannot figure out A's birthday. Since you can figure out A's birthday, A's birthday must be Sep .1 Hence, the assistant must have written Sep 1.",
"QID": "2.2.2"
}
]
}