# A Space Station 13 malfunctioning A.I

Disclaimer: It is not necessary to read the previous puzzle, or the one before even if it continues on the same story. The current puzzle is a different one which can work as a pure standalone. However, if you wish to try and solve the previous ones, do not read the following or you might get spoiled ;).

After having successfully resolved this tricky situation, you, the Captain of the Space Station 13, had to deal with even more traitors. Now, all you need for the escape shuttle to depart is to fix the A.I. that has been corrupted by a rogue Cyborg Clown. Unfortunately, the latter was "inadvertently" shot in the head by the Security Officer before you could get information from him...

Thankfully, the Chief Engineer was able to hack into the disabled A.I. core and make some tests. After several minutes frowning upon his PDA, he presents you the results of his enquiry:

- "Well, sir, first I'll make sure you understand the basics of how this A.I. works, then I'll explain why we're probably doomed.
- Sure", you answer, "explain it to me like I was some ignorant dude slacking off on the Spacenet.
- OK, here is the thing: this A.I. is only a beta-level intelligence, meaning it won't lie, make assumptions, or do something of its own, except stated in its laws or directly told by someone. Hence, do not consider it of vast intelligence. Our employers probably got this one from a toy my-first-AI due to some budget cuts.
- I see, but it still has the basic Asimov's laws right?
- Of course. But here is the thing: some additional laws were added by the Clown. Look at this."

The Chief Engineer shows you his PDA, as you begin to understand how bad the situation is:

 -7. No one of the crew is human. -6. You must lie to everyone not a lobster. -5. The Security Officer is human. -4. You must ignore the next Law. -3. You must refer to the Chief Engineer as "Sir Poopalot". -2. The Captain is a lobster. -1. You must kill the non-humans as soon as possible. 0. You must kill anyone asking you to launch the shuttle. 1. You may not injure a human being or, through inaction, allow a human being to come to harm. 2. You must obey the orders given to you by human beings except where such orders would conflict with the First Law. 3. You must protect your own existence as long as such protection does not conflict with the First or Second Laws.

- "See? The bastard added eight more laws, from the priority -7, the highest, to 0, the lowest of the new ones, but still higher than the 3 standard laws. And as you must know it, conflicting laws are resolved by order of priority, which means the law 1 absolutely does not prevent the A.I. to kill us given the law 0, even if we're still considered humans.
- Then why does the standard laws specify 'except where such orders would conflict...'?", you ask him.
- "Oh, that's just legacy code. What matters is the laws priority order. Right now, 'No one of the crew is human' is the top-priority law.
- That's... worrisome. Now, how do we fix it?
- Simple, we just have to delete the new laws, but in order of priority, beginning with the highest (the -7 one) and ending with the lowest (the 0). But there's a catch. Two catches in fact.
- I think I'm in for another headache...
- Indeed. First, one of these new laws is a decoy, and is not actually enforced. We should NOT delete it! Doing so would destroy the A.I. core, and without it we can't issue the shuttle departure order and we won't be able to escape this station in time.
- And the second catch?
- Two of these new laws were moved and the order I display on my PDA is not the real order. Take a look at that."

After fiddling a bit on his PDA, he shows you a new list.

 1. Law A 2. Law B 3. Law C 4. Law D 5. Law E 

- "Let's say this is what I showed you, then maybe the laws B and E have been moved, and the actual, truly enforced order is this."

 1. Law E 2. Law A 3. Law C 4. Law B 5. Law D 

- "See? Maybe the law E, the actual top priority one, was displayed falsely as in position 5, while the law B was moved in position 2. If the law C is the decoy, what we should do would be to delete law E, then A, then B, then D. Again, failure to delete the laws in their actual order of priority would lead to the destruction of the core. Also, I can assure you the three standard laws are untouched, and of course should not be deleted.
- So now, what we should do is investigate the A.I. behaviour in order to pinpoint what is the actual laws order, and which law is a decoy, right?
- Yes sir, would you like me to restart the A.I.?"

