Click here to Skip to main content
15,900,461 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Thought of the Day Pin
DRHuff24-Jul-19 8:15
DRHuff24-Jul-19 8:15 
GeneralYou know it's going to be one of those days... Pin
Gary Wheeler24-Jul-19 4:22
Gary Wheeler24-Jul-19 4:22 
GeneralRe: You know it's going to be one of those days... Pin
CodeWraith24-Jul-19 5:00
CodeWraith24-Jul-19 5:00 
GeneralRe: You know it's going to be one of those days... Pin
RickZeeland24-Jul-19 7:33
mveRickZeeland24-Jul-19 7:33 
GeneralRe: You know it's going to be one of those days... Pin
Gary Wheeler24-Jul-19 7:40
Gary Wheeler24-Jul-19 7:40 
PraiseOpen Source Discrete Math book PinPopular
raddevus24-Jul-19 4:03
mvaraddevus24-Jul-19 4:03 
GeneralRe: Open Source Discrete Math book Pin
Richard Deeming24-Jul-19 8:22
mveRichard Deeming24-Jul-19 8:22 
GeneralRe: Open Source Discrete Math book Pin
raddevus24-Jul-19 11:12
mvaraddevus24-Jul-19 11:12 
I'm very glad that you took a shot at it and felt uncertain about the answer, because I feel the same way.
Unfortunately, I didn't find the answer in the book.
Here's my logic though.

I thought Troll 2 was the only possibility for a knight.

I thought he was telling the truth that Troll 1 (a knave) was lying.

Troll 3 has to be lying because if all 3 were knaves, they'd all be lying and since Troll 1 and Troll 2 are in conflict with each other, one of them has to be telling the truth.

But, I cannot exactly rectify part 2 of Troll 3's statement (at least one of us is a knight).

But, I am entirely unsure about everything.

Is your answer correct? I will look it over again and see if it all seems to reconcile.
Thanks again for putting yourself out there. Maybe someone will come along who is confident of the answer. Laugh | :laugh:


Reposting riddle for reference:

Quote:
While walking through a fictional forest, you encounter three trolls guarding a bridge. Each is either a knight, who always tells the truth, or a knave, who always lies. The trolls will not let you pass until you correctly identify each as either a knight or a knave. Each troll makes a single statement:

Troll 1: If I am a knave, then there are exactly two knights here.
Troll 2: Troll 1 is lying.

Troll 3: Either we are all knaves or at least one of us is a knight.

Which troll is which?



Edit
Solution 2 from me
as I read it again, I think that Troll 1 and Troll 3 are knights.

I think Troll 2 is lying that Troll 1 is lying so Troll 1 is a knight.
"My intellect is quite dizzying!!! Wait til I get started!!" ala Princess Bride. Smile | :) Princess Bride - "Truly, you have a dizzying intellect." - YouTube[^]

Then Troll 3 could be telling the truth that "at least one of us is a knight" (since there are two knights.

So
Troll 1 Knight
Troll 2 Knave
Troll 3 Knight

I've probably embarrassed myself more. Blush | :O

modified 24-Jul-19 17:21pm.

GeneralRe: Open Source Discrete Math book Pin
Richard Deeming25-Jul-19 1:12
mveRichard Deeming25-Jul-19 1:12 
GeneralRe: Open Source Discrete Math book Pin
raddevus25-Jul-19 1:49
mvaraddevus25-Jul-19 1:49 
GeneralRe: Open Source Discrete Math book Pin
Ravi Bhavnani24-Jul-19 8:30
professionalRavi Bhavnani24-Jul-19 8:30 
GeneralRe: Open Source Discrete Math book Pin
raddevus24-Jul-19 11:04
mvaraddevus24-Jul-19 11:04 
PraiseRe: Open Source Discrete Math book Pin
CPallini24-Jul-19 21:51
mveCPallini24-Jul-19 21:51 
GeneralEspresso Defcaf? Pin
glennPattonWork324-Jul-19 0:45
professionalglennPattonWork324-Jul-19 0:45 
GeneralRe: Espresso Defcaf? Pin
phil.o24-Jul-19 0:52
professionalphil.o24-Jul-19 0:52 
GeneralRe: Espresso Defcaf? Pin
OriginalGriff24-Jul-19 0:56
mveOriginalGriff24-Jul-19 0:56 
GeneralRe: Espresso Defcaf? Pin
phil.o24-Jul-19 0:58
professionalphil.o24-Jul-19 0:58 
GeneralRe: Espresso Defcaf? Pin
Richard MacCutchan24-Jul-19 1:23
mveRichard MacCutchan24-Jul-19 1:23 
GeneralRe: Espresso Defcaf? Pin
OriginalGriff24-Jul-19 1:29
mveOriginalGriff24-Jul-19 1:29 
GeneralRe: Espresso Defcaf? Pin
Jacquers24-Jul-19 3:45
Jacquers24-Jul-19 3:45 
GeneralRe: Espresso Defcaf? Pin
Richard MacCutchan24-Jul-19 4:05
mveRichard MacCutchan24-Jul-19 4:05 
GeneralRe: Espresso Defcaf? Pin
Slow Eddie25-Jul-19 3:24
professionalSlow Eddie25-Jul-19 3:24 
GeneralRe: Espresso Defcaf? Pin
CodeWraith24-Jul-19 3:00
CodeWraith24-Jul-19 3:00 
GeneralRe: Espresso Defcaf? Pin
phil.o24-Jul-19 7:18
professionalphil.o24-Jul-19 7:18 
GeneralRe: Espresso Defcaf? Pin
den2k8824-Jul-19 3:17
professionalden2k8824-Jul-19 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   487 votes