King Octopus has servants with six, seven, or eight legs. The servants with seven legs always lie, but the servants with either six or eight legs always tell the truth.

One day, four servants met.
The blue one says, “Altogether, we have 28 legs.”
The green one says, “Altogether, we have 27 legs.”
The yellow one says, “Altogether, we have 26 legs.”
The red one says, “Altogether, we have 25 legs.”

What is the colour of the servant who tells the truth?

  • 199
  • 1
  • 12
  • 2,215
  • 2
  • 16
  • 26
  • @Lucian Ummm... That sentence is asking "1) find the servant that says the truth, and 2) what is the color of that servant?" It isn't asking for the color of the truth that is being said. – apnorton Feb 15 '14 at 21:08
  • 14
    I like the question "How many legs do the servants have altogether?" better, since it doesn't give away that exactly one is telling the truth. – Little Endian Feb 16 '14 at 00:12
  • 11
    If you enjoyed this puzzle, may I shamelessly plug [the _Puzzling_ proposal in Area51](http://area51.stackexchange.com/proposals/45128/puzzling?referrer=efQ1HzGsk1B6r0scMpascg2)? – IQAndreas Feb 16 '14 at 04:46
  • 11
    I can see what color they are, but I can't count their legs? – Russell Borogove Feb 16 '14 at 22:13
  • 4
    @RussellBorogove Count the legs? [Good luck.](http://i.stack.imgur.com/dbB1s.gif) – wchargin Feb 17 '14 at 00:32
  • 2
    IRL, octopodes never tell the truth. Just so everyone is clear and so no one tries questioning one. :) – haneefmubarak Feb 17 '14 at 09:42
  • 1
    Is an Octopus with six legs a Hexopus? – JamesRyan Feb 17 '14 at 11:45
  • 3
    @haneefmubarak: Some [octopeds](http://en.wikipedia.org/wiki/Paul_the_Octopus) do tell the truth :) – oerkelens Feb 17 '14 at 12:15
  • 9
    @thethuthinnang Not much difference: with four different answers, obviously only one can be telling the truth. – Sebastian Redl Feb 17 '14 at 18:00
  • 2
    @SebastianRedl No, thethuthinnang is right. It's better to let the listener come to the realization that only one can be telling the truth, even if it's a minor matter to deduce it. – David Conrad Feb 18 '14 at 19:44
  • 2
    and anyway it's not obvious that **there is** one octopus telling the truth, they might all be liers :-) – mau Feb 19 '14 at 08:23
  • 1
    @SebastianRedl: More accurate to say: "With four different answers, obviously **at most** one can be telling the truth." Which is a rather different statement... – Nemo Feb 19 '14 at 17:59
  • 1
    @mau If none of the servants are telling the truth then each of the four have seven legs, in which case, there are a total of 28 legs, making the blue servant's statement true, which contradicts the assertion that none of the servants are telling the truth. – John Joy Nov 12 '14 at 15:04
  • @AbleArcher even with that, you still know exactly one is telling the truth, because there are 4 different values, and only one of them can be the correct value! – klorzan Jan 11 '19 at 16:07
  • This is a duplicate of this puzzle : https://puzzling.stackexchange.com/questions/85579/robots-in-a-spaceship – Hemant Agarwal Sep 21 '20 at 18:28

12 Answers12


Hint: since they all disagree, at least three are lying. How many legs does that account for?

Ross Millikan
  • 362,355
  • 27
  • 241
  • 432
  • 6
    Awesome hint...(+1)...I really was confused about this one – Hawk Feb 15 '14 at 16:17
  • Very nice hint! – ShreevatsaR Feb 15 '14 at 17:04
  • 4
    And additionally, exactly three lie, since the question asks about the truth teller. – nbubis Feb 15 '14 at 23:03
  • 9
    @nbubis that is irrelevant, since if all 4 were lying, there would be exactly 28 legs, which is what the blue one said, which means the blue one was not lying, which means only 3 were lying... – AviD Feb 16 '14 at 12:12
  • Or to restate the point another way 28 legs would require the blue octopus to be both telling the truth and have 7 legs and we are told that 7 legged Octopuses always lie. – Martin Smith Feb 16 '14 at 15:35
  • @AviD: why is nbubis' statement irrelevant? Just because the same information can be inferred by a different path? – LarsH Feb 18 '14 at 14:28
  • @AviD: by definition, a hint is a statement giving information that could already be inferred from information already given. So, how can any hint not be "irrelevant" in this way? In other words, I don't see how nbubis' statement is less "relevant", or less "additional", than Ross's. – LarsH Feb 18 '14 at 14:48
  • @AviD: the puzzle can be solved without knowing that at least one tells the truth, and the comments to another answer suggest a way to reword it so you are not given that information. The way it is worded does tell you that. I think one is free to use that information. – Ross Millikan Feb 18 '14 at 15:01
  • 3
    I'm no longer voting via my iPad. I'm sorry I am the DV, by accident of course, and unlike typos, I can't reverse, unless answer is edited. Not the first time this has happened. – JTP - Apologise to Monica Feb 18 '14 at 15:04
  • 1
    @JoeTaxpayer: No problem, it happens. – Ross Millikan Feb 18 '14 at 15:10

Well The Green one?

Since the four are disagreeing then $3$ must be lying. Since only octopuses with 7 legs lie then there must be $7\times3 = 21$ legs.

That leaves the honest octopus with either $6$ or $8$ legs. So the total number of legs should either be $21+6= 27$ legs or $21+8=29$ legs.

Since no one says that they have $29$ legs then only the Green octopus is saying the truth.

It seems to be simple unless I missed something in the riddle.

Felipe Jacob
  • 2,306
  • 17
  • 32
  • 541
  • 5
  • 7
  • 25
    (To be picky, the servants are not necessarily octopuses...) You can also solve the problem without assuming there is an honest servant among the four, because if all four were lying, there would be $28$ legs, and the blue one couldn't be lying. – Steve Kass Feb 15 '14 at 20:28
  • 2
    To be even more picky, the servants didn't say if "altogether we" included the Octopus King or not, and if they did, how many legs the King had. – Mr Lister Feb 16 '14 at 15:17
  • 3
    @MrLister well if you are going to be really picky, they don't specifically say that they are talking about their own legs. They could be talking about frog legs they are preparing for the king to eat... – Michael Feb 18 '14 at 20:55

This is more fundamental than it seems. The way the octopod nervous system works is different from ours. They have no body image, and their legs send no signals back to their brain. So an octopus can only know how many legs other octopuses have. So they can only be sure about what the others say. This means that the only octopus who can have an accurate picture is the one with the most information - the red octopus.

As has been pointed out, the only option with one true answer is 3*7 + 1 * 6.

The first three octopuses don't know how many legs they, in fact, have, but the fourth octopus knows that the green one has six legs, and sees that the other two have seven, so he knows that there he has seven legs, so he knows he has to lie.

The only octopus that knows the truth is the red one, so the only octopus that actually lies is the red one. The other three do their best, but they cannot know the truth.

Peter Brooks
  • 369
  • 2
  • 7
  • You mean the first one, who sees a total of 20 legs on the others, guesses that he himself has 8 legs and so says 28, because that would have been the true answer if he did have 8 legs? Yes, makes sense. – Mr Lister Feb 17 '14 at 10:45
  • 2
    Why wouldn't an Octopus simply be able to see how many legs they have? – Martin Smith Feb 17 '14 at 12:08
  • They can only see two or three legs if they are in front of their eyes. They have no direct control over their legs, so it isn't clear that they can move their legs in front of their eyes, and they don't have mirrors. – Peter Brooks Feb 17 '14 at 12:56
  • @PeterBrooks - Googled it. Found [Octopuses capable of hand-eye coordination](http://www.cosmosmagazine.com/news/octopuses-capable-hand-eye-coordination/) but does sound pretty limited. – Martin Smith Feb 17 '14 at 13:32
  • 6
    "So an octopus can only know how many legs other octopuses have." Since we've suspended reality enough to have talking octopusses, who's to say these four haven't asked a truth-telling companion how many legs they have... – Julia Hayward Feb 18 '14 at 13:30
  • 1
    This answer might ought to be labeled as a "what-if" scenario, as opposed to "the answer", so as not to confuse the unwary... – LarsH Feb 18 '14 at 14:30
  • Did it hurt the truth-telling octopi when they lost their eighth leg? – Laurent LA RIZZA Feb 18 '14 at 15:55
  • @Julia-Hayward your remark slays me! – smci Feb 19 '14 at 11:47
  • Believing that there'd be such a thing as a 'truth telling octopus' is stretching credulity too far. How could you believe that an octopus, no matter how polite and moral, always tells the truth? Is it actually possible to tell the truth all the time? – Peter Brooks Oct 23 '14 at 22:52

The Red one ;)

To see this, let's analyze a why the 6, 7, and 8-legged octopuses behave the way they do. Clearly it is because the punishment for lying is amputation of a limb for subservience. This perfectly explains why 7 legged octopuses lie and the others tell the truth.

To explain, given the fact that 6 legged octopuses never lie, this is obviously because they have learned from experience the dire consequences of lying and will never repeat that mistake again. 8-legged octopuses, on the other hand, have the reputation of perfectly honest citizens and thus retain the highest honor. They are afraid to lose that honor in the Octopus's Garden, and thus want to keep it that way. However, 7-legged octopuses are always pre-judged as liars, and thus are treated the worst. Thus, in order to be elevated to second-class 6-legged citizens, they always lie to get one of their legs chopped off.

Thus, the meeting went something like this with the missing information added:

One day, four servants met.
The blue one says: "Altogether we have 28 legs";
  - One of his 7 legs is immediately amputated for lying
the green one says: "Altogether we have 27 legs";
  - One of his 7 legs is immediately amputated for lying
the yellow one says: "Altogether we have 26 legs";
  - He lies, and the amputator raises the axe, but before he can speak, 
the red one quickly says: "Altogether we have 25 legs".
  - He tells the truth, and keeps his 6 legs.
  - The axe completes it's ark, amputating the 7th leg of the yellow octopus
  • 1,559
  • 1
  • 9
  • 15
  • 2
    Yeah, I thought the "green" answer seemed too easy. Thanks for uncovering the real truth of the matter! – Richard Venable Feb 17 '14 at 23:08
  • I suppose allowing self-amputating octopi after they make their statement adds new dimensions. But who said they lose precisely one leg for lying? – smci Feb 19 '14 at 11:50
  • Very interesting logic, but you fail to account for the possibility that one or more of the octopuses had changed color (as octopuses, squid, and cuttlefish are known to do) after making its statement. ;) – John Joy Nov 12 '14 at 15:22

If all are liars then they are all 7 legged and the total number of legs would be 28. As the blue octopus says the total is 28 this a contradiction. Therefore at least one is telling the truth.

If at least 2 are telling the truth then there should be at least 2 answers the same. Since there are no same answers therefore only one can be telling the truth.

With one telling the truth which is either 6 or 8 legged and 3 liars, if there are 29 legs then the 8 legged octopus is telling the truth but since there is no 29 legs answer then the green 6 legged octopus is telling the truth.

  • 91
  • 3

the green one says: "Altogether we have 27 legs";

3*7 + 1*6 its the only combination where only one is telling the truth ... if all otheres have 7 legs, they will lie and thus green tells the truth ....

  • Impossible. 8 + 6 would mean that 2 ppl tell the trueth, thus you would create a contradiction ... you can only have 1 who tells the truth and need 3 that a lying .. thus 3*7 + 1x = 25,26,27 or 28 where x can be 6 or 8 ... and so only 6 is valid for x ... its only 1 solution possible .. and thats it :) – Benjamin Eckstein Feb 16 '14 at 14:09