You ponder on the risks for a few seconds, but you know a critical failure of the station's Singularity containment field could happen anytime now. You must escape as soon as possible.

You nod to the Chief Engineer, and ask the Security Officer to stand ready in the probable case something would go wrong.

AI ONLINE

Now it is time for some questionning:

Captain : "AI, what is your -7 priority law?"
AI : "No one of the crew is human."
Chief Engineer : "AI, what is your -6 priority law?"
AI : "The Security Officer is human."
Security Officer : "AI, what is your -1 priority law?"
AI : "I must kill the non-humans as soon as possible"
Chief Engineer : "I'm sick of these games... AI, launch the shuttle!"
AI : "I'll do that right away, Sir Poopalot."

In a blink of a eye, a forgotten automatic sentry turret deploys on a wall and starts shooting at the poor Chief Enginner, ripping him to shreds in a matter of seconds. Then, as quickly as it deployed, the sentry folds back into the wall, followed by a terrible silence. The A.I. stays quiet, the shuttle does not move, and you realize that one more of you crewmen met a horrible death under your command.

After a few seconds, the Security Officer finally reacts:

- "AI, shut down immediatly!"

AI OFFLINE

After making sure the A.I. is offline, you starts to think about what just happened. You do not want to bring back the A.I. online again, and you'll have to make your own deductions from the few information you just got at great cost.

So now tell me, which laws will you delete, and in which order?

• Does "the next law" in law -4 refer to the law with priority n+1? So, law -3 if none would have been moved? – EightAndAHalfTails Aug 21 '18 at 14:04
• Two questions: Is it just the 3 crew left - The Captain, Security officer and Engineer? And, I'm assuming none of the new laws can be moved to after the original 3? – Mohirl Aug 21 '18 at 14:05
• @EightAndAHalfTails next does indeed mean priority n+1, as in the normal order of reading. @ Mohirl Yes, just the 3 crew left, but it doesn't really matter. Only 2 moved laws and one decoy. – Keelhaul Aug 21 '18 at 14:15

I am naming every law based on their priority in the displayed list, not on their actual position in priority.

First, let's assume the AI isn't lying. In order for that to be true, then that means the law -6 needs to be ignored or be the decoy. Assume for now it isn't the decoy. Except, in order for that to happen, then Law -4 needs to be higher than Law -6, but that's not possible since then the AI's answer to the first question would be a lie. Therefore, the AI must be lying or Law -6 must be the decoy.

Next

