36

I've just taken a CS exam, which had the following question

6 persons entered a library the day a book got stolen. Each of them entered the library once and only once, and stayed there for some time, then left. If two persons were in the library at the same time, at least one of the two saw the other. After the investigation, the testimonies were

  • Albert stated he saw Bernard and Édouard

  • Bernard said he saw Albert and Isabelle

  • Charlotte said she saw Didier and Isabelle

  • Didier said he saw Albert and Isabelle

  • Édouard said he saw Bernard and Charlotte

  • Isabelle said she saw Charlotte and Édouard

Only the culprit is lying. Who is he/she ?

EDIT: I haven't had the time yet to check everybody's answers and claims.

To those saying the problem is ill-posed, I've actually translated the exact wording from the exam (Question IV.C https://www.concours-centrale-supelec.fr/CentraleSupelec/2015/MP/sujets/2014-033.pdf). As Meelo suggested, this can be solved swiftly with interval graphs.

Gabriel Romon
  • 1,079
  • 1
  • 13
  • 19
  • 5
    Are these implied to be the complete lists of who everyone saw? –  Apr 28 '15 at 17:34
  • @Emrakul No, that's just what each person told the police. – Gabriel Romon Apr 28 '15 at 17:38
  • 4
    @LeGrandDODOM Wouldn't be possible for them all to enter and leave together such that no one is lying (if this is not the complete list)? – Mark N Apr 28 '15 at 17:51
  • @MarkN No, because there is no relation between Bernard and Didier, so they didn't enter at the same moment – leoll2 Apr 28 '15 at 17:59
  • Is the culprit lying about everyone he/she saw or can the statement be a partial truth? – itriedacrab Apr 28 '15 at 18:17
  • @leoll2 just because they didnt see one another doesnt mean they werent in there together, the puzzle doesnt state they can't be 3-4 or more inside at the same time, only that they are always seen at least by one other. – Spacemonkey Apr 28 '15 at 18:40
  • 1
    @Spacemonkey Yes, but if D and B were together, one of the two must have seen the other! – leoll2 Apr 28 '15 at 18:48
  • 2
    -_- I hate this puzzle now My great theories have all just crumbled to pieces lolz – Spacemonkey Apr 28 '15 at 18:50
  • @Prem Who said that the truth-tellers are omitting information? – leoll2 Apr 28 '15 at 19:20
  • 3
    @leoll2: The guy that posted the puzzle said it in response to Emrakul's question "Are these implied to be the complete lists of who everyone saw?" @Emrakul No, that's just what each person told the police.. – Ian MacDonald Apr 28 '15 at 19:23
  • 6
    As of now, I see 5 answers "proving" B&D&E as culprits. So something is wrong somewhere. I feel , the question is incomplete or wrongly worded. – Prem Apr 28 '15 at 19:26
  • 1
    @Prem, you missed the final statement of mine where I suggest that $C$ is also a likely culprit. There is definitely information missing (or misrecorded or misremembered). – Ian MacDonald Apr 28 '15 at 19:33
  • I think we can conclude that it absolutely can't be A or I. – EnragedTanker Apr 28 '15 at 19:35
  • 1
    Ian MacDonald , yes I missed C. #### crayzeedude , that is true only until somebody "proves" that A & I are culprits. – Prem Apr 28 '15 at 19:39
  • @Prem Well, that is true. 'Twas just a thought. – EnragedTanker Apr 28 '15 at 19:40
  • 3
    I think itriedacrab and leoll both came up with a solid answer proving D is the lyar. – Spacemonkey Apr 28 '15 at 19:52
  • I... don't know what I did. I stumbled onto a valid solution where D is the liar, but I can only prove it if it's guaranteed that A and I aren't lying. If somebody knows how to prove that A and I are telling the truth, then I have an answer. – Hylianpuffball Apr 29 '15 at 00:38
  • 1
    Ah! I saw this puzzle once at a math program, but I forgot the answer. It had something to do with some property of interval graphs... I hope someone posts such a solution. – Milo Brandt Apr 29 '15 at 02:10
  • 1
    @Meelo That was the subject of the exam indeed. – Gabriel Romon Apr 29 '15 at 04:09
  • 2
    The original subject correctly used an accent on Édouard. Why not do the same? – Édouard Apr 29 '15 at 12:11
  • @Raystafarian Could you screenshot that and turn it into an answer ? – Gabriel Romon Apr 29 '15 at 17:17
  • 2
    I think LeGrandDODOM's response to Emrakul's question at the top is a little misleading. None of the truth tellers are actually omitting information that they have. They are simply not necessarily aware of everyone they were in the library with. – glibdud Apr 29 '15 at 17:32
  • 1
    @Raystafarian , I have two concerns about the paper you listed. (1) It assumes that all people are telling the truth to draw the interval graph and then proves that D must be lying. In general mathematical terms, this conclusion is wrong. It only implies that the assumption was wrong, so somebody (not necessarily D) was lying. -- continued in next --- – Prem Apr 29 '15 at 20:19
  • 1
    -- continued from previous -- (2) When drawing the interval graph and looking for cycles, the paper says "I would have to start by drawing two disjoint intervals for A and I . . ." Why DisJoint ? & ". . . D which must intersect both A and I , but cannot intersect B, but this is impossible". Why is it impossible ? Because it assumes that any 2 people not mentioned as seen together were indeed not together. That changes the question entirely. Condition missing in the question is "The testimony given by truth-tellers is COMPLETE". Only then we can draw the complete interval graph. – Prem Apr 29 '15 at 20:21
  • 1
    @LeGrandDODOM , I hope you have seen my previous two huge comments. In your question "If two persons were in the library at the same time, at least one of the two saw the other" must be better written as "If two persons were in the library at the same time, at least one of the two saw the other & mentioned this in the testimonies". Otherwise the question is not complete. – Prem Apr 29 '15 at 20:32
  • 3
    Isabelle is lying. Her real name is Frédéric ;) – Ergwun Apr 30 '15 at 00:57
  • 2
    @Prem is correct. Additionally, the information given is demonstrably incomplete, because a trivial answer can be given: suppose one of the suspects is blind, and therefore is lying about having seen anyone. Suppose all the suspects (including the blind one) were actually in the library at the same time, and every other suspect saw everyone else, including the blind suspect. Now, none of them are "lying," because they did indeed see the people they claimed to see; they're just omitting information. Only the culprit is lying. – Kyle Strand Apr 30 '15 at 22:58
  • @KyleStrand , using blindness is a nice way to highlight (or prove) the incompleteness. – Prem May 01 '15 at 03:17
  • @Emrakul Without that assumption any of them could be the culprit: They all arrive at the same time, they all see each other except the liar misses seeing someone they later claim to have seen. This satisfies all of the conditions if omitting people is not considered lying. Thus to be an interesting problem omitting people seen, must be considered lying. – Rick Sep 03 '15 at 20:13

