 Alright, so I'm going to be talking about a word tile puzzle that it turns out is impossible to solve. So yeah, that's a spoiler. You can't solve it. So let's get right into it. Here's the basic setup of the puzzle. There are a bunch of tiles and they're split into the top and bottom and they have symbols along the top or bottom so they can have a symbol on the top, none on the bottom, symbols on both and so on. And the goal of this puzzle is to line the tiles up side by side so that the top and bottom read the same. So here it says iHeart, bang bang con, which is true. I hope that you all do too. And so this is a successful solution of this tile puzzle and we're programmers so we might think, oh hey, I can go and write a program to solve this. But we're going to get to it, no you can't. So here's the question we're going to explore specifically, which is given a set of tiles, so we saw an example problem. Is there a solution or not? Not even let's solve it, is there a solution or not? And this is called the post correspondence problem named after someone called Emil Post from a long, long time ago. And like I said, writing this program is actually impossible. I mean impossible, like not hard, not slow or NP complete or it'll be like a pain, it just mean impossible. And to understand why we have to kind of throw our minds back some 80 plus years when Benedict Cumberbatch was working on really like foundational work. This is actually a few years after the work we're talking about but about five years before this shot was taken, Benedict Cumberbatch was working on something called, he's actually called Alan Turing. He was working on something called, this paper called on computable numbers with an application to Einstein Dunke's problem. Any German speakers? How did I do? Not so great. So the very first sentence in this paper is the computable numbers may be described briefly as the real numbers whose expressions as a decimal are calculable by finite means. And this is 1936. He had to define what calculable by finite means even means. Like there were no computers at this time. So he came up with a formula called the Turing machine. I assume he was nice because he didn't actually call it after himself. That's what we call it. He called it an A machine for automatic machine. And I'm gonna explain how this Turing machine works very, very fast. I'm gonna try and do this as fast as it's ever been done. So we're in 2018 so we're just gonna assume a bit more knowledge than they had in 1936. And so basically a Turing machine is kind of like our computers just worse. So here's a specific example or not an example. Here's a setup. There's a tape. The tapes divided into cells. Cells can have symbols in them. There's a cursor or a read head pointed somewhere and there's some state like just a number we can say. And the Turing machine can only do three things. It can write a symbol at the tape head. Kind of like erase the A and put a B instead. It can move the tape head left or right. So move to left and it can go to a different state. So change the state to state three. And that's all it can do. So to have this in a kind of compact way I'm gonna draw a little table which is for state one if the thing under the head is empty or A or B then we do the following right move left or right and then go to which state. So I'm just gonna give an example here. If the head is over an A we move right and go to state two. If the head is over sorry if the head was over a blank. If the head's over an A we move right and go to state one. And if the head's over B we move right and we're done. We stop. And then there's just another state two just for actually having an illustrative example that does something. So here's a very quick run through of how this might look. So we're over and we're in state one and we're over a blank. So we have to fill in an A, move to the right, change to state two. And then now we're over a blank and we're in state two. So we have to do what it says over there which is fill in a B, move left, change to state one. And gonna run through this quite a bit faster than this. So now we have to move right and change to state one and then we are over a B and we're in state one and so we're done. So that was an example of a Turing machine that stopped. And here's an example of a Turing machine that didn't stop. This is a very minor change to the previous one. We're just changing this state one in the top of the result of what you do when there's a blank and you're in state two to a state two. And then let's do the same thing again. So blank A, state one, we got to move to the right, right and A and state two. And then now this is where the difference is. Before we moved left and went to state two. Now we're moving left and going to state one. Now we're moving left and going to state two. But now instead of going right, we are or instead of leaving the A there, we're overwriting it with a B and then moving over and then state moving over to a blank tile and now we're kind of at this similar starting point where we were before. And so if we run through this, I kind of think of state one as the one that wants A's and state two as the one that wants B's. And just changing that little flip over means that now we just end up with loads of B's and it never stops, whereas previously it just ended up with a couple of A's but actually stopped. So like state two is the bad guy. So okay, Turing Machines done in three minutes, two minutes, I'm not sure. Okay. So the halting problem is given a is the question, much like the post correspondence problem, given tiles, is there a solution? The halting problem is given a Turing machine. Does it stop? And part of Turing's paper was proving that it does not stop. The proof is cute. I'm not including it here, but catch me afterwards. And it's kind of like one of those, if I asked your brother who was behind the door, you know, one of those logic things. Anyway, so the halting problem is undecidable and Turing told us this. So what the way we're going to show that the post correspondence problem is also impossible to solve is by doing something called a reduction. I just like to think of it as not letting some impossibility sneak in the back door. So suppose we could solve the post correspondence problem. Well, we're going to find a way to turn a Turing machine into a post correspondence problem so that if we could solve the post correspondence problem, we could decide if the Turing machine was going to halter or not. So we want to turn a program into a puzzle. This is curious, but kind of cool. So here's the same state table we had for the second machine, the one that loops forever. And I'm going to just get rid of the word state because there's going to be a lot of symbols here, and like state is five letters and it's a waste of space. So I just replaced it with two, one, and done is X. And so for each row in these tables, we create a tile. And so on the top, and the way to read these tiles is the one is that the read head is next to a blank. So it's over a blank. That's why it's one with nothing to its right. And the one is the state. And then so here, if the read head is over a blank and it's in state one, it moves to the right and writes an A. So now it is to the right of an A. It has moved over. And similarly here, if there's an A under the head, then it moves to the right and leaves the A there. And similarly, there's just a lot of these. So, oh yeah, this one's a bit different. So the ones for moving to the right are kind of easy because there's the character that is there is just immediately, sorry, vague. The thing here is that for ones that need to move to the left, we have to have an extra tile just to show what could have been to the left of the head that we are moving to the left of. So here, the two is on the right of the A and then it moves left so it's on the left of the A. And it has written an extra B over there. This is a lot of these. This is a special starting tile. This is one we're going to have to start with. And there's a few extra tiles. There's just a lot of tiles, okay? So there's a few extra tiles. These ones are just copying. They're A on the top, B on the bottom. And also, I should have said the dot in this starting tile is like a spacer between units of the Turing machine and the X stuff we don't need because this one doesn't stop. The X is like some special stuff to make the halting ones work. So to see how this goes, we start off with a starting tile and reading across the bottom, we now have we had dot one dot and on the top we only have a dot. So we have to go up into all these tiles and find one that will let us have a one on the top and then still allow us to put a dot because we have to make these match, right? So the dot dot one. So the only one that actually works here is the one A2. So we put dot one and then here we have dot one dot A2 and then we still are missing the extra dots. So we have to go and add the extra dot in and then now we have to add in an A2 and that makes the thing go to two AB underneath and then we're like, oh, god damn it. So then we add dot and then we're like, okay, so now we need to have two A on top and we also need a B and there's dot and god now it's B2B and then, okay, B2B. So B2B, okay, catching up. It's like, no, god damn it. It just keeps like pushing us further along. And this is like, I think very reminiscent, this is now really run out, very reminiscent of like the Turing machine where it's just like, we just keep having to put Bs. We can't do anything else. And the nature of the tile is that's like just all we can do. So the solving of this puzzle is basically running the Turing machine. And so the connection there is like really, really close. So we wanted to turn a program into a puzzle. I kind of ran through that a little quickly, but we saw how it's done. And this is like in technical speak, as I said, this is reducing the halting problem to the post correspondence problem, which sounds like complicated. But all we did was like, manipulate some symbols and turn them into tiles. And then if you go and look at Wikipedia for this, for the post correspondence problem, it's like, let A be an alphabet with at least two symbols, the input of the problem, because this is a two and finite list, alpha, one, blah, blah, blah. Well, if you don't like that definition, let's go with this one. The two given lists of the words of the alphabet can be seen as defining a homomorphism that maps one to N to words on A, and G, blah, blah, blah. This is just the description of the tile. This has got nothing to even do with the correspondence to the Turing machines. This is just like, here's what the problem is. And so some of these things can be really kind of mystifying. And sometimes they actually are hard, but other times they just have too many Greek letters. And I think it's really cool to know that some of these things are actually approachable. And some of these things are really fun. So I really hope that I encourage you to go and check some of this stuff out. Thank you very much.