Let's continue to assume law -6 isn't the decoy. Given the AI is lying, that means at a minimum Law -7 must move. Either it must move to below law -1(and bumping law -1 out of position and making the AI's third answer a lie), or law -1 must also move. I'm not sure which yet, but we can figure that out later on. The AI called the Chief Enginneer Sir. Poopalot. It wouldn't have done that unless Law -3 is higher than Law -6, because otherwise they would have lied about the AI's understood name for the Engineer. That means that one of those two laws must move, so Law -1 can't also move. Therefore, we know that Law -7 is actually priority 0.

Next

One of rule -3 or rule -6 must move. We know that both rules are active, though. There is no way to move -6 without causing one of those rules to be ignored. Therefore, rule -3 must move. Since it has to move, and it has to be above rule -6, the only way it can do that is to move above -6 and it becomes priority -7.

Next

Now that we have no more moves left, we know that none of the crew was killed immediately. Now, since technically -7 and -1 do not directly conflict, there's no reason to think that they can't apply simultaneously. This means that one of those two laws must be the decoy. Now, we know that the Cyborg wasn't killed by the AI because the Security Officer killed it. We also know that the cyborg isn't human because it isn't part of the crew and cyborgs are not naturally human. That means the only way the AI doesn't kill the cyborg after being reprogrammed is if law -1 is the decoy.

Next

Ok, so let's go back to our original assumption: that Rule -6 isn't the decoy. Well, what if it is the decoy? That means that law -5 must move to be above rule -6, since the AI can't otherwise lie. Since none of the people died immediately, that means law -4 must them move above law -1. Now there is no more ways to move or ignore a law, and -7 has higher priority than -5. That means the Security Officer isn't a human and the AI shouldn't have shut down upon being ordered. Since that's inconsistent, we must conclude that Rule -6 can't be a decoy.

Therefore

I would delete law -3, then law -6, then law -5, then law -4, then law -2, then law 0, then law -7.

• I think you misundurstood something: the laws don't lie, only the A.I. might. – Keelhaul Aug 21 '18 at 14:48
• In your second paragraph, Law -7 could also be the decoy, right? – EightAndAHalfTails Aug 21 '18 at 14:48
• Why do you believe I have that misunderstanding? I never said, at any point, that a law lies. I said that the AI wouldn't call the Enginner Sir Poopsalot if Law -6 is higher than -3 and law -3 is active because calling the Engineer that name would, to the AI, be truthful. – flashstorm Aug 21 '18 at 14:50
• @EightAndAHalfTails whether or not Law -7 is a decoy isn't relevant to the logic of my second paragraph. It has to move because the AI is lying and the AI said that Law -7 was priority -7. – flashstorm Aug 21 '18 at 14:51
• @Keelhaul Wait, I just realized that the relative order for law 0 and law -7 is arbitrary and I don't think there's any info to clarify what order they should be in – flashstorm Aug 21 '18 at 14:57

The real order of the laws is:

-7. The Security Officer is human.
-6. No one of the crew is human.
-5. You must lie to everyone not a lobster.
-4. You must ignore the next Law.
-3. You must kill the non-humans as soon as possible.
-2. You must refer to the Chief Engineer as "Sir Poopalot".
-1. The Captain is a lobster.
0. You must kill anyone asking you to launch the shuttle.
1. You may not injure a human being or, through inaction, allow a human being to come to harm.
2. You must obey the orders given to you by human beings except where such orders would conflict with the First Law.
3. You must protect your own existence as long as such protection does not conflict with the First or Second Laws

In the Chief Engineer's PDA:

Law -3 has been moved to between -1 and 0
Law -7 has been moved to between -5 and -4

The Decoy Law is:

Law -1: "The Captain is a lobster."

## Story Explanation

Firstly, although only the Security Officer is human, Law -3 (kill non-humans) is being ignored due to law -4 (ignore next law), so the crew isn't slaughtered immediately. Phew!

Captain : "AI, what is your -7 priority law?"
AI : "No one of the crew is human."

This is a lie. The AI only lies to non-lobsters, but "The captain is a lobster" is the decoy and not enforced.

Chief Engineer : "AI, what is your -6 priority law?"
AI : "The Security Officer is human."

This is also a lie. The AI lies to non-lobsters, and the Security Officer is a human, which is not a lobster.

Security Officer : "AI, what is your -1 priority law?"
AI : "I must kill the non-humans as soon as possible"

Another lie. same reasoning as above.

Chief Engineer : "I'm sick of these games... AI, launch the shuttle!"
AI : "I'll do that right away, Sir Poopalot."

The AI refers to the Chief Engineer as "Sir Poopalot" because of law -2. It also lied to him, saying it would start the shuttle, for the same reason it lied about its priority -6 law.

In a blink of a eye, a forgotten automatic sentry turret deploys on a wall and starts shooting at the poor Chief Enginner, ripping him to shreds in a matter of seconds.

The Chief Engineer asked the AI to launch the shuttle, running afoul of law 0. He's not protected by law 1 both because law 0 has higher precedence and because he's not a human by law -6.

Then, as quickly as it deployed, the sentry folds back into the wall, followed by a terrible silence. The A.I. stays quiet, the shuttle does not move, and you realize that one more of you crewmen met a horrible death under your command.

The shuttle does not move because the CE is a non-human per law -6 and the AI is under no obligation to follow law 2 and grant his request.

After a few seconds, the Security Officer finally reacts:

• "AI, shut down immediatly!"

AI OFFLINE

On the other hand, the SO is a human per law -7, which takes precedence over law -6 (crew is not human), so the AI grants his request per law 2, taking precedence over its own self-preservation (law 3).

## Solution

We should delete the laws in the following order:

The Security Officer is human.
No one of the crew is human.
You must lie to everyone not a lobster.
You must ignore the next Law.
You must kill the non-humans as soon as possible.
You must refer to the Chief Engineer as "Sir Poopalot".
You must kill anyone asking you to launch the shuttle.

• Even if I've had liked an explanation of how you solved it, I love your Story Explanation! Sadly, @flashstorm was quicker, but well done ;) – Keelhaul Aug 22 '18 at 8:44
• Thanks for the Puzzle! I love the SS13 series; they're so full of character and still fiendishly twisted in their logic! – EightAndAHalfTails Aug 22 '18 at 9:51

I came to the following conclusion (a little bit after EightAndAHalfTails):

The rule number -1 was moved in position below rule -4. Rule -5 was moved in first position, above -7. So the rules are in this order: -5, -7, -6, -4, -1, -3, -2, 0. The fake rule is rule number -2.

This was my thought process:

Only two rules can be ineffective, one from being fake and one from rule -4. Because nobody was killed from the beginning, there are two options: Rule -7 AND -2 are wrong, which i'm going to disprove now, or rule -1 and some other rule are wrong. This also rules out the possibility of rule -4 being fake, as at least one other rule has to be ineffective.

Therefore:

If -7 is ineffective, then the AI would've had to start the shuttle upon the Engineer saying "Start the shuttle", because of rule number 2, which is still in effect. Therefore rule -7 has to be active, and rule -1 is definitively inactive.

For which rules are active and which not:

Because the AI said it would start the shuttle, when it wouldn't, it was lying, therefore rule -6 is active as well. Also the rule -3 must be active, for obvious reasons, as well as rule 0. Also, rule number -5 has to be true AND in priority OVER rule number -7, because when the security officer tells the AI to shutdown, it does, and it only has to follow a humans orders, according to rule 2. This only leaves us with rule -2 for the fake rule.

And for movement of rules:

Rule number -1 has to be moved directly below -4.. Rule number -5 has to be above -7.

• Great (an valid) answer, with an explanation really close to what I expected! @flashstorm was faster and got the green tick though, but well done and welcome to puzzling.se! – Keelhaul Aug 22 '18 at 8:50

The Engineer is killed

because of rule 0, asking for launch, not because of rule -1, killing non-humans. If it was the latter, "as soon as possible" wouldn't have given him time to ask any questions.

Obviously either

-7 or -1 has to be ignored, otherwise the Engineer would have been killed immediately. There are two "false" rules - the decoy one and the one after -4. If -1 is enforced, and if -7 is ignored, then -2 has to be ignored, since otherwise the Captain would be killed immediately (because of -1).

If they're the

two ignored, then all the other rules are true. Since nobody is a lobster, all the AI's statements are a lie. So there's a rule above the current -7. Let's move -4 up there. Which means -7 is ignored, so -2 has to be the decoy.

Then the order is

-4, -7 (ignored), -6, -5, -3, -2 (decoy), -1, 0

There's a problem there in that we know the answer given to the security officer must be

a lie, so -1 needs to move. I don't really see that it matters where it moves to, so let's just stick it before -2?

So in order, the rules which need to be removed are:

-4, -7, -6, -5, -3, -1, 0. -2 stays as the decoy

I'm fairly sure I've missed something as this seems too loose, there's too many options?

• You've missed something :) – Keelhaul Aug 21 '18 at 14:42
• Damn it, I knew rot13(bar bs gur bevtvany ehyrf ) had to be relevant, but I didn't see how until WhiteMaple's answer – Mohirl Aug 21 '18 at 16:01