12 Answers12

14

I think I have an answer:

Didier is lying

I started drawing a graph, eventually gaining this timeline of events (overlaps acceptable).

$Edouard \leftarrow Albert \leftrightarrow Bernard \rightarrow Isabelle \leftrightarrow Charlotte \rightarrow Didier$

You can connect the other sightings, to have at least one relationship,

save for Didier. Didier observes Albert and Isabelle, but there is no relationship between Didier and Bernard, even though they should overlap in some way in order for Didier to observe both Albert and Isabelle. (Didier observed Albert and Isabelle. Bernard is between Albert and Isabelle. Therefore either Bernard should have seen Didier or Didier should have seen Bernard as they would have been at the library at the same time).

Also

Édouard or Didier would have observed the other from their overlapping timelines.

You can verify the answer with this image.

Graph

Coder-256
  • 153
  • 3
itriedacrab
  • 1,738
  • 1
  • 11
  • 22
  • I think this needs more explanation. Why should there be a relationship between D and B because D saw both A and I? – Rand al'Thor Apr 28 '15 at 19:05
  • @randal'thor you're right, I need a drawing tool. B visited between A and I, so at least one of B or D should have seen the other for D to have seen A and I. – itriedacrab Apr 28 '15 at 19:09
  • This seems right – Spacemonkey Apr 28 '15 at 19:47
  • 1
    Nitpick: D never states that he did not see B. So you assume that the persons answers lists all the people they saw, which is a reasonable assumption but not actually in the wording of the problem. – Taemyr Apr 29 '15 at 08:11
  • @Taemyr Counter: Conversely, B never states that he saw D. So either B is lying or D is lying (but if B is lying, E is lying as well). – itriedacrab Apr 29 '15 at 15:20
  • @Taemyr ahhhh, nevermind, I get what you're saying. – itriedacrab Apr 29 '15 at 15:21
  • 2
    This appears correct. Ran a brute force for completeness... there are 48 possible permutations that satisfy the conditions of the problem, all have the same liar (the one stated in this solution). In short: (1) A, B, and E enter in any order, (2) A leaves, (3) I enters, (4) B leaves, (5) C enters, (6) E and I leave in either order, (7) D enters, (8) C and D leave in either order. That covers half the cases, the other half do the same in reverse order. – glibdud Apr 29 '15 at 15:34
  • @glibdud but did you allow for A to be present while B was there but not see B (and thus be lying)? – Rick Sep 03 '15 at 19:56
  • @Taemyr if omitting people was not considered lying then any of them could have been the culprit: they could all have been there at the same time and the liar just happened to not see a person they said they saw. – Rick Sep 03 '15 at 19:58
10

This is perhaps the interval graph solution LeGrandDODOM referred to.

Create a graph by

adding an edge between each pair where one supposedly saw the other.

Graph representing people who saw each other

We then have

If everyone is telling the truth, the resulting graph is an interval graph. Interval graphs clearly cannot have an induced $C_4$, but the resulting graph has at least two: $ADIB$ and $ADCE$. Hence not everyone is telling the truth and the lies must correspond to edges or non-edges to make both of these $C_4$s not induced. Thus $A$ or $D$ is lying as these are the only two on both $C_4$s. $D$ may be lying about seeing $A$, or perhaps $A$ is lying about not seeing $C$ and $I$. As far as I can tell, either case can happen.

Tyler Seacrest
  • 9,174
  • 2
  • 28
  • 62
  • 1
    Except if $A$ were the liar, $ADIB$ would still be a valid $C_4$, because both $D$ and $B$ said they saw $A$. – glibdud Apr 29 '15 at 17:26
  • 1
    This answer is excellent, except the second to last sentence makes an oversight, thus missing the conclusion. You're right that one of those two is lying because they're the only two on both C4s, but more relevant is that there's only one edge in both C4s. Ergo, that edge is the lie, and we therefore know who the liar is. – Mooing Duck Apr 29 '15 at 19:29
  • 1
    @glibdud: If you consider it possible that $A$ actually saw $C$ and $I$ and this is considered lying, then I stick with $A$ could be the liar. It's true, ADIB is still a $C_4$, but it is no longer an induced $C_4$ (that is, there are edges among those $4$ vertices not part of the cycle). Therefore, $ADIB$ is not a problem. In fact, Zeb below gives a specific example of how this could happen. Since you have issue with Zeb's answer too, I think perhaps we're interpreting the problem differently. – Tyler Seacrest Apr 30 '15 at 06:51
  • 2
    @MooingDuck: Thanks. You're right in that the only way to make the graph an interval graph by removing edges claimed by a single person is to remove that AD edge. But if you consider adding edges to make a graph an interval graph, that's where I feel like you can claim A is a possible liar. But again, perhaps we're interpreting the puzzle in different ways. – Tyler Seacrest Apr 30 '15 at 06:53
  • @TylerSeacrest I'm not really a graph expert... can you explain the significance of an "induced" cycle? – glibdud Apr 30 '15 at 10:38
  • @TylerSeacrest I suspect you're right that it's a matter of interpretation... not sure where the disconnect is, though. – glibdud Apr 30 '15 at 12:55
  • @glibdud: Wikipedia calls an induced cycle a "chordless cycle", which is probably a better name for it (though the idea of induced subgraph is much broader than cycles). See here for an explanation. An interval graph can have $C_4$s, but cannot have chordless $C_4$s. I hope that helps ... – Tyler Seacrest Apr 30 '15 at 14:41
  • 1
    @glibdud I believe the interpretation you made is that the liar's statement must contain no truth, whereas this interpretation is that the liar said something false or omitted information. For both interpretations the truth tellers omitted no information. – Rick Sep 03 '15 at 20:22
  • What is a $C_4$? I see that it likely has something to do with 4 vertices in a cycle that do not have a simple subcycle with 3 vertices, but I'm not clear on the significance of this. – ErikE Feb 06 '16 at 01:05