The Green Hexa-pus is telling the truth.

First we will figure out how many are telling the truth:

If there is more than one octopus telling the truth we would have 2 or more octopi with the same answer for the number of legs.

If they are all lying then they either have a combination of 6 or 8 legs. Which means that there could only be 24, 26, 28, 30, or 32 legs. Looking at the answers, we can see that if they are all lying they would not mention 26 or 28 legs. Hence only one octopus is telling the truth.

This leaves one possibility: One octopus is telling the truth!

Now that we know that only one octopus is telling the truth. We find out which one! We start by assuming if one octopus is telling the truth or not and then prove or disprove that claim.

So lets say blue is telling the truth: so the blue one has either 6 or 8 legs. And each of the other octopus is lying hence has 7 legs. So our total legs becomes: 6 + 7 + 7 + 7 = 27 legs or 8 + 7 + 7 + 7 = 29 legs. But since blue says "28 legs", it contradicts the two possibilities of 27 and 29 legs hence he is lying.

Similarly for yellow and red, the leg combination possible would be 27 or 29, but they said 26 and 25. Hence they are lying.

The green octopus is the only one who gets the correct combination of legs hence he is telling the truth. The Green Octopus has 6 legs and the other three have 7 legs each.

  • 263
  • 3
  • 11
  • 1
    But you had to assume a priori that only one octopus was telling the truth, which loses generality. Gotta show where you pulled that assumption out of :) – smci Feb 19 '14 at 11:52
  • @smci Thanks! Figured out that only one can be telling the truth. – stackErr Feb 19 '14 at 16:45

The green one is telling the truth. We know this because all of them gave different numbers which means that three out of the four servants are lying because only 1 total number of legs can be correct. So, since all 7 legged servants are liars, and we know 3 are lying, we multiply 7 * 3 and get 21. So 3 out of the 4 servants there have a total of 21 legs. The only options are 28(blue),27(green),26(yellow), and 25(red) so we know the red one is lying because the difference between 21 and 25 is 4 and there are no 4 legged servants. There are also no 5 legged servants so the yellow one is lying too. And the difference between 21 and 28 is 7, that would mean that they were all liars which isn't true. So Green is the only one left. The green is telling the truth and has 6 legs.

  • 43
  • 5

The green one.

They already did the math, I only wanted to answer these:

  1. You can also solve the problem without assuming there is an honest servant among the four, because if all four were lying, there would be 28 legs, and the blue one couldn't be lying. – Steve Kass yesterday

    • If all four were lying, then blue wouldn't be saying 28 because he'd be then saying the truth, which it isn't supposed to be because servants with 7 legs always lie.
  2. To be even more picky, the servants didn't say if "altogether we" included the Octopus King or not, and if they did, how many legs the King had.

    • The riddle said that four servants met. It didn't say that the four servants met with the king. But to answer your question, the King Octopus probably has 8 legs, given that it is an octopus. Unless, royalty grants an extra leg.
