A hostile artificial intelligence called

NIM has taken over the world’s computers. You’re the only person skilled

enough to shut it down, and you’ll only have one chance. You’ve broken into NIM’s secret lab, and now you’re floating in a raft on top

of 25 stories of electrified water. You’ve rigged up a remote

that can lower the water level by ejecting it from grates

in the sides of the room. If you can lower the water level to 0, you can hit the manual override, shut NIM off, and save the day. However, the AI knows that you’re here,

and it can lower the water level, too, by sucking it through a trapdoor

at the bottom of the lab. If NIM is the one to lower

the water level to 0, you’ll be sucked out of the lab, resulting in a failed mission. Control over water drainage

alternates between you and NIM, and neither can skip a turn. Each of you can lower the water level

by exactly 1, 3, or 4 stories at a time. Whoever gets the level

exactly to 0 on their turn will win this deadly duel. Note that neither of you can lower

the water below 0; if the water level is at 2, then the only move is to lower

the water level 1 story. You know that NIM has already computed

all possible outcomes of the contest, and will play in a way that maximizes

its chance of success. You go first. How can you survive

and shut off the artificial intelligence? Pause here if you want

to figure it out for yourself. Answer in: 3 Answer in: 2 Answer in: 1 You can’t leave anything up to chance –

NIM will take any advantage it can get. And you’ll need to have a response

to any possible move it makes. The trick here is to start from where

you want to end and work backwards. You want to be the one to lower

the water level to 0, which means you need the water level

to be at 1, 3, or 4 when control switches to you. If the water level were at 2, your only option would be

to lower it 1 story, which would lead

to NIM making the winning move. If we color code the water levels, we can see a simple principle at play: there are “losing” levels like 2, where no matter what whoever starts

their turn there does, they’ll lose. And there are winning levels,

where whoever starts their turn there can either win or leave their opponent

with a losing level. So not only are 1, 3,

and 4 winning levels, but so are 5 and 6, since you can send your opponent

to 2 from there. What about 7? From 7, all possible moves would

send your opponent to a winning level, making this another losing level. And we can continue up

the lab in this way. If you start your turn 1, 3,

or 4 levels above a losing level, then you’re at a winning level. Otherwise, you’re destined to lose. You could continue like this

all the way to level 25. But as a shortcut, you might notice that levels 8 through 11

are colored identically to 1 through 4. Since a level’s color is determined by

the levels 1, 3, and 4 stories below it, this means that level 12

will be the same color as level 5, 13 will match 6, 14 will match 7, and so on, In particular, the losing levels

will always be multiple of 7, and two greater than multiples of 7. Now, from your original

starting level of 25, you have to make sure your opponent starts

on a losing level every single turn— if NIM starts on a winning level

even once, it’s game over for you. So your only choice on turn 1

is to lower the water level by 4 stories. No matter what the AI does, you can continue giving it losing levels until you reach 0

and trigger the manual override. And with that, the crisis is averted. Now, back to a less stressful

kind of surfing.

Sign up for free to be emailed the solution to the bonus riddle: https://brilliant.org/teded! Also, the first 833 of you who sign up for a PREMIUM subscription will get 20% off the annual fee. Now go solve some riddles!

00:11 how am i watching this then?

A more generalised variant of the problem : https://codeforces.com/contest/1194/problem/D

F

Just place a sapper lol

0:20 that’s not how water works

why can't i win if i go to 23 instead of 21?

Bonus Answer.

Let's find losing moves.

And I will name chocolate pieces like this;

123

456(4=poisoned)

Losing moves are;

4(obviously)

145

12456

Which means you can simply eat chocolate 3.

Bonus riddle:

Ted Ed: You and a friend are eating chocolate and the bottom right is poison

Me: I'm allergic so ALL OF IT IS POISON

Why does this character look like a African Kim Jong Um? Lmao

You wait for the computer to get destroyed by all the water

How about a sub that has protection to anything and is thin to get though work its robotic arms

It is literally the game nim

I have this idea: we call the total number of floors that Nim and we can take in two turns, x (x> = 5, x of N *), we know that in 4 turns we and Nim can go> = 20. because 4 is an even number, so if Nim starts then we will end up having 26 floors all counting the zero floor. I reversed that we will go on the 0th floor and end the 26th floor so if we are on the 24th floor we will win (24th floor is 2nd floor) but 24-20 = 4 so if Nim starts on 3rd floor ie 21st floor, Nim loses so we just need to go down 25-21 = 4 floors in the first turn.

Too complicated, I'm bombing the raft

This "take a turn at drainage" thing is extremely effective, especially since that it is actually possible to beat it.

Why does NIM even have a manual override button? Also you could just jump off the raft when NIM lowers the water level to 0.

For the bonus riddle, the answer is top middle. That will leave 1 square above and two squares to the right. Your opponent would be forced to eat one of these, while you can eat the other, leaving only the poison square

“The AI knows all move possible” –

Said TedEd while completely explaining how to defeat the AI easilynim is s.youngs kammunizm

How to solve the bonus riddle:

**Don't play a game with poisonous chocolate.