9

Because the problem states that exactly one of them is lying, it must be the case that they were not all in the library at once. If they were all in the library at the same time, each of them would have been able to make their statements truthfully, contradicting the one condition.

Let:
$A$ Albert
$B$ Bernard
$C$ Charlotte
$D$ Didier
$E$ Edouard
$I$ Isabelle

Then:
$A \rightarrow B + E$
$B \rightarrow A + I$
$C \rightarrow D + I$
$D \rightarrow A + I$
$E \rightarrow B + C$
$I \rightarrow C + E$

Now let's expand one step:

$A \rightarrow B + (A + I) + E + (B + C)$
$B \rightarrow A + (B + E) + I + (C + E)$
$C \rightarrow D + (A + I) + I + (C + E)$
$D \rightarrow A + (B + E) + I + (C + E)$
$E \rightarrow B + (B + E) + C + (D + I)$
$I \rightarrow C + (D + I) + E + (B + C)$

Here, we notice that $D$ is the only one that doesn't have someone see him after one step. Let's expand again:

$D \rightarrow A + (B + (A + I) + E + (B + C)) + I + (C + (D + I) + E + (B + C))$

Here is the first chance that $D$ has been mentioned in his graph. Unfortunately for him, the graph also contains all of the other people, which can't be the case (as discussed earlier).


Of course, a scenario could be constructed such that $D$ is invisible (by hiding or being quick or whatever). Because there is only one person that claims to see this invisible person, that person is allowed to be the single liar. Any other person is stated to have been seen by at least two people, so everyone else must have actually been seen by at least one person. Our old friend "Invisible Didier", however, cannot be seen by anyone. Hence, Charlotte is a liar and the culprit.

Ian MacDonald
  • 12,806
  • 1
  • 33
  • 63
  • Not really satisfied with the reason, he could just see whoever then immediatly leave thus no one would see him. – Spacemonkey Apr 28 '15 at 19:12
  • 1
    elegant way to do it... There is a self consistent solution where you assume D is the only liar and he is lying about everything. – kaine Apr 28 '15 at 19:12
  • @kaine, I agree but that is also true for some of the others. – Spacemonkey Apr 28 '15 at 19:13
  • @Spacemonkey, that's true. If $D$ enters and leaves immediately without anyone seeing him, then $C$ could certainly be lying. – Ian MacDonald Apr 28 '15 at 19:13
  • @Spacemonkey Maybe...find them....the best way i can find to look at it is in terms of pairs that can't touch: (AC, AI, BC, BD, DE) – kaine Apr 28 '15 at 19:15
  • @Spacemonkey Make a graph of the relationships between A, B, I, and D. You'll see that there is no relationship between B and D where there should be. Come to think of it, that could mean that B is omitting an observation, so either B or D could be lying... – itriedacrab Apr 28 '15 at 19:24
  • My mistake, if B was omitting, then E would be as well, so it still leaves just D. – itriedacrab Apr 28 '15 at 19:31
  • @IanMacDonald I C is lying, can you provide a compatible scheme of everyone's times? Not necessarily a picture like I did, you can just write when someone enters and when he leaves. Thank you in advance! – leoll2 Apr 28 '15 at 19:37
  • @leoll2 Simple. Construct a series of times for $A,B,C,E,I$. Now make $D$ enter right behind $B$, then immediately turn and leave upon seeing an old nemesis, $A$. In your picture, just overlap the $B$ and $D$ lines. – Ian MacDonald Apr 28 '15 at 19:42
  • @IanMacDonald Doing so, there's a moment when B and D were both inside. Though, neither claimed to have seen the other, contradicting "If two persons were in the library at the same time, at least one of the two saw the other." or "Only the culprit is lying." – leoll2 Apr 28 '15 at 19:46
  • @leoll2 What makes you think that $D$ didn't see $B$? They each list only two people, but that is not necessarily an exhaustive list of the people they see. – Ian MacDonald Apr 28 '15 at 19:51
  • @IanMacDonald If the list isn't complete, then this problem admits more than 1 solution. In my answer I assumed that the list was complete, but if it isn't so (the author should edit his question and clarify imo), then your answer is valid. – leoll2 Apr 28 '15 at 19:54
  • @leoll2 This is why there are two parts to the answer. The first part highlights $D$ as the culprit for simple vertex counting reasons. The second part highlights $C$ as the culprit in the case where the full graph is not necessarily outlined by the statements provided. – Ian MacDonald Apr 28 '15 at 20:30
  • If leaving out people is not considered lying, then any of them could be the culprit. If leaving out people you've seen is lying, then they could not all be in the library at the same time: D or E would have seen the other, yet didn't say so, so one of them must be the liar, but the same is true for B and C: contradiction. – Rick Sep 03 '15 at 19:52
9

To start: We need to define who was in together at the same time: We'll start off assuming everyone is honest and then look for contradictions.

The relations are as such:

AB, AD, AE, BE, BI, CD, CE, CI, DI, & EI

In all of these cases, at least one person claimed the other was there at the same time.

For the record, the missing relations are:

AC, AI, BC, BD, & DC

