 where you have limited information and are trying to optimize correct guesses in some sense. So what's the setup? We're all in a prison, you know, and the warden gets there. Yeah, close the door. And we have a certain warden, I'm not saying that his name is Tom, who decides, well, I'm really sick of these prisoners. I'm a sadistic bastard. Let's play a game. What I'm going to do is I'm going to gather the prisoners around. I'm going to explain to them the game. So I'm going to place a hat on each of their heads. There's some number of colors of hats. Let's just say red and blue. I'm going to place a hat on each of their heads, send them out in a room, and have them guess the color of the hat that I placed on their heads, only by being able to look around at the hats on the other people. Of course, the rules of this game could change slightly. But of course, I'm going to allow the prisoners to get together and discuss a strategy. Of course, I'll be listening in on it. So there's a way to beat the strategy. They're not allowed to talk after they're in the room with hats. So after the hats are placed, no communication is allowed, unless there is communication allowed by the game. And what you'd like to do is like to maximize the number of correct guesses, because, you know, the warden is a pretty statistic bastard. He's going to kill anyone who guesses incorrectly, and he's going to let free whoever guesses correctly. But the prisoners kind of get together and they realize, well, there's no real way to make sure we save any one of us. So what we're going to try to do is optimize the number of correct guesses that can be possible. So let's start out with a really simple boring example. So let's suppose there are N people and K colors of hats. What's going to happen is everyone can see everyone else, but they're allowed to guess in sequential order. So we're going to guess sequentially. And this is probably a problem that most of you have heard sequentially. So everyone can hear all of the guesses made previously. But of course, you don't really know if they live or die. How many people can we guarantee to guess correctly? This is a problem that most of you have heard, namely it uses the parity check digit, right? Namely, we can save, so we can save N minus 1. The first person is essentially going to sacrifice themselves. So anytime that we have K colors of hats, we're just going to assume that they're the integers 1 through K and use a lot of modular arithmetic to do this. So the first player, so if person i receives, let's say, c sub i, well then the first player guesses the sum of c i, i not equal to 1, modulo K. This is a proper guess because he's guessing a hat color on himself, right? But because they're guessing sequentially, everyone else hears his guess. Now from that guess, along with being able to see everyone else, they're able to deduce the color of their own hat. Namely, c sub j is going to be equal to, well let's take the first player's guess, which is the sum of all over all i not equal to 1 of c sub i, minus the sum over all i not equal to 1 or j of c sub i. This is just pure modular, I guess I should be saying, mod K. So player i knows the guess, so he knows this sum, and he can see everyone else's hat color, so he's able to deduce his own color. So every other player guesses correctly. With n people, we can guarantee to save n minus 1 of them if we have a sequential guessing. Well why was that? It's because we were able to introduce extra information into the system. Namely, person 1 in coding theory, this is called parity check digit. So everyone not only has information about the rest of the code word, but they also have information, some sort of information about what they should be. Namely, I can check the sum module okay, and correct myself to that value. So this is boring because we can do well. We know the answer, it's all right. So how can I make the game more interesting? Well let's remove this extra piece of information. Let's not allow them to guess sequentially, but let's force them to guess simultaneously. So you might have to help these groups sometimes. But here's the first claim, n people, k colors and paths. We're going to guess simultaneously. Again, no other communication is allowed. Well I'm going to claim, so we want to come up with deterministic strategies. I guess this is one thing I should say. So we want deterministic strategies. So there's no randomness. In other words, every person is associated with a function such that upon observing everyone else's hat colors, their guess is determined. So there's no randomness in their guessing. So how well can any deterministic function do in this setting? Well let's analyze it by just some averaging for a second, you know. When you don't know what to do, expected value. Kind of rocks, right? Whatever. So let's imagine fixing a deterministic strategy and selecting a placement uniformly at random. What's the expected number of correct guesses? Well let's calculate. So the expected number of correct guesses is going to be equal to the sum, y equals 1 up to n, of the probability that person i is correct just by linearity of expectation. But these are deterministic functions. So what's the probability that person i is correct if the hat placement is chosen uniformly at random? 1 over k, right? So what we can imagine is selecting everyone else's hat colors first, except for person i's, and then randomly selecting his based on the other placement, his guess is determined, so the probability is correct is 1 over k. So this is equal to the sum. So by the law of averages, this implies that for every deterministic strategy there exists a placement of hats less than or equal to the floor of the hat. I get the word in the thing. Which we're assuming. The more it overhears any strategy and can do it. So what we want to do is we want to maximize the number of guaranteed correct guesses over any hat placement. So we can't do any better than the average. That's too bad. But what's the next natural question to say? Can we do it? Think about this. Let's start with a more simple case. Let's just suppose that we have two people. What if we have two people and two colors? So let's say like red and blue. So this averaging argument says that we can never guarantee to save more than one of them with any deterministic strategy. But can we guarantee one correct guess? You say no. I'm going to disagree with you. So yes we can. And let's think about this. We have two people. Now there are essentially four possibilities on how their hats are placed, right? Namely, they both have red. They both have blue. This guy has red. This guy has blue. Or this guy has blue. And this guy has red. So yes, there are four possibilities. But I claim there are really only two possibilities. Namely, they either are wearing the same color or they're wearing different colors. So what's a good strategy? Well, why don't we go to this guy and say, look at him and guess the same color that he's wearing. Now what does the other guy do? Guess it's the opposite color. One of them is guaranteed to be correct. Because either they're wearing the same color, in which case this guy's correct. Or they're wearing opposite colors, in which case this guy's correct. Fantastic. We've solved the case for two people, two colors of hats. I claim that this can be extrapolated very quickly to give a strategy of N over 2 for two colors of hats, right? How? Well, for N people, so this saves four N over 2 people because there might be one person like that. What does this do in the contest of two colors? This is just in two colors. So now we get, because the same opposite thing only works with two colors, right? Can we do something with more colors then? I claim that you can still do floor of N over K for K colors. And to do this, we're going to use some modular technique. It's very similar to the first thing. So, here's what we're going to do. So now for K colors. Let's group them together into sets, each of sides roughly, so in other words, take a balanced partition. Every group has either floor N over K or ceiling N over K people. Now what we're going to tell to each group is to assume something about the total collection of hats. These guys are going to assume that the sum of the hats is congruent to zero. These guys assume that the sum of the hats is congruent to one mod K. These guys, the sum, is congruent to two. So on and so forth, the last guy, the sum, is congruent to K minus one. So what are you going to guess? You're going to look at everyone else's hat color, and use your assumption and extrapolate what color your hat is. Namely, if someone in here sees a sum of five, they're going to guess whatever hat color gets that sum to be zero with their own hat. So they're going to guess zero minus five mod K. How many people are correct in this strategy? Floor of N over K. Simply because one of these groups must all be correct, because the sum is actually going to be something. Make sense? Fantastic. So in this case, we're able to get the exact answer. Simultaneous guessing and people K colors of hats. We know exactly how many we can save with a simple strategy. Note that this strategy seems slightly different, right? But it can be actually phrased in the same way. Namely, there's a different way to describe a similar strategy, slightly different. Namely, what you do is you group everyone into sets of size K, have them only look at each other and assume that the sum is either congruent to zero, one, two, three up to K minus one inside of that cluster. And that's the nice way to generalize this strategy. So there are a couple of very slightly different strategies that can get the same thing. We answer that question. We need a new question. I mean the warning is feeling extra besides, well, I have this labyrinth sitting here, you know, in the middle of CMU's campus. In Pennsylvania. What if I position them in certain places so only some people can see each other and other people can't? This is where we'll introduce the notion of a sight graph. So G is a sight graph. What this means, it means and J can see each other or to have some sort of graph here. What does this mean? These two people can look at each other's hats. These two people can look at their hats. But these two guys can't see each other. Do sight graphs need to be directed? We'll deal with the directed case in a second. So right here, I'm going to assume I'm directing. We'll deal with the directed case. In fact, I'm going to specialize slightly more in a second. So I don't care what the graph is. It's simply saying this is how you can see each other. It doesn't have to be plain or maybe the labyrinth has different levels. So let's just talk about two colors of hats for a second. So what's prisoners know how they will be placed? Yes, they do. Because their nodes are already labeled. So this is one, two, three, four, five. So that's why I say, ground set on brackenet. So the prisoners are already labeled. And they know they're labeled. It'd be interesting to see if they don't know. My guess is that you could not do well because then you have the, depending on the graph, you could make certain graphs you could do. You could do just as well. Like if you had a star graph, you'll be able to do just as well as I'm about to say. Okay. So let's do a little definition. Def H2G, the two-color hat number. This is the max correct guesses guaranteed. What we were talking about at first, our earlier example will show the K-color hat number of KN is exactly four. That's what we showed earlier. So KN, the complete graph, everyone can see everyone else. This is what we just argued. Let's think about the two colors for instance. What's H2? I think there's something silly we can do using what we had said earlier, right? Namely, the two-person strategy. It's an easier way to get the two-person strategy to give you a lower bound. Oh, so if G is a matching, well, or just the largest matching, right? Okay. So let's do that. So let's let M of G be the max number of edges. If that's the case, we actually have that H2 of G is at least the matching number. Pair people up across the edges of this matching. Once everyone's paired up, we know that for every single pair we get exactly one correct guess. Can we do any better? So how do I have to show that it's actually equal? What I have to show is that for any deterministic strategy, there's a way to place the hats such that no more than the matching number are correct. That seems a bit difficult. It's not too bad. So I'm going to use two facts. One is the fact that we said earlier about the complete graph that there's always a way to place hats on the complete graph so that no more than floor N over two feet are correct. I'm also going to use an extra thing. Namely, we're going to rely, I don't know what this is, that's okay, I barely do too. What the top-burge formula says is we can calculate the matching number of a graph by just looking at what happens with certain components. So let's define, so for u, a subset of the vertices of g, of g minus u, let this be the number, so namely, if I have a graph and I take out a certain set, that's going to leave me with certain connected components, right? And I'm only going to care about the ones that have an odd number of vertices. So what the top-burge formula says, and I'll have to read this because I never remember exactly, the purge tells you that the matching number of a graph is equal to one-half the minimum over u subset of v, the size of u, minus the number of odd components of g take away u, plus the total number of vertices of v. So it's easy to see that this is an upper bound, namely because if I take away a certain set and look at the number of odd components, the number of matching edges I can have in an odd component, there has to be one guy left over that could possibly be paired up with u. So kind of u minus odd is kind of how many vertices of u are taken up and then the rest of them get paired up. And it turns out there is an equality. So how are we going to use this to come up with a strategy? Well, actually, we're going to do something. Then we're actually going to tell the prisoner some extra information just to make our lives easier. So fix u subset of v achieving the minimum. So how does this break up our graph? Well, we have our site graph g. We have our set u. And upon removing it, we get a bunch of clusters. We get a bunch of components. Some of them are even. I'll call those e1, e2s through like el. And some of them are odd size. So o1, o2 through like, I don't know, o, m, sure. Now, of course, u may have some edges to some of these, maybe not others, maybe lots of edges. Who knows? But once I remove u, I know that I get some even component, some odd components. And odd of g minus u is exactly n. So n equals odd. So what am I going to do as the adversary? I'm actually going to tell my prisoners a little bit more. I'm going to tell them that I'm going to break up the graph like this before they build their strategy. And in fact, I'm going to tell them that everyone here is blue. Well, that seems silly, right? Now, size of you many people already know their color of hats. All right, what else am I going to do? Well, I'm going to use the complete graph strategy. Namely, now that everyone here knows what their hat says, and so does everyone else, the guys who can see someone here, that doesn't matter, it doesn't help them. So now if I were to remove u, the strategy must operate in the same way, because they get no information from u. So what I'm going to do is I'm going to place optimal hat strategies. So place by optimized mean, pretend it's a complete graph, and place a hat guessing such that, based on their strategy, gets floor of n over k, at most floor of n over k. So let's calculate. So, number of correct guesses is at most the size of u because everyone's correct on u, plus the sum from i equals 1 up to, I said l, of the size of e i over 2, plus, that's because these are even components, plus the sum from j equals 1 up to m. Well, these guys are odd size. Even extra minus 1. Let's see here. So here we get size of u plus, well, if I kind of, let's say, plus a half, now if I add up all of the evens and the odd components, well, that's all the vertices except for the ones in u, right? So I would get size of v minus size of u, but I also get an extra minus 1 for each component. So minus odd of g, g minus u. And now if I just pull the u inside, this is one half size of u minus odd, which we know is equal to, so two colors of hats, an undirected sight graph, we know the answer. Now there may be lots of different strategies to achieve this, but the easiest one is find matching a pair. Which also says you can find a poly-time strategy, right? To find you're matching this poly-time. It's gross poly-time, but you can do it. All right, well, this is only two colors. We'll talk about k colors in a second. But let's first make our sight graph slightly more. Tom, I mean, Warden, Warden person, he's truly an extra-synistic and also got a bunch of one-way mirrors to help with the present. He's gonna add those into our labyrinth now. If he adds one-way mirrors, namely, what if the sight graph is now directed? Well, if I have some u and v, this type of edge means u can see v, but maybe not the other way around. Unless I can have bi-directed edges, right? But an edge pointing just says, I can see your color of hat, but you might not be able to see mine. One-way mirrors. Now how well can I do? Just two colors. Let's just again stick to two colors. What's h2o g? Unfortunately, I don't know the answer in this case. But I can give you two bounds, and I can show you that neither of these bounds are correct. Counter examples to both of them, one of which is easy, the other one I have to try to reconstruct it and I don't want to. But I can show you the graph. I just don't remember the strategy because there's something with like a hamming code. So the first thing I can give you is a lower bound. A lower bound of the max number of disjoint dice cycles. By dice cycles, I mean a directed cycle, on the directed sense and not a cycle in the undirected sense. How can you get this as a lower bound? So we have to give a strategy, right? Namely, the lower bound, we could give a strategy if we could show for every dice cycle we get one correct guess. So why is that true? What's a strategy if I have a directed cycle, which could be a two cycle, right? Namely, a two cycle. Oh, dice cycle. I thought dice cycles are for new two. Any dice cycle. So this does count as a dice cycle. That is a dice cycle. But in general, I mean this. What's a strategy to guarantee one correct guess on this guy? Well, why don't I have this guy guess the opposite color? This guy guess the opposite. Again, remember, we're only two colors here. This guy's opposite. This guy's opposite. This guy's opposite. And this guy's the same. This is kind of the natural generalization of what we did with the two cycle, right? We had one guy guess opposite, one guy guess the same. So why does this work? Well, let's suppose without loss of generality, without loss of generality, that guy's had his red. But he guesses and he's wrong. Then what color must this guy's happy? Because if it were blue, he would be correct. Okay, but this guy's wrong too. Red. This guy's wrong. Red. So if every one of the opposites are incorrect, the same is correct. So we're happy. We get one correct guess per dice cycle in this sense. And that's why, of course, that they're disjoint in the vertex sense, right? So that means for every one of these dice cycles, we get one correct guess. We do better than this in certain cases though. But let's give you an upper bound. The best upper bound I can give you is the minimum over the size of you, such that you as a subset of the vertices and every dice cycle intersects. It's the best upper bound I can give you. So by intersects, I mean it just shares the vertex with you. So how do I prove that this is an upper bound? Well, again, if you show me no matter what strategy, I can come up with a placement of hats. So what's true? This condition actually tells me something slightly more. So if you is in that condition, then g take away u is a transitive diagram. The transitive is an acyclic. It has no more directed cycles because every single directed cycle had to hit u. So acyclic means that I can actually order the vertices so that every edge points to the left. You can't get any. So if there are no dice cycles, you can't get any. Yes? So the upper bound is not valid? No, the upper bound is valid. Because there would be zero, right? So if the graph is already acyclic, then the minimum size of u that you have to remove is zero. So you can't get any correct guesses in that case. Yeah, there's no feedback, right? I can see someone else, but like, there's no way to cycle around and force correct guesses because there's no extra information added into the system. So we'll prove it, and maybe when we prove it, you'll see why this is the case. So here's my u. And here's g minus u. So what I know is that if I look at an edge from g minus u, if I look at this, I can order it so that every single edge that's inside of g minus u points to the left because it's acyclic. I can come up with some order. Great. So that means that the only edges that go this way have to come out of u, right? There are many that could go into u. But all I know is that there's no that. So what am I going to do? Let's give all of these guys away. So I'm going to claim that I can force everyone else to be wrong. So let's look at this first person. He only sees people inside of you. So I know what he's going to guess because I have his strategy. So I give him something else. He's wrong. Great. Because he doesn't see anyone back here, so their hats don't matter. All right, now I go to the next person. He might see that guy, but also only sees guys to his left. All the hats are already placed. I know what he's going to guess. I'm making the guess wrong. And I continue. This guy only sees people to his left. All those hats are placed. So his guess is fixed. I make him guess wrong. Everyone else is wrong. So this is exactly how you could do it. If he was empty, right? Namely, the first guy, he doesn't see anyone, so he just always has to guess the same color because it's deterministic, right? So I give him something different, and I just continue down the line. Cool. So I can give you these two bounds. Both of them are wrong. For example, I think the upper bound is easy to show that it's wrong is consider the triangle, this triangle. So what's the size of the U that intersects every dice cycle? It's two, right? But I can only guarantee one correct guess because this is the same as the undirected k3, right? To show that the lower bound that you can do better, I'll give you the graph and leave it to you to come up with a strategy. So to show that the lower bound you can actually do better than it, I present you with this graph. So let's first see, what's the next number of disjoint cycles? Well, you can actually get two correct guesses. Based on what you do is you go around the outside and then you attempt to get one. And then what you do, so you can do the same opposite guessing around the outside. So what do you know? Either only one person is correct or I think you can guarantee that three of them are correct. So what you do is you say either one is correct or three are correct. So the guy in the middle was going to assume that only one is correct and it'll be the case that if one is correct, then he is correct as well. So the way to do it is some just handling distances. I remember coming up with it at one point. So neither of these bounds are correct. So I pose the question, what's the correct answer for all digraphs? Just with two colors. Okay, I'm going quickly, I still have a while. So let's talk about, let's talk about K colors for a second and then let's talk a little bit about what these strategies look like. Like how you can talk about all those strategies. So how can we generalize these? How can I generalize this lower bound? Well, let's say that again, G is underwrite. What's a lower bound on HK or G? There's an easy lower bound, max number of disjoint KKs, right? That's a natural generalization of the matching bound, right? We said find a matching, pair up over this edge, you get one correct S for edge. How do we get one correct S per clique of size K, right? Namely, do the modulo arithmetic trick inside of that clique. Can you do better? Is this the correct answer? I don't know, yeah. This is just entirely on a whim, but maybe instead of KKs, like grass which are critical for having chromatic number K? Oh, I actually don't know, that's an interesting question. Because I'm going to give you an example. But maybe if you have, so you're saying if you're K critical, then you also can guarantee one correct S with KKs. I knew it, that's an interesting question. I'm just throwing a K in somewhere. Yeah, yeah, you're throwing a K. So I don't know the correct answer here, no clue. But I will tell you one thing, you can definitely do better than this. And I'll give you an example. So you can do better. In fact, I'll give you a particular graph with no KKs and show that I can get one correct guess. So let G be the following graph. It's going to be a bipartite graph, okay? So complete bipartite, we have every possible edge. One side has size K minus 1. The other side has size K to the K to the K minus 1. So of course, it has to be at least this large. My guess, you can do much, much better than this but I was trying to come up with an example where we could have a bipartite graph get at least one correct guess for K colors. And this is what I could do. My guess is you can do much, much better. How does that go for this one? All right, let's discuss the strategy shall we? K colors. So my claim is that Hp of G is at least 1. Even though there are no KKs, here's what we're going to do and you'll see where the sizes come from. Let's let C be the collection of all K colorings. So let's give these guys some names. This guy is L, this guy is R. The left and the right are sizes. So again, it's complete bipartite. There are no edges inside the parts. So all K colorings, left hand side. Okay, let's let C be that. Well, what we're going to do is we're going to biject, we're going to biject it with all functions from C to bracket K. So X is going to be mapped to some fx. So in other words, every person gets a function, which is a function that goes from the set of colorings at the left hand side to a certain hat color. No response to your K. So what's the strategy on the right hand side? Cl is the coloring of the left, guesses f sub x of Cn. So it just applies this function to whatever coloring it is. It gives him a guess. But what if no one's right? And I want to claim that I can construct a strategy on the left hand side that if no one on the right hand side is correct, one of them are correct. So how can we do it? Well, I want to start out with a small client, a little mini client. And this is the following. A coloring C R of R. So fix the coloring of the right hand side. And let, let's say just like script C of C R, I don't know, bad notation. Equal the set of all C L in C such that no one on the right is correct. So I have some coloring to the right hand side and I want to look at all the colorings at the left hand side so that no one on the right is correct. My claim is that the size of this set is at most K minus one. I'll prove this in a second after I describe to you the strategy. So everyone on the left hand side knows what the coloring on the right hand side is and is able to construct this set. Namely, let's say that C of C sub R is C one, the set C one, C two up to some C K minus one. It might not be all K minus one. If L is the set like P one through P K minus one, PI is just going to guess C, the Ith position. So in other words, person I is going to look at the coloring I and it's going to say well what would my coloring be in this guy and going to guess. So one of them must be correct. Okay? Is everyone happy with this? All right, now it just suffices to prove this little mini claim. Well, suppose at C one through C K coloring C one. What is true on the left, on the right hand side is I have every single possible function from the set of colorines at the left hand side. So what we know is that there exists some X in R such that F sub X of C I is different from X of C J from the J. Simply because there's some function that takes this guy, takes that color one, this guy to color two, so on and so forth, right? In fact, let's just say that there exists an X for which F of X of C I equals I but C R is fixed. So we must have been corrected. X, C R of X is equal to some color. So there must be one of these that is actually correct, namely for whatever eye that is. And that's not possible, right? Is everyone happy with this? So, very convoluted strategy, but it tells you that looking for disjoint KKs is not the right thing to do. My guess, you can do much, much better than this. That would certainly help so. K to the K to the K minus one is there. We have a few more minutes. Let's talk a little bit about the structure of these strategies. So let's go back to no sight graph so everyone can see everyone else. So go back. So what I'm going to claim is the following, and I want to give a couple different proofs of it. One of which I think is enlightening for the two-color case. The other one, which is just kind of silly, but it works. So be an optimal strategy. Well, I guess FX, X, you know, equals one up to N, right? Each person has their own strategy. An optimal strategy. Any colors? Ask is if a hat placement is chosen uniformly at random, what's the probability that a person guesses an individual hat? So the probability that person I guesses colors C. So in other words, I can ask, is there any bias? Is any one person more likely to choose red over blue? That's my question. It turns out that no if we have good divisibility. So in an optimal strategy, let's do this for K colors and K divides N, then this is exactly one over N. There is no bias in choosing one color over another. Seems reasonable, right? Something that should happen. So it's easy to prove just by some conditional probabilities and using the fact that, well, it's an optimal strategy, but at least N over K correct guesses, right? So you can use some conditional probabilities. We'll do it if there's time in. But I want to prove this and also give a little bit of an illusion to some extra structure from the two-color case. So let's talk about the two-color case a little bit. I want to say that it's equivalent to another problem. Namely, let HN be the hamming cube. In other words, every single vertex is a 0, one vector of length N, and I connect two if they're different in exactly one place. My claim is that any strategy for the two-color case to an orientation, so in other words, I go to every edge and I decide to direct that edge in one way or another. Well, why is this? Well, when is there an edge? There's an edge in the hamming cube, so I have one vertex and another, and this guy has something of 1 and then something else in position i, and this guy has a 0 in position. Yes? That's what our hamming cube is. Now, pretend that I am person i, and I see everyone else's color. That actually points me to an edge of the hamming graph, the hamming cube. Namely, I see everyone except for myself, so I know every other bit of this coloring except for my O. So I go to this edge, and what does the strategy tell me? It tells me whether to pick red or blue. So, namely, if I went that way, I would pick 1, which is maybe red, and if it were directed this direction, I would pick 0 or blue. So every strategy is equivalent to orienting the hamming cube. Namely, each person can find an edge of the hamming cube that they belong to, and then pick whichever edge is at the head of that. Pick whichever vertex is at the head. So these are equivalent. Do you agree? Yes? Go through this one more time. I am person i. So hn is just 2 to the n. Yes. And the graph is just 1 bit the jc. Yes. Okay. So every edge is, they're the same except in position i. One has a 1 in position i, and the other has a 0 in position i. So I don't know position i, but I know everything else. That gives me an edge of the hamming graph, right? So for every coloring is going to... To be a vertex. Every coloring is a vertex with 1s and 0s. The person is going to pick... Well, so yeah, every person figures out the edge because they know all except for one bit of this vector. And then the orientation of the edge tells them which one to select. And vice versa. If I have any strategy, I can go to each edge and see what would person i pick in this position. So what does this mean? This says that... What's the max number of correct guesses? Well, that's the maximum over... So what is the... Sorry. If I give you a strategy, that's an orientation of these edges. So what's the maximum... What's the number of correct guesses guaranteed? Well, that's the minimum in degree. Because the in degree is the number of correct guesses if I map that vertex, right? Because those are the number of people that are actually going to say, I think we're in this place. So what I'm trying to do is I'm trying to orient in this case. So let's prove... So I claim that this is easy to prove just by some conditional probabilities. But I want to prove it by using this equivalence here in the case of k equals 2. In degree is a vector. Look at the ones that are pointing to it. That's its in degree. So I look at every vertex and I say, what's the smallest in degree I see? And what's the... And then I can ask myself, well, what's the best hack placement? Oh, I go to the vertex that has the smallest in degree and I place that hack placement. That's the best strategy for your adversary, right? Because the number of correct guesses is the number of guys pointing to this guy, right? Because everyone else, if I place down that, everyone's going to get an edge and if it's pointing away, they're going to make an incorrect guess. And if it's pointing toward it, they make a correct guess. Does that make sense? Everyone happy with this? So I'm going to use a little bit of graph theory. So suppose that 2 divides n for an instance. That's what I claimed. And optimally, the claim that each person is as likely to guess... I want to claim that each person is just as likely to guess one as they are to guess zero, which is the same as this. So what does this mean? Well, we're optimally oriented, so that means that every single vertex has exactly n over 2 n's. At most, but exactly because n2 divides n. So 2 divides n tells us that degree in and v equals degree out at v n over 2 for every v. So there's a famous theorem, math dating back hundreds of years, Euler's theorem, which says that if I have this condition of a digraph where n degree equals out degree at every vertex, then I can find a so-called Euler trail. I can find a closed circuit that visits every edge exactly once in the correct direction. So let's find an Euler circuit. This is a way to reverse every edge in its correct direction exactly once and wind up at where you start. So I'll go back to, I don't know, 1500 for the proof. I don't know if that's that old. Isn't that old? Is it 17? I don't know where it existed. Okay, 15 is needed. Yes, no question. Alright, so now let's look at person i. Put the hand, let's break up hn in the following line. Here I'm going to say that the i-th coordinate is zero. And these are the ones where the i-th coordinate equals zero. Now there are some edges in here. There are some edges going this way. Some edges going that way between the two of them. We'll note that this edge corresponds to a guess of color i for, sorry, guess of color 1 for person i. This edge corresponds to a guess of color 0 for person i. But I have an Euler trail. Sorry, Euler circuit. Which means I cover every edge exactly once and wind up back where I started. So the Euler circuit means that the number of ups is up because the two sides have the same size. So the probability of me guessing 1 is the same as the probability of me guessing. So again, I like this group. In fact, we can now talk about slightly more complicated versions of the half guess of the game. And I want to use this orientation of the hamming cube to do it. So let's pretend we're in this case. We have three people and two colors. Well, so right away we know that we can't guarantee to save what we didn't want it from, right? And that's optimal. But the Warden made a mistake. What was the mistake? Warden forgot to bring enough hats. In particular, he only brought two reds and two blues. So not everyone can be wearing the same color. How many correct guesses? And they guarantee now. Well, let's think about a reason. Let's try to think about it by averaging and kind of that. Let's get an intuition here. Well, one person sees two of the same color. So they automatically know their hat color, right? Okay, so we get one correct guess right off the bat. And the other two essentially have a 50% chance of guessing correctly, right? So we might expect there to be two correct guesses possible. I mean, we can. Now you're changing your hat. And I want to explain, I want to say there are only two strategies at work. And I can prove that with a Hamming cube. But first I want to describe a super simple strategy. Okay? Mainly, let's take these three people and just have them all guess the opposite of what they see. I claim this gets two. Why? We're an odd cycle. One color is different than the other two. So there are two switches. So if I look at the sequence between hat colors as I travel these edges, I switch exactly twice. Those two people are correct. And I want to claim that this is essentially all you can do. Any strategy is going to look like this or look like the reverse look to your right. Well, how can I prove that? Let's look at our Hamming cube. We have three people. So we're looking at the Hamming cube of order three. Oh, I should start labeling my first. Zero, zero, zero, one, one, one. Let's see here. This one will be one, zero, zero. Zero, one, zero, zero, zero, one. And I guess this person is one, one, zero. I want this person to be zero, one, one. There's my Hamming cube. I know that not all three can be correct. So let's try orienting our graph to give us an optimal strategy. These edges are clearly going to go like this. Because if one person sees the other two people being one, they're automatically going to guess that their hat color is zero, right? It's the best thing to do. No one is correct if guessing that all three are the same. Similarly, these are going to be oriented. So what do I have to do to guarantee two correct guesses? Is I have to make sure that along this inner cycle, everything has in degree exactly one. That's only possible in two ways. Mainly, I orient the cycle going this way, or I orient it going the other way, because it's a cycle. So in fact, every single possible strategy for this problem is essentially the same. It either corresponds to orienting the cycle in the clockwise direction or the anti-clockwise direction. Pretty cool. I might as well stop there. I mean, I've said a lot of stuff. I don't want to talk about any of the hat-guessing games. Kind of interesting. But I actually have a choice of eight. But I like it. I like the actually the finite choice. Any other questions about anything? Any thoughts on... So if you're going to try to do this hamming thing for multiple colors, it's not quite like you have a hypergraph and you're picking one point from every... Yeah, so essentially then it's... So that becomes like a selection type process, right? So what you want to do is you can describe the K-color guy as saying, well, now let's take the hamming cube with K and an alphabet of size K and N letters. Now an edge corresponds to... Yeah, it would be a hyper edge right along any kind of cycle where the height of movement is different. What you want to say is for each of these edges I want to pick one of the vertices, which is the correct guess. So what do you want to say is you want to maximize... So you can look at the minimum number of times at any given state is selected and you want to maximize this number, right? So that would be the natural analog but that doesn't seem easy, right? Hypergraphs are hard. Hypergraph land is sat face land. But yeah, there is an analog to prove like that probability that I guess like color C... Did you say sat face like sat face? Sat face land. That's why they're sat is because it's sat. True, true. All right, anything else? But yeah, the probability that it's one over K... It's simple conditional probabilities, like I don't know how to do it with like an orientation. There's nothing nice about hypergraphs.