Who else loves these riddles but never solve them

The answer to the chocolate riddle is top right square, I think

Short answer, lower it by 4.

Plot twist: when you make it to the bottom NIM opens the hatch and you fall down and into the ocean

Easier solution: drop the control down and it will sink and hit the button

Bonus riddle: bottom left, but you can still die easily

I love how the AI is named after the classic game of NIM with the same concept just under different terms 🖤 it’s almost impossible to beat NIM in his own game without cheating though…

Okay, So Basically,🐵

For The bonus riddle:

Take The top right corner… unless you wanna die of course.

Does anyone else realise that NIM is just WIN but laterally inverted

How is it losing for your opponent at 2 if they want to flush you out

Nice reference to the game Nim

at the right moment jump off, why this seemed so hard?

Taking a stab at the bonus riddle, is it the single top right corner square? I say this because if you choose that then the only square left for the next player to choose is the square under it, so you could repeat this until they have to choose the death square

Or…you could just…yknow…call in an A-10 wathog and blast holes into the thing until the water drains. Or just call in a nuke, same effect

Can’t you jump out of the raft when N.I.M lowers the water level to 0?

So this is a big game of nim!

Race to December, anyone?

How come NIM can’t create a super advanced security system?

Lol when i saw the regular print title I thought it said al

Nice, you named it after the game nim

Me Before the answers4 storiesAnswer:Four StoriesMe:I’m So SmartWait.

I HAVE SKIll???

I think they got the wrong person

I really don’t get the bonus riddle

Is there a trained stalemate associate to press the button?

The Rule Is: there are no rules

Dr. Nim!

A great example of recursive function

bruh just throw a nuke at it lol

34 freaking tabs open at the end, absolute madlad

NIM:

Views videoEat the POSION

Or the ai would realize it can't win and just send a terminator to kill him

Wouldn’t your rubber boat burn in electrified water?

Binker

hops of raft before its get sucked out yeah this is big brain time

i love how you called in nim, as in the unwinnable game.

How about Burn or Bliss.

This is a very convenient and unnecessarily complicated water ejection system

Bottom right and top right should be token off

He protec

He attack

But most importantly

He want his electro water bacc

on bonus riddle..

i will eat the two on the op so my opponents move is to eat two chocolate or one but if he eat 2 i will eat the 1 so he will die.. when he eat 1 chocolate only i will eat two so he didnt have choice he will die again and again 😂😂

2:30

THAT LOOKS NOTHING LIKE ME!!!!!

Step 1: figure out why nim can only lower the water level by 1, 3, or 4.

If we give these instruction to a Min-Max algorithm will it work ?

Take the top right corner off.

Then, you can always give them the skull piece.

Easy

Electromagnetic pulse or EMP

No.

This is just Honeycomb Havoc from Mario Party 2 with extra steps.

For the bonus riddle, you have to eat the most upper right piece to always win.

Me: fails

Me:

mission failed, we’ll get em next timeSpy: thinks about how to solve the puzzle

NIM: takes over the world

drink it.D R I N K T H E W A T E RIsnt NIM able to lower it 4 and 3 levels? So if you reach 4 or 3 you are still losing.

Why don't you just jump off the boat just as you reach 0

This is literally the Doctor Nim game! Nice reference, and a good riddle.

Or just let N.I.M win and when their about to flush you out just press the button and then swim out…..

Nim comes from a game from the 60 similar to this puzzle

this riddle is literally a boss battle

Easier solution: Become amish

This is like the game Dr NIM

"i ' m a f r a i d i c a n n o t d o t h a t, d a v e"

"…Called NIM"

Me: rod.

Wow, I'm the only person that can press a button!

For the last one: Just don't eat the corner.

If you are an odd number, so you will always win.

If you are an even number, you'd always loose.

did anyone think that when nim wins you could quickly jump off the raft and shut it off?

Nim could have easily built a defense system that isn't a pile of junk.

You gave the answer away by calling the AI Nim lmfao…

Is no one gonna bring up how dr. Nvm is a game and it’s basically this but with marbles?

Does anyone besides me remember then game dr . Nim or is it just me

For the candy bar the right two first, then your opponent can either do two squares or one, you pick the last two or one, he dies.

Me:

wears hazmat suit with oxygen tankNow I can swim and hit the button. Too easy.

Also, NIM clearly built this chamber. Why not add turrets at the top?

This is why I don't trust sentient ROBOTS! 🔨💻

I would eat the left most top 2. They fuck'd either way.

You:takes 5 mins to win. Nim:Hmm when will he do a move?

Me:

Starts video1 second later..

Some kid: Blabs the whole entire answer without even watching the video

Me: Dafuq?

You’re the only skilled person to solve the problem…

Me: well..aren’t we screwed

That chocolate bar brings me some memories… Also there's a non constructive proof that for any tablet that is a rectangle (or square) the first player can have a winning strategy, you just don't know which one. In this case, eating only the first top right square guarantees that the first player can win, as far as I can see

"You're the only person skilled enough to shut it down"

about 10 seconds later: pushes button and shuts down AI

me: now that's skill right there