So with this information we can figure out who was supposed to be in at the same time. Since AB, AE, & BE are all present at the same time we can conclude that all three were there at (more or less) the same time for the purpose of creating a timeline. All the "combined" relations are:

ABE, AD, BEI, CDI, & CEI

Visually that becomes:

A ---|---|   |   |
B ---|   |---|   |
C    |   |   |---|---
D    |---|   |---|
E ---|   |---|   |---
I    |   |---|---|---

We can now attempt to organize this into a timeline. Since each person only entered once, each line should be intact. This is the best we can get:

A ---|---|   |   |
B    |---|---|   |
C    |   |   |---|---
D ---|   |   |   |---
E    |---|---|---|
I    |   |---|---|---

Ok, so the problem is obvious: We have a cyclical timeline. This timeline only makes sense if we turn it into a cylinder, because no matter how we attempt to put it together (on a straight 2D path) one of the lines is going to be at both ends of the graph without connecting all the way through. So now we can try to verify each of the above relations. We'll go in the order of the "corrected" graph, and we want to rely on cyclical relationships. In other words - 1 sees 2 who sees 3 who sees 1 because that confirms all three are there. Even if, say, 1 was lying, 2 confirms 3 and 3 confirms 1. Since there can only be one liar; 2 confirms themselves by being witness to 3.

AD: D sees A, but A does not see D. No one else is around to complete the circle. Unconfirmed.

ABE: E sees B, B sees A, A sees E (and also B). Confirmed.

BEI: E sees B, B sees I, I sees E. Confirmed.

CEI: C sees I, I sees E, E sees C. Confirmed

CDI: D sees I, I sees C, C sees D (and also I). Confirmed.

Interesting - only one unconfirmed. Also interesting is that we have a double confirmation (where 3 sees both 1 and 2) on either side of the unconfirmed relation.

So one unconfirmed means that that one (AD) has to be the false sighting - and since AD is D's claim - that makes Didier the dirty lying thief.

Go directly to jail!

  • Do not pass Go.
  • Do not collect $200.
  • Give the book back, jeez.
Alexander
  • 629
  • 4
  • 7
  • 1
    at least one person claimed the other was there at the same time. Please justify this statement. I see no reason in OP to assume that when A says he sees B and E, that he saw those two at the same time. Ie. it's possible that B and E was never in the library at the same time even if A tells the truth. – Taemyr Apr 29 '15 at 08:16
  • @Taemyr I did explain that. E sees B. I never said A seeing both means that they're both there at the same time. A seeing both means A is there at the same time E is there and A is there at the same time B is there. Only because E sees B does it mean that all three are there at the same time. The sentence you quoted refers to the box above it. – Alexander Apr 29 '15 at 13:30
  • It's possible that A was in the library at the same time as B without A seeing B. Thus A's statement may be a lie. Thus D seeing A may be true as it is not the only possible lie. – Rick Sep 03 '15 at 19:32
4

The Problem is ill Posed

If both person 1 states they see person 2 and person 2 states they see person 1 then they must have been in the library at the same time. This is true because at least one of person one and person 3 must be telling the truth as there is only one liar.

To move further we need to further define what it means to lie:

If lying by omission is not lying

In this case people are allowed to have seen people they do not mention without being considered liars. The only way to be considered a liar is to say you saw someone you in fact did not.

If this is the case then:

Any of them could be a liar.

First lets tabulate the statements, if the column header stated they saw the row header then I'll mark that intersection. If it was a corroborated sighting it is marked with an X, if it was a one directional sighting it is marked with a ?

  a b c d e i
a \ X   ?
b X \     ?
c     \   ? X
d     ? \
e ?       \ ?
i   ? X ?   \

From this we can see each person stated at least one uncorroborated sighting.

This means that any of them could be the liar: Everyone except the person the liar supposedly saw arrives. Then the liar leaves and the last person arrives. Now everyone would have seen everyone with the exception of the liar and the person they supposedly saw. Since the person they supposedly saw did not claim to see the liar, they did not lie. Thus everyone except the liar only told lies of omission and any of them could have done it.

If the whole truth and nothing but the truth is required

In this case we can make some more deductions.

If neither person 1 states they see person 2 nor person 2 states they see person 1 then either they must not have been in the library at the same time or one of them is the liar. This is true because if they were in the library at the same time at least one of them would have seen the other so then one of them must have omitted seeing the other and is thus lying.

The liar could have been there the entire time. The liar could just be lying by omission. As long as everyone else's testimonies are consistent this should be valid. This means that any consistent system of testimonies with 5 people could be valid with the 6th person being the liar that was there the whole time. Thus we can just examine each 5 person subsystem. Thus the analysis that follows excludes the liar from the the analysis, and anywhere is says people or person, this means truth telling people/person as the liar is excluded from the analysis.

First lets try the full system assuming no liar:

Assuming no lies then here is a table where an X indicates that the row header and column header were in the library at the same time, and a blank indicates they were never in the library at the same time (top half used only for clarity):

  a b c d e i
a \ X   X X
b   \     X X
c     \ X X X
d       \   X
e         \ X
i           \

Now if pair 1&2, pair 2&3, and pair 1&3, each have an X then 1,2, and 3 must have all been in the library at the same time. We know this must be true because none of them can reenter the library. WLOG 1 arrived first. 1 must not leave until both 2 and 3 have arrived. WLOG 2 arrives next. 2 must not leave until 3 has arrived. Thus when 3 arrives they will all be there.

There are no sets of 4 people where each pair of people has an X. Thus there was not a time when there were 4 people simultaneously in the library. This means that the periods where there were at least 3 people in the library were never interrupted by a forth person coming or going and can be considered one time unit. (Remember the caveat that the liar is excluded, so the liar my be present simultaneously with three truth tellers)

In the 6 person system there are 4 triplets:

library occupant triplets

ABE, BEI, CDI, and CEI

If these three triplets exist on the timeline then all of the X's involved with them will be satisfied. The remaining X's that need to be satisfied are:

  a b c d e i
a \     X  
b   \
c     \      
d       \
e         \  
i           \

