## Forum Posts

C. Kevin Chen
Jul 05, 2020
In Introduction to Python
0
0
18
C. Kevin Chen
Jun 29, 2020
In Introduction to Python
0
0
74
C. Kevin Chen
Sep 09, 2018
In Java Question Bank
You have been sent to a remote island to negotiate a trade agreement. Three representatives arrive in a limo to greet you at the airport. The island is divided into three social castes: knight, cannibal, and knave, from highest to lowest. Knights always tell the truth, knaves always lie, and cannibals are equally as likely to tell the truth or lie with any utterance. You know that the contingent sent to meet you consists of exactly one of each, but it is impossible to tell them apart from physical appearance alone. Under no circumstances would your homeland conduct business with a cannibal, because someone will get eaten over the most inconsequential dispute. During the limo ride to the hotel, you are allowed to ask only one person one binary question (that can be answered with a simple yes/no), and it should give you enough information to stay away from the cannibal, guaranteed. What do you ask? Let's designate one representative each as A, B, C. Regardless of how we designate, there are six possible alignments as follows: A – knight, B – cannibal, C – knave A – knight, B – knave, C – cannibal A – cannibal, B – knight, C – knave A – cannibal, B – knave, C – knight A – knave, B – knight, C – cannibal A – knave, B – cannibal, C – knight You ask A, “Is B higher ranked than C?” If the answer is yes, open negotiations with C; otherwise, choose B. If A responds “yes”, either he is telling the truth (he is a knight), which also requires that B is a cannibal and thus higher ranked than C, a knave; or he is lying (he is a knave), which also requires that B is a cannibal and thus lower ranked than C, a knight. If A is a cannibal, the case is closed; in either case, C is definitely not a cannibal. Similarly if A responds “no”, either he is telling the truth (he is a knight), which also requires that B is a knave and thus lower ranked than C, a cannibal; or he is lying (he is a knave), which requires that B is a knight and thus higher ranked than C, a cannibal. Again, if A is a cannibal, the case is closed; in either case, B is definitely not a cannibal.
0
0
13
C. Kevin Chen
Sep 03, 2018
In Java Question Bank
You have been sent to a remote island to negotiate a trade agreement. Three representatives arrive in a limo to greet you at the airport. The island is divided into three social castes: knight, cannibal, and knave, from highest to lowest. Knights always tell the truth, knaves always lie, and cannibals are equally as likely to tell the truth or lie with any utterance. You know that the contingent sent to meet you consists of exactly one of each, but it is impossible to tell them apart from physical appearance alone. Under no circumstances would your homeland conduct business with a cannibal, because someone will get eaten over the most inconsequential dispute. During the limo ride to the hotel, you are allowed to ask only one person one binary question (that can be answered with a simple yes/no), and it should give you enough information to stay away from the cannibal, guaranteed. What do you ask?
0
0
19
C. Kevin Chen
Sep 03, 2018
In Java Question Bank
0
0
8
C. Kevin Chen
Aug 27, 2018
In Java Question Bank
Due to a Bitcoin deal gone wrong, you have been convicted along with Alex and Bob, two members of rival gangs. The only other way to settle the case is with a triangular shootout, where the last man standing goes free. As you are a much more seasoned crypto-analyst than marksman, you will hit any target you shoot at with probability 0.4. On the contrary, Alex is a sure shot who hits with probability 1, and Bob's rate is 0.7. The moderator has declared that you will shoot first, Bob will shoot second, and Alex will shoot third. If no one is dead after the first round (raising suspicions of sabotage), or if anyone shoots out of turn, you will all be sentenced to 20 years in prison. You are confident that Alex and Bob will do whatever it takes to a) stay out of jail and b) remain the last man standing. You have 5 minutes to decide on a strategy. What do you do? Hint will be posted in the comments section on Wednesday, August 29. Solution will be posted in the comments section on Saturday, September 1.
1
1
60
C. Kevin Chen