53

There, spread out all over the floor, were the mechanical pieces of a robot. Something had torn it apart, and the debris spanned a radius of a few meters. There was no sign of what might have caused this tragedy. What monster, what disaster, could cause this much damage to a mechanical creature?

However, a few steps away, there was a hastily constructed circuit:

What happened here?

And one question nags at you:

What was the robot trying to tell us with his last words?

Tryth
  • 13,960
  • 5
  • 39
  • 81
  • 1
    Wow! Nice intuitive riddle... just one question - how the hell did you come up with the boolean formulas from the results/truth-table ? – Falco Dec 18 '14 at 13:43
  • 1
    @Falco: a naive approach would be to take all rows where a certain bit evaluates to 1 and OR them. But a better way is to build a Karnaugh map for each bit, which gives you the simplest boolean expression equivalent to the naive one. – vgru Sep 26 '15 at 08:19

2 Answers2

35

Answer:

KEEPAWAY

Explanation:

Here are the functions for the output (in Java).

Output 1 = !((!C)|C)
Output 2 = (!C)|C
Output 3 = !((!C)|C)
Output 4 = (A|B)&C
Output 5 = (!(A^B))&(!(B^C))
Output 6 = ((!A)&(B^C))|((A&C)&(!B))
Output 7 = ((A&C)&(!B))|(!((B|C)|A))
Output 8 = (!(B&C))|A

Using these functions

you can create a Truth table: |A|B|C|1|2|3|4|5|6|7|8|Hex|Char| -------------------------------- |0|0|0|0|1|0|0|1|0|1|1|4b |K | |0|0|1|0|1|0|0|0|1|0|1|45 |E | |0|1|0|0|1|0|0|0|1|0|1|45 |E | |0|1|1|0|1|0|1|0|0|0|0|50 |P | |1|0|0|0|1|0|0|0|0|0|1|41 |A | |1|0|1|0|1|0|1|0|1|1|1|57 |W | |1|1|0|0|1|0|0|0|0|0|1|41 |A | |1|1|1|0|1|0|1|1|0|0|1|59 |Y | From this truth table it is obvious what the message is.

TheNumberOne
  • 466
  • 4
  • 9
  • 1
    Completely correct! – Tryth Dec 18 '14 at 00:46
  • 2
    This is clever, @Tryth, and I enjoyed solving it. I'm curious how the message ties in with the story, however. – jscs Dec 18 '14 at 01:17
  • @JoshCaswell My idea was that whatever destroyed the robot was so dangerous that with his last seconds he created a warning for others. Not sure how well it was conveyed though. – Tryth Dec 18 '14 at 01:37
  • 4
    Sounds like you set yourself up for a sequel, @Tryth! – jscs Dec 18 '14 at 01:42
  • @Tryth I don't think the answer is completely correct. I think there is a mistake in upper cases vs. lower case. – kasperd Dec 18 '14 at 09:04
  • @Tryth No, I did not work backwards. I used UTF-16 to translate the code points. – TheNumberOne Dec 18 '14 at 13:25
  • Outputs 1 and 3 appear wired identically, and in your Java definition, they are defined the same. So why is 1 always 0 and 3 always 1? – The other other Alan Dec 18 '14 at 14:56
  • @AFischBein Fixed, strangely the fix makes all the letters upper case as kasperd suggested. – TheNumberOne Dec 18 '14 at 15:33
  • @TheBestOne - lowercase letters are 32 more than uppercase counterparts in ASCII (e.g. 'A'=65, 'a'=97). Output 3 is in the 6th position, starting from the right, corresponding to value 2^5. Switching output 3 from 1 to 0 subtracts 2^5, or 32 from the value, converting lowercase to uppercase. – The other other Alan Dec 19 '14 at 13:46
2

Taking the bottom output as bit 0 up to the top output as bit 7. You can easily see that bits 5, 6, and 7 are always 010. Given that I wrote the following Python code (without looking at any answers to make it more fun!):

def bit0(a, b, c):
    return a or not (b and c)
def bit1(a, b, c):
    return bit1_5(a, b, c) or not (a or b or c)
def bit1_5(a, b, c):
    return (a and c) and not b
def bit2(a, b, c):
    return (not a and (b != c)) or bit1_5(a, b, c)
def bit3(a, b, c):
    return a == b == c
def bit4(a, b, c):
    return (a or b) and c

def compose(i):
    a = bool(i & 0x04)
    b = bool(i & 0x02)
    c = bool(i & 0x01)
    bits = 0b01000000
    if bit0(a, b, c):
        bits |= 0b00000001
    if bit1(a, b, c):
        bits |= 0b00000010
    if bit2(a, b, c):
        bits |= 0b00000100
    if bit3(a, b, c):
        bits |= 0b00001000
    if bit4(a, b, c):
        bits |= 0b00010000
    return bits

if __name__ == '__main__':
    message = ''
    for i in range(8):
        message += chr(compose(i))
    print (message)

Which outputs:

KEEPAWAY

Paul Evans
  • 9,431
  • 2
  • 25
  • 49