AD. For each of these pairs (just one in this case) there must be a time period during which only the pair is in the library as none of these pairs is part of a triplet.

Thus a list of occupancies that must have existed at some point during the day are as follows: ABE, BEI, CDI, CEI, and AD

This can be visualized in tabular where the rows are people, the columns are time periods and an O indicates occupancy.

  1 2 3 4 5
a O       O
b O O
c     O O
d     O   O
e O O   O
i   O O O

To be a solution the time periods would need to rearrange so that each person occupied the library only during consecutive periods. As expected these periods cannot be arranged in such a manner. Proof for those interested otherwise skip to the next section:

For i's visit to be consecutive periods 2, 3, and 4 must be next to each other. withing that span 2&4 and 3&4 must be consecutive for e and c respectively. That only allows the order 2, 4, 3 or its reverse:

  1 2 4 3 5
a O       O
b O O    
c     O O
d       O O
e O O O
i   O O O

For d to be consecutive 5 must be consecutive with 3, and for e and b to be consecutive 1 must go next to 2, but for a to be consecutive 1 must go next to 5 which is impossible. Thus indeed someone must be lying.

The Possibilities

A lied

Following the same logic as the previous example we can construct tables without A (s A could have been there the whole time if they're lying, This really boils down to removing A from the final period table:

  2 4 3
b O
c   O O
d     O
e O O
i O O O

This is a legitimate possibility. A could be the culprit. Here's a diagram of the library occupancy including who saw who when. Note that A did not see B despite saying they did, whereas everyone else saw only who they said they saw, and no two people were in the library at the same time without one of them seeing the other. Library Occupancy Liar A

B lied

  1 4 3 5
a O     O
c   O O
d     O O
e O O
i   O O

Again not possible

C lied

  1 2 3 5
a O     O
b O O
d     O O
e O O
i   O O

Again not possible

D lied

  1 2 4
a O
b O O
c     O
e O O O
i   O O

This scenario is also possible so D could be the culprit:Library Occupancy Liar D Note: that here D said they saw A but they instead saw E. This Solution allows for everyone to see exactly 2 people, which is slightly more in line with the problem statement, so if the problem statement was modified to state that each person saw exactly two people then D would have to be the culprit as if A was the liar they would see a minimum of three people.

E lied

  1 2 3 5
a O     O
b O O
c     O
d     O O
i   O O

Again not possible

I lied

  1 4 3 5
a O     O
b O
c   O O
d     O O
e O O

Again not possible

Conclusion

This problem has two solutions as stated, but could be easily modified to eliminate A as the culprit by stating that each person saw exactly two other people in the library. In that case D is the culprit. Another modification/interpretation that some people took and would result in the same conclusion: The lair included no truth in their statement while the honest students stated the whole truth and nothing but the truth (but this makes the puzzle much easier, and relies on using two different definitions of lying). Yet another modification would be to state that no one, including the liar, saw anyone that they didn't claim to see.

Rick
  • 342
  • 1
  • 6
  • You yourself said that there can't be 4 people in the library at once. Thus, your scenario for A being the liar can't work because the graph requires 4 people at once twice (ABEI, ACEI). – ErikE Feb 06 '16 at 01:29
  • @erik that was in the section where I was under the assumption that there was no liar. When there is a liar, the liar can be present during any of the times where there are three other people in the library without invalidating anyone else's testimony. – Rick Feb 07 '16 at 05:30
  • But the OP says there is one liar... I don't understand why you'd entertain any other scenario. – ErikE Feb 07 '16 at 05:47
  • Your final answer is that "the problem has two solutions as stated". This is what I'm taking exception to. Do you still maintain this? You say, "This is a legitimate possibility. A could be the culprit." But according to your own logic, A can't. There is nothing in your answer that eventually disclaims A as a valid answer with the rules as given. – ErikE Feb 08 '16 at 17:01
  • @ErikE According to my own logic it certainly can... If you take the paragraph "There are no sets of 4 ... can be considered one time unit." and substitute "truth telling people/person" in for "people/person" it is now more obvious that my logic still holds. from the statement "First lets try the full system assuming no liar:" onward, all of my systems ignore the liar as if they didn't exist. So "people" doesn't include the liar. and thus there are three "people" in the library while ABEI and ACEI are in the library because for the analysis of whether A could be lying, A is not considered. – Rick Feb 09 '16 at 15:54
  • Have you read your final paragraph, the "Conclusion"? It says that to eliminate A, the problem has to be modified. You aren't listening! I am agog at your responses given their apparent variance from the wit that let you do such a good, though slightly flawed, analysis. – ErikE Feb 09 '16 at 16:07
  • @ErikE I have read my conclusion and I still believe that as written the problem statement has two solutions A, and D. You seem to object to my analysis of the situation where A is the liar. I was attempting to explain why your objection was not valid, as I do not see a contradiction between "there are never more than 3 truth telling people in the library simultaneously " and ABEI or ACEI being in the library simultaneously. – Rick Feb 09 '16 at 16:16
  • @ErikE I've edited to attempt clarification. Hopefully, it will be easier to follow now. – Rick Feb 09 '16 at 16:38
3

Note: this answer assumes that a truth-teller says ALL the truth, without omitting information.

The symbol $X-$>$Y$ means that $X$ saw $Y$. We know that:
$A-$>$E$
$E-$>$C$
$C-$>$D$
$D-$>$A$
Which means that $A,B,C,D$ were all in the store at a certain moment. Though, there isn't any edge (graph edge, I mean) between $A-C$ and $E-D$, which should be mandatory if they're all telling the truth. Therefore, the liar is $A,C,D$ or $E$.
B and I are honest.

Suppose $C$ liar. We have a triangle between $A-B-E$, which means that they were together at some point. We also have the triangle $I-E-B$, but we don't have a tie $A-I$, meaning that there's a moment when $B$ was inside the shop and either $I$ or $A$ had already left it, while the other (of $A$ or $I$) hadn't entered yet. If so, how is it possible that $D$ saw $A$ and $I$ without seeing $B$? Impossible! Therefore, C is truth-teller.

Suppose $E$ liar. We know that $A$ and $I$ are never together. $D$ saw both $A$ and $I$ , $B$ saw both $A$ and $I$ too, so how is it possible that $B$ and $D$ weren't together? Impossible! Therefore, E tells the truth.

Suppose $A$ liar. $B$ and $C$ didn't meet. $E$ has seen both $B$ and $C$, meaning that $E$ was present when one had left and the other had yet to enter. D was intermediate between $B$ and $C$, despite not meeting $B$, because he has seen $A$ (who was seen by $B$). So, how is it possible that $E$ and $D$ never met? Impossible, so $A$ tells the truth.

The liar is $D$. This is a scheme of compatible timings. The time is represented on the horizontal axis. People that share points with the same abscissa were together in the library, of course. enter image description here

leoll2
  • 12,590
  • 3
  • 39
  • 83
  • How can you make the statement that "E tells the truth" and then declare that the liar is E? Is one of those meant to be D? – Bailey M Apr 28 '15 at 19:22
  • @BaileyM Exactly, I've edited! I hope that it was the only wrong miswritten letter – leoll2 Apr 28 '15 at 19:24
  • I get the feeling you're falling into the same trap I originally fell into. – Spacemonkey Apr 28 '15 at 19:32
  • @Spacemonkey Explain? Does my picture conflict with any of the statements? – leoll2 Apr 28 '15 at 19:33
  • I can try, this thing is making my head dizzy, lol – Spacemonkey Apr 28 '15 at 19:34
  • Using those 5 impossibilities I'm coming to the same conclusions as you but the graph isn't correct or rather, it's implying something that isn't wrong. There is no reason for D to overlap with E. D is lying because he can't have seen A, that's all. Either the D bar should end before E's or it should end at A. – Spacemonkey Apr 28 '15 at 19:44
  • @Spacemonkey I'm not saying that my picture is the only possible representation, there are several compatible others, assuming that D is lying. To prove that my solution is wrong, you must provide a counter-example, namely a picture where the liar isn't D and the timings are compatible with the statements. – leoll2 Apr 28 '15 at 19:49
  • What I meant is that the only reason D would be overlapping E is to be overlapping from C (because he's seen) to A, if you dont extend his line to A there is no point in making him overlap E, (the overlap being the proof of him being lying). So he's either lying because he did not see A (line ends before E line starts) Or he's lying because he did not see a third person , E (line goes from C to A). It's whats missing from your graph, and not your explanation. Additionaly its D because otherwise its both E and B that are lying and there is only one liar. – Spacemonkey Apr 28 '15 at 20:19
  • D was intermediate between B and C this is not necessarily true if A is lying. See my answer. – Rick Sep 03 '15 at 19:01
3

The problem is ill-posed.

The liar must be one of A or D, but there is a consistent scenario where A lies and everyone else tells the truth, as well as a consistent scenario where D lies and everyone else tells the truth.

First scenario:

A enters at 7:00 AM, I enters at 8:00 AM, B enters at 9:00 AM, E enters at 10:00 AM, B leaves at 11:00 AM, C enters at 12:00 PM, E leaves at 1:00 PM, D enters at 2:00 PM, C leaves at 3:00 PM, D leaves at 4:00 PM, I leaves at 5:00 PM, A leaves at 6:00 PM. A is the only liar: the truth is that A saw everybody.

Second scenario:

D enters at 7:00 AM, E enters at 8:00 AM, C enters at 9:00 AM, I enters at 10:00 AM, C leaves at 11:00 AM, B enters at 12:00 PM, I leaves at 1:00 PM, A enters at 2:00 PM, B leaves at 3:00 PM, A leaves at 4:00 PM, E leaves at 5:00 PM, D leaves at 6:00 PM. D is the only liar: the truth is that D saw everybody.

Whittling down the suspects:

Say that suspects X and Y are "connected" if one of X or Y claims to have seen the other. Define a 4-cycle to be a four-tuple of suspects (X,Y,Z,W) such that X is connected to Y, Y is connected to Z, Z is connected to W, W is connected to X, X is not connected to Z, and Y is not connected to W. If (X,Y,Z,W) is a 4-cycle, then it is pretty easy to see that at least one of X,Y,Z,W must be lying. Using the 4-cycle (A,B,I,D) we see that one of A,B,I,D is lying, and using the 4-cycle (A,D,C,E) we see that one of A,D,C,E is lying. Thus the liar is either A or D.

There is a hidden symmetry in the problem:

The connection graph described earlier is symmetric under the permutation (AD)(BC)(EI).

zeb
  • 1,093
  • 7
  • 12
  • The fact that two people are in the library at the same time doesn't necessarily imply that they both saw each other. Thus the flaw in your first scenario is your assertion that the proposed liar saw everybody. It's possible that he only saw the two people he claimed to have seen, and thus is telling the truth. – glibdud Apr 29 '15 at 15:55
  • Actually, your second scenario has the same flaw, though it's closer to the right order of events. – glibdud Apr 29 '15 at 17:12
  • @glibdud In Senario 1 while it's true that A did not necessarily see everyone they must have seen those that did not see them as :If two persons were in the library at the same time, at least one of the two saw the other and thus A must have seen C,E, and I but did not state seeing C or I and thus lied by omission. – Rick Sep 03 '15 at 14:38
2

I believe the "correct" way to do this is to start by determining which groupings are certain. (I'm certain it's correct, but I don't know if it's how they expected it to be done)

We can quickly identify two pairs of people who definitely saw each other.

  • Albert and Bernard both saw each other.

  • Charlotte and Isabelle both saw each other.

This means these two pairs must have happened.

Now, we also have that Albert saw Edouard, who saw Bernard. This indicates that Edouard was present with at least one of the two, as Albert and Edouard can't both be lying.

Similarly, Isabelle saw Edouard, who saw Charlotte, so Edouard was present with at least one of the two, as Isabelle and Edouard can't both be lying.

We also have that Isabelle saw Edouard, who saw Bernard, who saw Isabelle. These three must be together, as only one can be lying, which still ties all three into the same group.

Finally, we have Isabelle saw Charlotte, who saw Didier, who saw Isabelle. Again, only one can be lying, so these three were present together.

So we have (ABE), (BCI), (CEI), and (CDI) as certain to be present in their respective groups.

This leaves just one claim unaccounted for. Didier claimed to be present with Albert. This is the only claim not corroborated by anybody else, directly or indirectly, and therefore must be the lie.

To solve this more easily, I drew up the claims as a directed graph, and then looked for loops within the graph. If three people formed a loop, they corroborate each other's claims. The only claim not part of a loop is Didier claiming to have seen Albert.

To be clear, methods based on working out timelines are problematic, as they require assumptions about sequences, whereas the above is purely about requiring that there be only one liar.

psmears
  • 1,470
  • 1
  • 8
  • 9
Glen O
  • 5,033
  • 1
  • 16
  • 31
  • 1
    As the question was from a CS exam, I feel like this solution is an appropriate one. I had a similar puzzle on my algorithms & data structures exams. – Fodder Apr 29 '15 at 04:38
  • 1
    "Finally, we have Isobelle saw Charlotte, who saw Didier, who saw Isobelle. Again, only one can be lying, so these three were present together." You have to consider the timelines. Isabelle enters, Didier enters, Isabelle leaves, Charlotte enters. Only one is lying, but Isobelle and Charlotte was never present at the same time. (This sequence might be contradictory to other statements made; I only try to point out that your inference is invalid) – Taemyr Apr 29 '15 at 08:22
  • @Taemyr - the sequence I did it in was relevant. Charlotte and Isabelle saw each other. Albert and Bernard saw each other. The rest depends on those two. – Glen O Apr 29 '15 at 08:37
  • Fair enough, although not sufficient. Charlotte enters, Isobelle enters, Charlotte leaves, Didier enters. Only one lie, Charlotte and Didier was not present at the same time. – Taemyr Apr 29 '15 at 08:41
  • @Taemyr - I realise it sounds a little vague, but what I meant by "present together" was "there was a continuous period, during which at least one of the three was present at any point in that period and all three were present at some point in that period". It indicates that any timeline must have those three in a "group". – Glen O Apr 29 '15 at 08:54
  • In that case I would say something like "The period when at least one of those is contiguous" – Taemyr Apr 29 '15 at 08:59
  • You did not consider A) lies of omission where person 1 saw person 2 but didn't state they saw them. B) Person 1 lying about seeing person 2 when in fact they were in the library at the same time, but it just so happens that person 1 didn't see person 2. With these new considerations D seeing A is no longer the only possible lie, and thus may be true. However, I believe this is the intended answer. – Rick Sep 03 '15 at 18:53
  • @Rick - if someone is only lying by omission, then there's literally no way to determine it. Since a lie by omission isn't an actual lie (as in, a false statement said knowingly), I think it's reasonable to assume that the relevant lie, here, is a direct lie. And the key is that none of the other statements are lies, since they're corroborated by others in one way or another. So it doesn't depend on whether the person "happened" to see another person, only on verifiable facts. – Glen O Sep 04 '15 at 05:53
  • @GlenO You're arguing on both side for what a lie is... Your first sentence is saying that lying must include lying by omission in order for the puzzle to work, but your second and third statements say that lying by omission isn't enough to be considered lying. Are you using two standards for lying in the same puzzle? – Rick Sep 04 '15 at 11:43
  • @GlenO A seeing B cannot be verified. A being in the library at the same time as B can be. If A never saw B then A would be telling a direct lie. This satisfies the constraints of the puzzle as per my answer. – Rick Sep 04 '15 at 11:47
  • @Rick - my first sentence is saying that lies by omission can't be detected, so we can't solve the problem if we do include it. Therefore, we can't include it. It's consistent with the other sentences. And A seeing B can't be directly verified, but we have enough evidence to call it verified - that is, it's consistent with reality (A was in a position to see B). Again, it's something we can't actually detect (they said they saw them, but didn't really, thus a lie, but they could have seen them if they looked). Given the puzzle's conditions, we can be pretty confident. – Glen O Sep 04 '15 at 13:24
  • @GlenO but lies by omission can be detected: If three people had to have been in the library at the same time (by other peoples testimonies), but person 1 doesn't include seeing person 2, or 3 in their testimony, and neither person 2, nor 3 includes seeing person 1 in their testimony, then person 1 is lying by omission. – Rick Sep 04 '15 at 13:41
  • @GlenO the deffinition of lying I used for my analysis is: A person is lying iff they claimed to have seen someone they did not see, or they do not claim to see someone they did see. What definition did you use? – Rick Sep 04 '15 at 13:45
  • @Rick - how can you tell whether they were lying, rather than just having failed to see the other people? And my definition of lying is "knowingly making a false statement". Saying "I saw A and B" when you saw A, B, and C isn't a lie. To make it a lie, you'd have to say "I only saw A and B". By leaving out information, you are making an incomplete statement, but that's not a lie. – Glen O Sep 04 '15 at 14:11
  • Because If two persons were in the library at the same time, at least one of the two saw the other. Using your definition, any of them could be the culprit, see the first section of my answer. – Rick Sep 04 '15 at 14:14
  • @Rick - this is getting tiring, so I'll just say that your reasoning is flawed. You're also confusing the statement that "a lie by omission is not a lie" with "they may have made a lie by omission only". While Didier may have lied by omission, there is no need for him to have done so, as his actual lie is a lie, and removing his actual lies is enough to make the entire thing consistent. Charlotte was the only one that saw Didier, and then Didier was alone after Charlotte left (or equivalently, Didier was alone before Charlotte arrived). That was when he stole the book. – Glen O Sep 04 '15 at 15:51
  • @GlenO My reasoning is irrelevant.There is a solution consistent with the problem statement where Albert is the liar (see my answer). Thus your reasoning that eliminated Albert is flawed. (I know your solution is consistent as it's also a solution in my answer) – Rick Sep 04 '15 at 16:39
  • @Rick - Your "additional" solution isn't consistent. Albert would have to lie about having seen Bernard, despite being there when Bernard was, for no reason. Furthermore, it requires that neither Albert nor Isabelle mention seeing each other, despite both being there for the entire time, and that Albert and Charlotte also saw each other without mentioning each other. While it may not be explicitly inconsistent with the "rules" of the question, it's inconsistent with the context. The lie is to cover up the theft of the book. When do you assert Albert stole the book, and how do his lies cover? – Glen O Sep 04 '15 at 16:50
  • inconsistent with the "context"? If the "context" requires the lie cover up the theft of the book how does Didier's lie manage this? It would only indicate being there longer, increasing the number of chances to steal the book, while Albert's lies of omission attempt to show not being in the library and in fact succeeded at shifting the blame to Didier. Thus if examining the "context" of the problem is important to the solution Albert is definitely the thief. – Rick Sep 04 '15 at 17:06
  • Oh, and he could have stolen it first thing in the morning before anyone else arrived, and then hid semi successfully all day until passing Didier on the way out, knowing that Didier was the last one in the library he can easily place doubt on his testimony by not including anyone later in the day. Lying about seeing Bernard placed Albert in the library in the morning, making it less likely that Didier would have seen him, placing further suspicion on Didier. – Rick Sep 04 '15 at 17:17
  • Or, even better Albert could have made himself visible in the morning so people would know he was there in the morning. Then hide during the day, spying on people through the stacks, until only Didier was left. Then he steals the book, and walks out right in front of Didier. That way if they somehow know when the book was stolen it would implicate Didier. Then when Albert hears that Bernard was there in the morning he lies saying he saw him so that it further corroborates his story. – Rick Sep 04 '15 at 17:25
  • Point is, both answers are consistent with the rules as stated, and if you're going to add in extra criterion to fully define the problem, then the criterion should be verifiable like "each person only saw two other people". – Rick Sep 04 '15 at 17:30
  • @Rick - Didier claims to have seen Albert, which is an attempt to suggest that he was there at a different time than he was. The only person who saw him was Charlotte, which implies that he was either the first or last person there, and thus had an opportunity to be present in the Library alone. This doesn't mean that Didier was the only one with the opportunity, but that Didier lied to make it look like he didn't have the opportunity. Albert "lying" to imply that he wasn't there all day, by saying he saw someone he didn't see, but could have, doesn't make sense. – Glen O Sep 05 '15 at 04:38
1

This problem is actually underdetermined. Credit goes to Mark N for the idea of everyone entering the room at the same time


Counter-example: Everyone enters the room at the same time.

Solution 1: Albert is the liar

Albert can claim that they didn't see Bernard even if Bernard was in fact there. As long as Bernard claims that they saw Albert, this follows the rule that one of them saw the other.

Solution 2: Bernard is the liar (similar argument)

Bernard can similarly claim that they didn't see Albert even if Albert was in fact there. As long as Albert claims that they saw Bernard, this follows the rule that one of them saw the other.


Since we have arrived at two valid solutions, this is an underdetermined system.

Allan
  • 642
  • 3
  • 13
  • 2
    All this proves is that it is certain that everybody was NOT in the room at the same time. There is no valid solution in this case, because there must be multiple liars. For example, neither D nor E claims to have seen the other. If they were truly in the room at the same time, then one of them DID see the other, according to the question, so one of them must be lying about not seeing the other. Since the same goes for A & I and B & C, there is no case where only one person is lying, so this scenario does not fit the question. – Hylianpuffball Apr 29 '15 at 12:11
  • If everyone arrived at the same time then either D or E would have seen each other but neither stated as much, in this case one of them would be lying by omission. Similarly, with B and C. Thus if omitting people seen is considered lying, then not everyone could be in the library at the same time. – Rick Sep 03 '15 at 18:24
0

These are the only absolute statements I've arrived to:

The following are never inside the library at the same time::

A and C
A and I
B and C
B and D
D and E

Spacemonkey
  • 3,144
  • 14
  • 35
0

I feel like the answer may be that...

Bernard is the culprit.

Why?

There exists a little inconsistency between people seen.
Let's draw these reports out:
B -> AI
D -> AI
C -> DI
A -> BE
E -> BC
I -> CE

This leaves us with the following.

Albert, Bernard, Charlotte, and Edouard were all seen twice.
Isabelle was seen three times.
Didier was seen once.

Given this information,

Say Bernard saw Didier instead of Isabelle. We get the following:
B -> AD
D -> AI
C -> DI
A -> BE
E -> BC
I -> CE

This evens everything out, with Didier and Isabelle now being sighted twice each.

Therefore...

It can be concluded that Bernard lied about seeing Isabelle.

EnragedTanker
  • 239
  • 1
  • 4
  • 1
    Equity in sightings would be nice, but there's no reason that prevents someone from being seen by multiple people. – Alexander Apr 28 '15 at 22:48
0

-> is saw; <- is seen
A -> B E
B -> A I
C -> D I
D -> A I
E -> B C
I -> C E

A <- B D
B <- A E
C <- E I
D <- C
E <- A I
I <- B C D

The thief lied, so that means the thief claims he saw someone when he didn't. That means the thief saw 1 or 0 people. Conversely, only 1 person at most could have seen the thief. Therefore, since D is the only one seen by 1 person or less, D must be the thief.

  • Why couldn't the thief see 2,3,4 or 5 people? If they are lying they could leave out people they did see too. – Rick Sep 03 '15 at 18:15
  • Why couldn't more than one person see the thief? – Rick Sep 03 '15 at 18:17
  • Because everyone claims to have seen more than one person and one of them has to be lying (specifically, the problem says that everyone but the liar must be telling the truth)? – Kingrames Sep 03 '15 at 18:36
  • Why couldn't the liar have seen people they didn't claim to have seen? – Rick Sep 04 '15 at 14:27