Lendl Leyba
  • 111
  • 1

The green one is telling the truth. First of all if they all were lying, they would have 28 legs (7*4) and none of them would say "Altogether we have 28 legs", so at least one of them must be telling the truth. As each of them says something different, 3 of them must be lying and one is telling the truth. the 3 liars have 21 legs altogether (each of them must have 7 legs as it is a liar). Then we can rule out 25 or 26 legs (no octopuses have 4 or 5 legs). We can rule out 28 too, because this would mean that all of them have 7 legs, so the only possibility left to us is 27 legs -> green octopus.


I always like to write a little Python program to test my assumptions.

Here is what I came up with (pretty much follows exactly Songo's approach that he has written out in words):

from itertools import combinations_with_replacement

servants = {28: 'blue',
            27: 'green',
            26: 'yellow',
            25: 'red'}

legs = {6: False,
        7: True,
        8: False}

number_of_servants = 4

for leg_combinations in combinations_with_replacement(legs.keys(), number_of_servants):
    lying = [legs[leg] for leg in leg_combinations]
    if lying.count(True) == 3 and sum(leg_combinations) in servants.keys():   
        print servants[sum(leg_combinations)]
  • 111
  • 4

Since at least 3 octopuses must be telling the lie, then it must be the green servant (with 6 legs) who is telling truth and 3 others (with 7 legs) are telling lies.

Other combinations listed here will not make sense (unless I missed out any).

blue = 28

green = 27
7,7,7,6 -> here it is!

yellow = 26

red = 25

  • 953
  • 1
  • 10
  • 18