Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

problem in Island of Knights and Knaves

Posted on 2010-11-24
11
Medium Priority
?
1,052 Views
Last Modified: 2012-06-21
Following problems are from the Island of Knights and Knaves, I need help in solving it.

a. Suppose you come across two of the inhabitants. You ask both of them whether the other one is a knight. Will you get the same answer in each case?
b. There are three natives A, B and C. Suppose A says ‘B and C are the same type.’ What can be inferred about the number of knights?
c. What question should you ask A to determine whether B is a knight? Justify your question using the construction given above.
d. What question should you ask A to determine whether A and B are the same type? Justify your question using the construction given above.
e. Person A says ‘If B is a knave, I am a knave.’ Determine what can be deduced about A and B.
0
Comment
Question by:hiddenpearls
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 1200 total points
ID: 34210958
a. both will give the same answer
b. odd
c. there are an infinite number of answers to this, but perhaps you are looking for "Are A and B the same type?"
d. there are an infinite number of answers to this, but perhaps you are looking for "Is B a knight?"
d. A and B are knights.
0
 
LVL 18

Expert Comment

by:deighton
ID: 34211542
c) how about asking A

'How would a knave answer if I asked him if B is a knight or a knave'?
 




0
 

Author Comment

by:hiddenpearls
ID: 34211615
@deighton
@ozo

b) c) and d)
I'm puzzled about these ..

can u please explain your answers ?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 18

Expert Comment

by:deighton
ID: 34211668
my answer to c doesn't work!  if A is a knight - sorry!

0
 

Author Comment

by:hiddenpearls
ID: 34211979
@ozo can u please expalin me your answers ? I need to understand this logic
Thanks a lot
0
 
LVL 18

Assisted Solution

by:deighton
deighton earned 400 total points
ID: 34213074
d) Ask A 'is B a knight?'
If A is a knight he will answer yes if B is a knight, but no if B is a knave - so yes = same type
If B is a knave he will answer Yes if B is a knave (becasuse knaves lie), he will answer no if B is a knight  -  so again 'yes'=same type

the answer you get tells you the true answer to 'are you both the same type'

e. Person A says ‘If B is a knave, I am a knave.’ Determine what can be deduced about A and B.

If A is a knight, then for the statement to be true,  B cannot be a knave, that would make the statement false

if A is a knave, then the statement is false, so B can not be a knave, because in that case the statement becomes true (B being a knave would indeed mean that A was a knave).  If A is a knave and B is a knight - the statement could still have been false, since we don't know what the implication of B being a knight is supposed to be.

there is no problem with a Knave-Knight combination

so I say that A is unknown and B is always a knight



0
 
LVL 84

Expert Comment

by:ozo
ID: 34213197
> and B is always a knight
correct.
Therefore the statement is true, and cannot be uttered by a knave.
0
 
LVL 18

Expert Comment

by:deighton
ID: 34216509
ozo - A says '‘If B is a knave, I am a knave.’'

what if it is a world where knave-knave pairs may not exist?  Then a knave could say it, but a knight couldn't say it.  B could be a knight in reality, and A could be a knave then say the statement
0
 
LVL 37

Assisted Solution

by:TommySzalapski
TommySzalapski earned 400 total points
ID: 34219531
Problem e: A says
B is knave -> A is knave
Which is only false if B is a knave and A is a knight. Otherwise the statement is true.

Special note: If B is a knight and A is a knave the statement is TRUE it is not neutral. It is TRUE and cannot be said by a knave (this is what ozo was getting at)

From logic:
(X -> Y) = (notX or Y) so not(X->Y) = X and notY

X Y  X->Y
T T     T
T F     T
F T     F
F F     T

Open in new window


So
A             B
Knight      Knight     statement is true and A is Knight (works)
Knight      Knave     statement is false and A is Knight (does not work)
Knave      Knight     statement is true and A is a knave (does not work)
Knave      Knave     statement is true and A is a knave (does not work)

Therefore they must both be knights.

If 'knave knave pairs can't exist' then F->T is still true.
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 34219546
hiddenpearls, when you get problems like this for most of them you can easily just set up a truth table (i.e. just look at all the possible combinations for what could happen. Even with three characters, there are only 8 possible setups) Then just look at all the possible ways it could turn out.

You can even use this type of logic to find questions to ask the knights and knaves. Just set up the 4 or 8 options and see how they would answer questions.
0
 

Author Comment

by:hiddenpearls
ID: 34469405
Thankyou so much for all of you guys ..
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Win a Jar of Candy Corn: A Scientific Approach! I love mathematics. If you love mathematics also, you may enjoy this tip on how to use math to win your own jar of candy corn and to impress your friends. As I said, I love math, but I gu…
Article by: Nicole
This is a research brief on the potential colonization of humans on Mars.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question