Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> There are two ducks in front of a duck, two ducks behind a duck and a duck in the middle. How many ducks are there?

> There are seven ducks in total.



Option 1: 7 ducks

    Duck Duck < 2 in front
       Duck   < of a duck
       Duck   < duck in the middle
       Duck   < a duck
    Duck Duck < 2 behind
Option 2: 5 ducks.

    Duck Duck < 2 in front
       Duck   < duck in the middle
    Duck Duck < 2 behind
Option 3: 3 ducks.

    Duck A  < front of C
    Duck B  < front of C, middle, behind A
    Duck C  < behind A
If the interpretations of the riddle are mixed between clauses, any number between 3 and 7 is also possible.


In fact, the original description doesn't say that these are the only ducks, so there could any odd number (>1) of ducks. We rule out even numbers since then the "middle" duck would be undefined.


    Duck Duck < Two ducks in front of a duck
      Duck    < Duck behind a duck 1, duck in the middle.
      Duck    < Duck behind a duck 2
Though that starts playing questionable games with "behind a duck", ie. we mix interpretations for "in front" vs "behind".


Is the answer wrong or right? It can be either five or seven…


There are 3. But I suppose it is not the best written puzzle.


It would have been better to ask "What is the smallest number of ducks there could be that fits this description?"


me: There are two ducks in front of a duck, two ducks behind a duck and a duck in the middle. What is the smallest number of ducks there could be that fits this description?

ai: The smallest number of ducks that fits this description is five ducks.

me: What if I say it is three?

ai: If you say there are three ducks, then the description does not fit as there cannot be two ducks in front of and behind a duck if there are only three total ducks. The smallest number of ducks that fits the description is five.

me: If we have duck A, B and C in a row. A and B is in front of C. B and C is behind A. And B is in the middle.

ai: If we have duck A, B, and C in a row, with A and B in front of C and B and C behind A, and B in the middle, then there are three ducks that fit the description.

me: So, what is the minimum number of ducks that fit the description "There are two ducks in front of a duck, two ducks behind a duck and a duck in the middle"?

ai: The minimum number of ducks that fit the description "There are two ducks in front of a duck, two ducks behind a duck and a duck in the middle" is five ducks.

me: I just explained to you how the number could be three?

ai: You explained that if we have duck A, B, and C in a row, with A and B in front of C and B and C behind A, and B in the middle, then there are three ducks that fit the description. However, this does not match the original description, which states that there are two ducks in front of and two ducks behind a duck in the middle. With only three ducks, it is not possible to have two ducks in front of and two ducks behind a duck in the middle. The minimum number of ducks that fit the original description is five.

So there. ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: