An information puzzle with an interesting twist
Solution on Stand-up Maths: https://youtu.be/as7Gkm7Y7h4
Help fund future projects: https://www.patreon.com/3blue1brown
An equally valuable form of support is to simply share some of the videos.
Special thanks to these supporters: https://3b1b.co/chess-thanks
Home page: https://www.3blue1brown.com
Thanks to these viewers for their contributions to translations
Hebrew: Omer Tuchfeld
------------------
0:00 Introduction
3:58 Visualizing the two-square case
5:46 Visualizing the three-square case
12:19 Proof that it's impossible
16:22 Explicit painting of the hypercube
------------------
Thanks to everyone who endured me probing them with this puzzle and provided helpful discussion, especially Cam Christensen, Matt Parker, and Mike Sklar. Mike, by the way, deserves credit for coming up with the particularly clean way to see that it's impossible when n is not a power of 2.
These animations are largely made using manim, a scrappy open-source python library: https://github.com/3b1b/manim
If you want to check it out, I feel compelled to warn you that it's not the most well-documented tool, and it has many other quirks you might expect in a library someone wrote with only their own use in mind.
Music by Vincent Rubinetti.
Download the music on Bandcamp:
https://vincerubinetti.bandcamp.com/album/the-music-of-3blue1brown
Stream the music on Spotify:
https://open.spotify.com/album/1dVyjwS8FBqXhRunaG5W5u
If you want to contribute translated subtitles or to help review those that have already been made by others and need approval, you can click the gear icon in the video and go to subtitles/cc, then "add subtitles/cc". I really appreciate those who do this, as it helps make the lessons accessible to more people.
------------------
3blue1brown is a channel about animating math, in all senses of the word animate. And you know the drill with YouTube, if you want to stay posted on new videos, subscribe: http://3b1b.co/subscribe
Various social media stuffs:
Website: https://www.3blue1brown.com
Twitter: https://twitter.com/3blue1brown
Reddit: https://www.reddit.com/r/3blue1brown
Instagram: https://www.instagram.com/3blue1brown_animations/
Patreon: https://patreon.com/3blue1brown
Facebook: https://www.facebook.com/3blue1brown
Оглавление (10 сегментов)
Introduction
You walk alone into a room and find a chessboard. Each of the 64 squares has a coin sitting on top of it. Taking a step back, this is one of those classic prisoner puzzles where a strangely math-obsessed warden offers you and a fellow inmate a chance for freedom, but only if the two of you solve some elaborate scheme they've laid out. In this case, what they've done is carefully turned over each of the coins to be heads or tails according to whatever pattern they want it to be, and then they show you a key. They put that key inside one of the chessboard squares, each square is a secret compartment or something like that, so you know where the key is. The goal is to get prisoner number 2 to also know where the key is, but the only thing that the warden allows you to do before you leave the room is to turn over one and only one of these coins. At that point, you walk out, your fellow prisoner walks in, and with no information other than the set of heads and tails they're looking at, which you've only barely tweaked, they're supposed to deduce where the key is hidden, potentially winning freedom for the both of you. As is typical with these puzzles, the two of you can strategize ahead of time if you want, but you won't know what the specific layout of heads and tails is, and moreover the warden can listen in on your strategy and do their absolute best to thwart it with some adversarial arrangement of the coins and the key. So, I first heard about this puzzle over dinner conversation at a wedding, and it totally sucked me in. I remember the drive home was maybe 3 hours, and I think my mind was glued to the topic of flipping coins and encoding state that whole time. But the puzzle sticks with you even after that. After I solved it, I fell into these two surprisingly interesting rabbit holes. One was to prove that the challenge is actually impossible if you vary the setup a little bit, maybe making it a 6x6 chessboard, or maybe removing one of the squares. And to give you a little sense for where that rabbit hole leads, this video is going to end with an especially pleasing way to paint the corners of a 4-dimensional cube. The other rabbit hole was to work out how closely you can connect the solution of this puzzle with error correction, which is a super important topic in computer science and information theory. The idea is that when computers send and store data, the messiness of the real world inevitably flips a bit now and then, and that can completely change how the data is read. So error correcting codes are a way to add a shockingly small amount of information to a message that makes it possible for the receiver to identify both when there is an error, and more impressively, precisely how to fix it. It turns out that the intuition for solving this puzzle is essentially the same as the intuition behind these things called Hamming codes, which are one of the earliest examples of highly efficient error correction. Which is all to say, time spent mulling over this problem is not as useless as you might think it is. Now you and I aren't actually going to go through the solution here. Instead, I filmed a video all about that on standup maths with Matt Parker, who I'm sure many of you recognize from his combined YouTube and standup and book fame. We each talk through our thought process in solving it, and it's good fun, because there are multiple ways of looking at it. Instead, what I want to do with you here is take a more global view of every possible strategy for this puzzle, and bring you with me down that first rabbit hole of proving why certain variations necessarily leave room for the warden to thwart you, no matter how clever you are. The proof itself is one of those satisfying moments where you shift perspective and it reveals the solution, and the whole context leading up to it is a nice chance to practice reasoning about higher dimensional objects as a way to draw conclusions about information and data. Plus, it does more to help you appreciate the solution to the original puzzle when you can see how it is, in a sense, almost impossible.
Introduction
You walk alone into a room and find a chessboard. Each of the 64 squares has a coin sitting on top of it. Taking a step back, this is one of those classic prisoner puzzles where a strangely math-obsessed warden offers you and a fellow inmate a chance for freedom, but only if the two of you solve some elaborate scheme they've laid out. In this case, what they've done is carefully turned over each of the coins to be heads or tails according to whatever pattern they want it to be, and then they show you a key. They put that key inside one of the chessboard squares, each square is a secret compartment or something like that, so you know where the key is. The goal is to get prisoner number 2 to also know where the key is, but the only thing that the warden allows you to do before you leave the room is to turn over one and only one of these coins. At that point, you walk out, your fellow prisoner walks in, and with no information other than the set of heads and tails they're looking at, which you've only barely tweaked, they're supposed to deduce where the key is hidden, potentially winning freedom for the both of you. As is typical with these puzzles, the two of you can strategize ahead of time if you want, but you won't know what the specific layout of heads and tails is, and moreover the warden can listen in on your strategy and do their absolute best to thwart it with some adversarial arrangement of the coins and the key. So, I first heard about this puzzle over dinner conversation at a wedding, and it totally sucked me in. I remember the drive home was maybe 3 hours, and I think my mind was glued to the topic of flipping coins and encoding state that whole time. But the puzzle sticks with you even after that. After I solved it, I fell into these two surprisingly interesting rabbit holes. One was to prove that the challenge is actually impossible if you vary the setup a little bit, maybe making it a 6x6 chessboard, or maybe removing one of the squares. And to give you a little sense for where that rabbit hole leads, this video is going to end with an especially pleasing way to paint the corners of a 4-dimensional cube. The other rabbit hole was to work out how closely you can connect the solution of this puzzle with error correction, which is a super important topic in computer science and information theory. The idea is that when computers send and store data, the messiness of the real world inevitably flips a bit now and then, and that can completely change how the data is read. So error correcting codes are a way to add a shockingly small amount of information to a message that makes it possible for the receiver to identify both when there is an error, and more impressively, precisely how to fix it. It turns out that the intuition for solving this puzzle is essentially the same as the intuition behind these things called Hamming codes, which are one of the earliest examples of highly efficient error correction. Which is all to say, time spent mulling over this problem is not as useless as you might think it is. Now you and I aren't actually going to go through the solution here. Instead, I filmed a video all about that on standup maths with Matt Parker, who I'm sure many of you recognize from his combined YouTube and standup and book fame. We each talk through our thought process in solving it, and it's good fun, because there are multiple ways of looking at it. Instead, what I want to do with you here is take a more global view of every possible strategy for this puzzle, and bring you with me down that first rabbit hole of proving why certain variations necessarily leave room for the warden to thwart you, no matter how clever you are. The proof itself is one of those satisfying moments where you shift perspective and it reveals the solution, and the whole context leading up to it is a nice chance to practice reasoning about higher dimensional objects as a way to draw conclusions about information and data. Plus, it does more to help you appreciate the solution to the original puzzle when you can see how it is, in a sense, almost impossible.
Visualizing the two-square case
Where to start? What we want is some kind of visualization for what it even means to solve this puzzle. And to build up to the general case, let's knock things down to the simplest case that we can that still has any kind of meaning to it. Two squares, two coins, and two possibilities for where the key is. One way that you could solve this is to simply let the second coin communicate where the key is. If it's tails, it means the key is in the left square. If it's heads, right square. Not a big deal, right? It's one bit of information, so when you need to change that coin, you can flip it, but if you don't need to change it, you can just flip the other coin. First things first, let's stop thinking about these as heads and tails and start thinking of them as ones and zeros. That's much easier to do math with. Then you can think of these pairs of coins as a set of coordinates, where each of the four possible states that the board can be in sit at the corners of a unit square, like this. This might feel like a silly thing to do when we already know how to solve this case, but it's a good warmup for turning the larger cases into a kind of geometry. Notice, flipping one of the coins moves you along an edge of the square, since it's only changing one of the coordinates. Our strategy of letting that second coin encode the key location could be drawn by associating the bottom two corners, where the y-coordinate is 0, with the key is under square zero state, which means those top two corners are associated with the key is under square one state. So think about what it means for our solution to actually work. It means that no matter where you start, if you're forced to take a step along an edge, forced to flip one of the coins, you can always guarantee that you end up in whichever of these two regions you want to.
Visualizing the two-square case
Where to start? What we want is some kind of visualization for what it even means to solve this puzzle. And to build up to the general case, let's knock things down to the simplest case that we can that still has any kind of meaning to it. Two squares, two coins, and two possibilities for where the key is. One way that you could solve this is to simply let the second coin communicate where the key is. If it's tails, it means the key is in the left square. If it's heads, right square. Not a big deal, right? It's one bit of information, so when you need to change that coin, you can flip it, but if you don't need to change it, you can just flip the other coin. First things first, let's stop thinking about these as heads and tails and start thinking of them as ones and zeros. That's much easier to do math with. Then you can think of these pairs of coins as a set of coordinates, where each of the four possible states that the board can be in sit at the corners of a unit square, like this. This might feel like a silly thing to do when we already know how to solve this case, but it's a good warmup for turning the larger cases into a kind of geometry. Notice, flipping one of the coins moves you along an edge of the square, since it's only changing one of the coordinates. Our strategy of letting that second coin encode the key location could be drawn by associating the bottom two corners, where the y-coordinate is 0, with the key is under square zero state, which means those top two corners are associated with the key is under square one state. So think about what it means for our solution to actually work. It means that no matter where you start, if you're forced to take a step along an edge, forced to flip one of the coins, you can always guarantee that you end up in whichever of these two regions you want to.
Visualizing the three-square case
Now the question is, what does it look like for a bigger chess board? The next simplest case would be three squares, three coins, and three possibilities for where the key is. This gives us eight possible states that the coin can be in. Playing the same game we did before, interpreting these states as coordinates, brings us up into three-dimensional space, with each state sitting at the corner of a unit cube. The usefulness in a picture like this is that it gives a very vivid meaning to the idea of turning over one of the coins. Every time you flip a coin, you're walking along the edge of a cube. Now, what would it mean for you and your fellow inmate to have a strategy for this puzzle? Whenever prisoner two walks into that room, they need to be able to associate the state that they're looking at, three bits basically, with one of three possible squares. We're already thinking very visually, so let's associate those squares with colors, maybe red for square zero, green for square one, and blue for square two. In this conception, coming up with a strategy, any possible strategy, is the same thing as coloring each of the eight corners of the cube, either red, green, or blue. So for example, let's say you colored the whole cube red. Well, I don't know if you'd call this a strategy exactly, but it would correspond with always guessing that the key is under square zero. Let's say instead your strategy was to add the first two coins together and use that as an encoding for the key location, well then the cube would look like this. What's kind of fun is we can count how many total strategies exist. With three choices for the color of each vertex and eight total vertices, we get 3 to the power 8. Or if you're comfortable letting your mind stray to the thought of painting a 64-dimensional cube, you can have fun thinking about the sense in which there are 64 to the 2 to the 64 total possible strategies for the original puzzle. This is the size of the haystack when you're looking for the needle. Another attempt for the 3-square case might look like taking 0 times coin 0 plus 1 times coin 1 plus 2 times coin 2, and then reduce that some mod 3 if you need to. Over on Stand Up Maths, Matt and I both talk about trying a version of this for the 64-square case, and why it works decently well for a random arrangement of coins, but why it's ultimately doomed. From our view over here, it just looks like one more way to color the cube, but it's worth taking a moment to walk through some of those corners. Let's say you get into the room and all three coins are set to tails, so it's like you're starting at the corner 0,0,0. If you were to flip coin 0, that doesn't change the sum, so it takes you to another red corner. If you flipped coin 1, it increases the sum by 1, so it takes you to a green corner. And flipping coin 2 takes you up to 2, which looks like a blue corner. The fact that you always have access to whichever color you want is a reflection of the fact that this strategy will always win if this is the corner you're starting on. On the other hand, let's say you started at 0,1,0. In that case, flipping coin 0 takes you to another green corner, since it doesn't change the sum, but flipping either coin 1 or coin 2 take you to a red corner. There's simply no way to get to a blue corner. Basically, what's happening here is that you have the options to subtract 1 by turning off coin 1, or to add 2 by turning on coin 2, and if you're working mod 3, those are both actually the same operation. But that means there's no way to change the sum to be 2. An adversarial warden who knows your strategy could start with this configuration, put the key under square 2, and call it done. But even without thinking about sums mod 3 or anything like that, whatever the implementation details, you can see this in our picture, manifested as a corner that has two neighbors of the same color. If you don't have a bird's eye view of all possible strategies, when you find that any specific one of them just doesn't work, you're left to wonder, okay, maybe there's a sneaky clever strategy that I just haven't thought of yet. But when we're thinking about colors on the cube, you're naturally led to an interesting combinatorial question. Is there some way you can paint this so that the three neighbors of any given vertex always represent red, green, and blue? Maybe it seems bizarre, even convoluted, to go from a puzzle with chessboards and coins to talking about painting corners of a cube, but this is actually a much more natural step than you might expect. I've talked with a lot of people about this puzzle, and what I love is that many of the experienced problem solvers immediately jump, unprompted, to talking about coloring the corners of a cube, as if it's a kind of de facto language for this puzzle. And it really is. Thinking about binary strings as vertices of a high dimensional cube, with bit flips corresponding to edges, that actually comes up a lot, especially in coding theory, like the error correction stuff I referenced earlier. What's more, you often hear mathematicians talk about coloring things as a way to describe partitioning them into distinct sets. If you've ever heard of that hilariously enormous number grams constant, for example, the problem where that came up was also phrased in terms of assigning colors to a high dimensional cube, though in that case colors were given to pairs of vertices instead of individual ones. The point is, analyzing how to color a high dimensional cube is more of a transferable skill than you might expect. So to our question, can you make it so that every vertex has a red, a green, and a blue neighbor? Remember, this is the same thing as having an encoding for key locations so that you're always one flip away from communicating whichever location you want to. It would actually be enlightening if you paused the video and tried this now. It's like a weird three-dimensional variant of a sudoku. Very similar to sudoku's, in the sense that you want certain subsets to be filled with all three possible states. For example, you might start by painting one of the corners an arbitrary color, let's say red, so you know its three neighbors need to be red, green, and blue, doesn't really matter how you do it. And then maybe we move to the red neighbor and say that the other two adjacencies need to be green and blue, maybe we do it like this. But at least how I've drawn it here, you're stuck, you're unable to choose a correct color for the next two. Can you see why?
Visualizing the three-square case
Now the question is, what does it look like for a bigger chess board? The next simplest case would be three squares, three coins, and three possibilities for where the key is. This gives us eight possible states that the coin can be in. Playing the same game we did before, interpreting these states as coordinates, brings us up into three-dimensional space, with each state sitting at the corner of a unit cube. The usefulness in a picture like this is that it gives a very vivid meaning to the idea of turning over one of the coins. Every time you flip a coin, you're walking along the edge of a cube. Now, what would it mean for you and your fellow inmate to have a strategy for this puzzle? Whenever prisoner two walks into that room, they need to be able to associate the state that they're looking at, three bits basically, with one of three possible squares. We're already thinking very visually, so let's associate those squares with colors, maybe red for square zero, green for square one, and blue for square two. In this conception, coming up with a strategy, any possible strategy, is the same thing as coloring each of the eight corners of the cube, either red, green, or blue. So for example, let's say you colored the whole cube red. Well, I don't know if you'd call this a strategy exactly, but it would correspond with always guessing that the key is under square zero. Let's say instead your strategy was to add the first two coins together and use that as an encoding for the key location, well then the cube would look like this. What's kind of fun is we can count how many total strategies exist. With three choices for the color of each vertex and eight total vertices, we get 3 to the power 8. Or if you're comfortable letting your mind stray to the thought of painting a 64-dimensional cube, you can have fun thinking about the sense in which there are 64 to the 2 to the 64 total possible strategies for the original puzzle. This is the size of the haystack when you're looking for the needle. Another attempt for the 3-square case might look like taking 0 times coin 0 plus 1 times coin 1 plus 2 times coin 2, and then reduce that some mod 3 if you need to. Over on Stand Up Maths, Matt and I both talk about trying a version of this for the 64-square case, and why it works decently well for a random arrangement of coins, but why it's ultimately doomed. From our view over here, it just looks like one more way to color the cube, but it's worth taking a moment to walk through some of those corners. Let's say you get into the room and all three coins are set to tails, so it's like you're starting at the corner 0,0,0. If you were to flip coin 0, that doesn't change the sum, so it takes you to another red corner. If you flipped coin 1, it increases the sum by 1, so it takes you to a green corner. And flipping coin 2 takes you up to 2, which looks like a blue corner. The fact that you always have access to whichever color you want is a reflection of the fact that this strategy will always win if this is the corner you're starting on. On the other hand, let's say you started at 0,1,0. In that case, flipping coin 0 takes you to another green corner, since it doesn't change the sum, but flipping either coin 1 or coin 2 take you to a red corner. There's simply no way to get to a blue corner. Basically, what's happening here is that you have the options to subtract 1 by turning off coin 1, or to add 2 by turning on coin 2, and if you're working mod 3, those are both actually the same operation. But that means there's no way to change the sum to be 2. An adversarial warden who knows your strategy could start with this configuration, put the key under square 2, and call it done. But even without thinking about sums mod 3 or anything like that, whatever the implementation details, you can see this in our picture, manifested as a corner that has two neighbors of the same color. If you don't have a bird's eye view of all possible strategies, when you find that any specific one of them just doesn't work, you're left to wonder, okay, maybe there's a sneaky clever strategy that I just haven't thought of yet. But when we're thinking about colors on the cube, you're naturally led to an interesting combinatorial question. Is there some way you can paint this so that the three neighbors of any given vertex always represent red, green, and blue? Maybe it seems bizarre, even convoluted, to go from a puzzle with chessboards and coins to talking about painting corners of a cube, but this is actually a much more natural step than you might expect. I've talked with a lot of people about this puzzle, and what I love is that many of the experienced problem solvers immediately jump, unprompted, to talking about coloring the corners of a cube, as if it's a kind of de facto language for this puzzle. And it really is. Thinking about binary strings as vertices of a high dimensional cube, with bit flips corresponding to edges, that actually comes up a lot, especially in coding theory, like the error correction stuff I referenced earlier. What's more, you often hear mathematicians talk about coloring things as a way to describe partitioning them into distinct sets. If you've ever heard of that hilariously enormous number grams constant, for example, the problem where that came up was also phrased in terms of assigning colors to a high dimensional cube, though in that case colors were given to pairs of vertices instead of individual ones. The point is, analyzing how to color a high dimensional cube is more of a transferable skill than you might expect. So to our question, can you make it so that every vertex has a red, a green, and a blue neighbor? Remember, this is the same thing as having an encoding for key locations so that you're always one flip away from communicating whichever location you want to. It would actually be enlightening if you paused the video and tried this now. It's like a weird three-dimensional variant of a sudoku. Very similar to sudoku's, in the sense that you want certain subsets to be filled with all three possible states. For example, you might start by painting one of the corners an arbitrary color, let's say red, so you know its three neighbors need to be red, green, and blue, doesn't really matter how you do it. And then maybe we move to the red neighbor and say that the other two adjacencies need to be green and blue, maybe we do it like this. But at least how I've drawn it here, you're stuck, you're unable to choose a correct color for the next two. Can you see why?
Proof that it's impossible
What I'd like to share is a lovely little argument that explains not only why this will never work in three dimensions, but also why it can't work in any dimension that's not a power of two. The idea is that the symmetry in the property that we're looking at will end up implying that there have to be an equal number of red, green, and blue vertices. But that would mean that there's eight-thirds of each, which is not possible. And before I go on, pause and see if you can think of a way to solidify that intuition. It's a fun exercise in turning a vague instinct into a solid proof. Alright, you ready? One way to do this is to imagine a process where you go through each corner and count how many of its neighbors are a particular color, say red. So, each step here, we're looking at the three neighbors of a given vertex, counting up the red ones, and adding that to a total tally. For this specific coloring, that count came out to be 12, but if we had the property we wanted, every corner would have exactly one red neighbor, so that count should be 8. On the other hand, every red corner is counted exactly three times, once for each instance where it's somebody's neighbor, so that final tally has to be three times the total number of red corners. So, you know, it's simple. Find a coloring where eight-thirds of the corners are red. Isn't that nice? Counting how many times some corner has a red neighbor is the same as counting how many times a red corner has some neighbor, and that's enough to get us a contradiction. What's also nice is that this argument immediately generalizes to higher dimensions. Think about solving the chessboard puzzle with n squares. Again, the puzzle is to associate each arrangement of coins with some state, some possible location for the key. And the goal is to make it so that the arrangements you can get to with one flip of a coin represent all possible states, all possible places the warden might have hidden that key. Even if you can't visualize most higher dimensional cubes, we can still talk about things like vertices of such a cube and their neighbors, basically as a way to describe bitstrings and the ones which are one bitflip away. Really, there's just two relevant facts you need to know. If you're standing at one of these vertices, you have n distinct neighbors, and the total number of vertices is 2 to the n, one for each bitstring of length n. From here, you can play the same game we did in three dimensions. You can go through each corner and count how many red neighbors it has. If it's possible to do the coloring we want, this sum should be 2 to the n, one for each vertex. On the other hand, each red corner is counted once for each of its neighbors, so that means that we need to end up with n times the total number of red corners. Since that left hand side is a power of 2, the right hand side also has to be a power of 2, which could only ever happen if n itself is some smaller power of 2. So for example, if we were in 4 dimensions, or 64 dimensions, there is no contradiction. It's at the very least possible to evenly divide the vertices among the different colors. To be clear, that is not the same thing as saying there necessarily is a solution for the power of 2 case, it's just that it can't be ruled out yet. To me, this is completely delightful. Just by imagining coloring the corners of a cube, and then counting how many there are, you can conclude that no possible strategy, no matter how clever you are, can work in all of the cases for this chessboard puzzle, if the number of squares isn't a power of 2. So even though it might seem to make it easier if you knock off a couple squares or reduce the size of the board, it actually makes the task hopeless. It also means that the solution to this puzzle, which I'll point you to in a moment, can be viewed as a particularly symmetric way to color the corners of a high dimensional cube in a way that's disallowed in most dimensions.
Proof that it's impossible
What I'd like to share is a lovely little argument that explains not only why this will never work in three dimensions, but also why it can't work in any dimension that's not a power of two. The idea is that the symmetry in the property that we're looking at will end up implying that there have to be an equal number of red, green, and blue vertices. But that would mean that there's eight-thirds of each, which is not possible. And before I go on, pause and see if you can think of a way to solidify that intuition. It's a fun exercise in turning a vague instinct into a solid proof. Alright, you ready? One way to do this is to imagine a process where you go through each corner and count how many of its neighbors are a particular color, say red. So, each step here, we're looking at the three neighbors of a given vertex, counting up the red ones, and adding that to a total tally. For this specific coloring, that count came out to be 12, but if we had the property we wanted, every corner would have exactly one red neighbor, so that count should be 8. On the other hand, every red corner is counted exactly three times, once for each instance where it's somebody's neighbor, so that final tally has to be three times the total number of red corners. So, you know, it's simple. Find a coloring where eight-thirds of the corners are red. Isn't that nice? Counting how many times some corner has a red neighbor is the same as counting how many times a red corner has some neighbor, and that's enough to get us a contradiction. What's also nice is that this argument immediately generalizes to higher dimensions. Think about solving the chessboard puzzle with n squares. Again, the puzzle is to associate each arrangement of coins with some state, some possible location for the key. And the goal is to make it so that the arrangements you can get to with one flip of a coin represent all possible states, all possible places the warden might have hidden that key. Even if you can't visualize most higher dimensional cubes, we can still talk about things like vertices of such a cube and their neighbors, basically as a way to describe bitstrings and the ones which are one bitflip away. Really, there's just two relevant facts you need to know. If you're standing at one of these vertices, you have n distinct neighbors, and the total number of vertices is 2 to the n, one for each bitstring of length n. From here, you can play the same game we did in three dimensions. You can go through each corner and count how many red neighbors it has. If it's possible to do the coloring we want, this sum should be 2 to the n, one for each vertex. On the other hand, each red corner is counted once for each of its neighbors, so that means that we need to end up with n times the total number of red corners. Since that left hand side is a power of 2, the right hand side also has to be a power of 2, which could only ever happen if n itself is some smaller power of 2. So for example, if we were in 4 dimensions, or 64 dimensions, there is no contradiction. It's at the very least possible to evenly divide the vertices among the different colors. To be clear, that is not the same thing as saying there necessarily is a solution for the power of 2 case, it's just that it can't be ruled out yet. To me, this is completely delightful. Just by imagining coloring the corners of a cube, and then counting how many there are, you can conclude that no possible strategy, no matter how clever you are, can work in all of the cases for this chessboard puzzle, if the number of squares isn't a power of 2. So even though it might seem to make it easier if you knock off a couple squares or reduce the size of the board, it actually makes the task hopeless. It also means that the solution to this puzzle, which I'll point you to in a moment, can be viewed as a particularly symmetric way to color the corners of a high dimensional cube in a way that's disallowed in most dimensions.
Explicit painting of the hypercube
And if you're curious, I just couldn't resist showing this explicitly for a 4-dimensional cube. So in the same way that you can take a 3d cube and kind of squish it down into 2 dimensions, maybe with a little perspective, and get the same graph structure for how the vertices and edges are all connected, we can do the same thing projecting a 4-dimensional cube into 3-dimensional space, and still get a complete view for how all of the vertices and edges are hooked together. If you wanted to try your hand at a weird sort of 4-dimensional cousin of a sudoku, you could pause right now and try to figure out how to color these vertices in such a way that each of the 4 neighbors of any one represent all 4 different colors. Using essentially the same computation that solves the chessboard puzzle for the 4-square case, I can get the computer to explicitly draw that out for us. And at this point, when you're hopefully burning to know what the actual solution is, I'd like you to hop on over to Stand Up Maths, where Matt and I show you how it works. If any of you are somehow not yet familiar with Stand Up Maths, it's one of my favorite channels run by people, so please do immediately subscribe once you land over there. I promise, you're in for quite a few delights with everything else he has to offer. Before explaining it, he and I simply walk through what it looks like for us to actually perform the solution, and as we do, I really want you to try thinking of the solution yourself, and to predict what it is we're doing before we tell you. And if you're curious about the connection with Hamming codes and error correction, I'm definitely game to make a video on that, just let me know in the comments. I've been told that as far as motivating puzzles go, not everyone is as interested in symmetrical ways to paint a 64-dimensional cube as I am. But reliable data transmission? Come on, I think we can all agree that that's universally sexy. you
Explicit painting of the hypercube
And if you're curious, I just couldn't resist showing this explicitly for a 4-dimensional cube. So in the same way that you can take a 3d cube and kind of squish it down into 2 dimensions, maybe with a little perspective, and get the same graph structure for how the vertices and edges are all connected, we can do the same thing projecting a 4-dimensional cube into 3-dimensional space, and still get a complete view for how all of the vertices and edges are hooked together. If you wanted to try your hand at a weird sort of 4-dimensional cousin of a sudoku, you could pause right now and try to figure out how to color these vertices in such a way that each of the 4 neighbors of any one represent all 4 different colors. Using essentially the same computation that solves the chessboard puzzle for the 4-square case, I can get the computer to explicitly draw that out for us. And at this point, when you're hopefully burning to know what the actual solution is, I'd like you to hop on over to Stand Up Maths, where Matt and I show you how it works. If any of you are somehow not yet familiar with Stand Up Maths, it's one of my favorite channels run by people, so please do immediately subscribe once you land over there. I promise, you're in for quite a few delights with everything else he has to offer. Before explaining it, he and I simply walk through what it looks like for us to actually perform the solution, and as we do, I really want you to try thinking of the solution yourself, and to predict what it is we're doing before we tell you. And if you're curious about the connection with Hamming codes and error correction, I'm definitely game to make a video on that, just let me know in the comments. I've been told that as far as motivating puzzles go, not everyone is as interested in symmetrical ways to paint a 64-dimensional cube as I am. But reliable data transmission? Come on, I think we can all agree that that's universally sexy. you