 Welcome back to our lecture series Math 31-20, Transition to Advanced Mathematics for Students at Suddington University. As usual, be a professor today, Dr. Andrew Misseldine. In lecture 17, we want to talk about the so-called Pigeon-Hole Principle. Now, to understand what this is, because I mean, this is yet another counting principle, we've already introduced the additive, the subtraction, counting principle, multiplication, division counting principle, and so as we reach the near end of our combinatorial unit, we want to introduce this Pigeon-Hole Principle. So to explain why it's called the Pigeon-Hole Principle, imagine you as a hobby are raising pigeons on the roof of your apartment building. You have a pigeon coop where it houses 12 distinct pigeon holes. Now at first, you don't have a lot of pigeons. Only four of them seem to be roosting inside of your pigeon coop. And therefore, since you have four pigeons in the coop, there are several pigeon holes which are left empty. Well, after a while, you show the pigeons such good hospitality that other pigeons in town catch onto what you're doing here and they're gonna start flocking over to your coop. And so shortly later, you're now raising 13 pigeons inside of your pigeon coop. Well, remember, you only had 12 holes in your pigeon coop. So now, while previously we knew some of the pigeon holes were empty, on the other hand, because now we have more pigeons than pigeon holes, it must be true that at least one of the holes is housing more than one pigeon. And so this idea, this little analogy I gave to you is where the so-called pigeon hole principle comes from. Now I'm gonna frame it, and as you can see here on the screen, theorem 391, I'm gonna frame it using combinatorial terms and not the pigeons anymore. Suppose that we have n objects that are placed into k boxes. A many combinatorial problems we've considered are about things like this, placing objects into boxes and such. Now the first principle we saw was if you have fewer objects than boxes, then at least one of the boxes has to be empty. If you only have four pigeons and 12 holes, then at least one hole is going to be empty. We, in fact, can do better than that. We knew there are a lot of the holes that are gonna be empty with 12 holes and four pigeons, right? We knew eight of the holes had to be empty. But the baseline here is that if you have fewer pigeons than pigeon holes, one of the pigeon's holes will be empty. Now, conversely, if n is greater than k, then at least one box contains more than one object. If you have more pigeons than pigeon holes, then there's gotta be a hole with two pigeons in it. We had 13 pigeons earlier with 12 holes. There had to be a hole with two pigeons in it. There could be more than one because some of the holes could still be empty. Be aware, but that's the principle that the pigeonhole principle is trying to give us. The idea behind the pigeonhole principle is that if you have n plus one pigeons, have to make sure I spell this right. I'm used to spelling pigeon or pidgeot or something like that. If you have n plus one pigeons that are placed into n pigeonholes, then at least two pigeons will have to share a pigeonhole, in particular, whenever you have more pigeons than holes, at least one hole is gonna have two pigeons in it. And like we also said, there are circumstances where we can guarantee that a hole is empty. Now, this is a fundamentally simple principle. Most of the counting principles we've introduced in this unit have been relatively simple, but like all of those counting principles, if used correctly, it can be a very valuable tool to help you solve many commentarial problems. We'll just look at a few in this video here. So consider we're given a group of at least 13 people, then at least two of those individuals have to share the same birth month, all right? So there's only 12 months in the year and so I have 13 people, everyone's born in a month. If you have 13 people and you have 12 months, you think of the 13 people as your 13 pigeons and the 12 months of the year, your 12 boxes, your 12 pigeonholes, then at least one box will have two pigeons inside of it. And so they have to share a birth month of some kind. Let's look at the second one here. If a pile of clean laundry contains exactly 10 pairs of socks, at most 11 socks will be found before a matching pair of socks is found. You can think of the 10 pairs of socks as your 10 pigeonholes. Now, each pair of socks is two socks, there's 20 socks total. So as you're randomly drawing socks from this laundry pile, then those are your 20 pigeons you're getting. By the 11th pigeon, you're gonna have to have a box containing two pigeons at that point. So at most only 11 socks would have to be drawn a little over than half because they come in pairs. All right, let's look at one that feels a little bit more mathematical and is a little bit more sophisticated as well for which we can still leverage the pigeonhole principle to see how this is a useful counting principle here. Suppose a subset A of size N plus one is selected from the set X, which X contains the positive integers one, two, three, four up to two N. Then I claim that there's at least two integers in A such that one divides the other. So with this collection of integers, if I take a subset, so I'm not taking the whole set, I'm taking a subset of size N plus one. So it's a little bit bigger than half. No matter how I choose that subset, it's a randomly selected subset, there will be one number that divides the other. And so to see that, we're gonna turn this into a pigeonhole problem. All of the integers X that can, all integers can be factored in the following format. You have an integer X, you can take away all the powers of two that divide it and then you're left with some odd integer, like so. So for example, if your number is itself an odd number, X might just be like five. Well, that's all you get. You get two to the zero times five, no big deal. But we could take a number like say X equals 12 for which we can factor off all the powers of two, which would be two squared, you're left with a three. And that's how we can factor. Every integer has a unique factorization in this regard where you take away all of the powers of two and you're left with an odd factor, which we're gonna call Y. And so this Y is gonna help us with this pigeonhole situation. Let's look at the set of odd integers that are contained inside of the set X right here. So we have one, three, five, up to two N minus one. Clearly two N is an even number. So two N minus one will be an odd number. These are the odd numbers that live underneath X. And it turns out that these numbers, one, three, five, up to two N minus one, represent all of the possibilities you can get for Y. Because X, as we chose X out of the set capital X, X itself could be an odd integer. So it's just one of these numbers. And so there's no powers of two right there. But if there is some power of two that's non-trivial, then Y would have to be a odd integer still, but it has to be a smaller one because it is less than two N. So again, it would be one of these numbers right here. So all of the choices for Y are going to be one of those odd integers. Now there's only gonna be N options for these odd integers Y. And so these are gonna represent the pigeonholes in our situation. We're gonna have N pigeonholes for Y, but we're gonna select N plus one pigeons randomly. And that's how we're gonna use the pigeonhole principle in this exercise right here. So as there's at least two integers in A, since you chose as you chose N minus one integers and you only have N options for Y, you're gonna have to have a selected at least two integers to have the exact same Y factor. And for this, when we choose these Xs, right? There's two pigeons in the same hole. Select that pigeonhole and look at those two pigeons. They would have to look like two to the N and two to the N times Y and two to the M times Y, which Y of course is the exact same odd integer. And depending on who's bigger, who's bigger N or M, I'm not sure, but if N is less than or equal to M, it can't be equal because then the number would be the same. If we say that N is less than M, that means that two to the N, Y will divide two to the M, Y, which means that this first number X one must have divided the other one X two. And again, this is a consequence of the pigeonhole principle. We were able to find N many pigeonholes, but we have N plus one many pigeons, which then forces there to be a pigeonhole with two pigeons in it. Which is kind of, if you think about it, it's kind of an impressive result that if we take a random subset, there has to be some type of divisibility going on there that's guaranteed. Now what I wanna do next is actually generalize the pigeonhole principle to a stronger version than we saw previously, but in order to do that, we have to introduce two new functions which we may or may not have seen before. We have not seen it before in this lecture series. So let's introduce it now. This is an appropriate time to do so. If X is a real number, then we say that the floor of X, which is typically denoted in the following way, you're gonna draw a left and right bracket, but this bracket will only have a bend at the very bottom. There's nothing on the top of these things. It's comparatively straight, but there's a bend at the bottom. The bottom is where our floor is, like if we're in a building, and that's to suggest the name here. We have this floor, which is a number associated to X. The floor is gonna be the largest integer. So this is in fact an integer, even though X was a real number, the floor of a real number is an integer. It's gonna be the largest integer that's less than or equal to X, all right? So in particular, the floor of X is an integer. It'll be less than or equal to it, but we also said it's the largest integer with this property. So if there exists some integer N, such that N is less than or equal to X, then N is less than or equal to the floor. So it's the largest integer that is less than the number itself. Now, I have some examples of this, but we'll look at it in just a second. Before we do that, I wanted to introduce the counterpart of the floor function, which is the ceiling function. If X is still a real number, the ceiling of X, which we denote it similar like this, you have these square brackets to the left and right of X, but again, we only include the bend at the ceiling of the number, nothing on the bottom, to suggest we're taking the ceiling of the number. And so the ceiling of X is defined similarly to be like the floor of X, but this time we're looking for the smallest integer that is greater than or equal to X, all right? The floor was the largest integer less than, but the ceiling is the smallest integer greater than or equal to X. So in particular, the ceiling, just like the floor is an integer, even if X is a real number, the ceiling will always be greater than or equal to X. And in particular, if there's any other integer N, that's greater than or equal to X, then N will be greater than or equal to the ceiling, because again, the ceiling is gonna be the least upper bound of integers to your real number, while the floor is the greatest lower bound to all of the integers associated to that real number. So let's look at some examples of this. So we'll do some floors over here. So if I give you the real number, 9.31, the floor of that number is just nine. Nine is the largest integer that is less than 9.31. If we take the fraction 10 over four, now you might have to think about that for a second. Four goes into 10 two times, and then there's a remainder, but actually the remainder doesn't matter when you're computing the floor, because the floor is gonna take the smallest, the largest integer less than it. So if four goes into 10 two times with some remainder, the floor has got to be two in that situation, okay? Because the floor basically always rounds down the number. So like we had 9.31, we rounded down. And this one we had 10.4, which of course I should mention is the same thing as five over two. And it's more specifically, if you prefer the decimal expansion, this is 2.5, right? Whoops. Like so. So this is why we round down the floor, it's always gonna round down. Now if you take the floor of an integer itself, by definition, we're looking for the largest integer, which is less than or equal to. So if you have an integer, the floor of the integer is equal to itself. So the floor of seven is equal to seven. Now I have to caution you, some people get this a little bit confused. When you consider a negative number, the idea of the floor is to always round it down. Now rounding it down does not mean you forget the decimal, it means you go to the next lower integer. So by definition, the floor of negative 9.31 would be negative 10. Negative 10 is the largest integer, which is less than negative 9.31. So the floor is not equal to negative nine, which some people might erroneously think because they're like, oh, I just truncated, I just remove the decimal. No, negative nine is actually not less than x in this situation. Negative nine is not less than negative 9.31. And so it's not eligible to be the floor of the number there, okay? So then let's also consider ceilings, right? If you can do floors, you can do ceilings, it's basically the same calculation. If you take the ceiling of 9.31, that would round up to be 10. If you take the ceiling of 10 fourths, remember that's the same thing as 2.5, that will then round up to three. Three is the smallest integer greater than 10 fourths. If you take the ceiling of an integer itself, you'll get back that integer. So the ceiling of seven is seven. And like we saw before with negatives, I have to be a little bit more careful, right? The ceiling of 9.31 would give you 10, but the ceiling of negative 9.31 will actually give you negative nine. It seems a little bit backwards when you work with negatives, because again, you're not, you don't fixate at the decimal, the idea is you're gonna round it up to the next integer. And so rounding a negative number up would actually get you to negative nine, because negative nine is larger than negative 9.31, and there's no other integer in between them. So with that discussion of ceilings and floors, I'm now ready to talk about the generalized pigeonhole principle, which this one tells us that, suppose we have n objects to be placed into k boxes, that's the same setup we had with the pigeonhole principle, then we can say that at least one box contains the floor of n divided by k or more objects. And at least one of the boxes contains, sorry, this was the ceiling of n over k, one box will have at least the ceiling of n over k, and then one box will have at least the floor of n over k or fewer objects. So remember earlier how we said that there'll be some situations we can guarantee at least one pigeon, or there's no pigeons. So the idea behind the generalized pigeonhole principle is that we try to evenly distribute all of the pigeons between the pigeonholes there, what's the worst case scenario there? So if we had something like, let's say we have 30 pigeons and we had still 12 pigeonholes, if we distribute them evenly between all the boxes, then 12 divides into 30, you're gonna get two times, right? So you're gonna get mostly, you're gonna get mostly two pigeons per hole because 12 divides into 30, and you're going to get, it divides in there two times, but you also have a remainder of six, and that's the situation. So you're gonna get that sum, whoops, some holes have an extra, hence you get two plus one, which is three in that situation. That's what these numbers here are telling you. So when you look at the fraction n over k, that would be the ratio where the pigeons are evenly distributed between all of the pigeonholes, but as the pigeons cannot be subdivided into a fraction, that would be fairly cruel and gruesome, right? There's gonna be a remainder probably. Now, if n over k turns out to be a whole number, if k divides into n evenly, these two numbers would then be equal in that situation, like we saw with seven on the previous slide, and therefore there might not, that's fine. The floor and the ceiling can be the same if you're an integer, but most likely k doesn't divide into n evenly, there's remainder. So most of the pigeons are gonna have this many, in which case there will be some that have to have an extra, but these are just guarantees. I mean, there could be, I mean, if you have 30 pigeons, you could just shove all of them into one hole, and so one of them is going to have more than three, and 11 of them will have less than three, basically is what we're saying in that situation. So that's our generalized pigeonhole principle. Let's look at a common tutorial problem here. Suppose that a gumball machine contains four colors of gumballs, and for the sake of example, say they're blue, red, green, and orange. Those sound like fun gumball colors. Now, what is the least amount of gumballs you would have to buy to guarantee that you have 13 gumballs of the same color? Now, be cautious here. We're asking what is the least amount to guarantee that you have 13 of the same color? I mean, it's very possible that the first 13 gumballs you buy, because you put your little nickel in, you turn the machine, a gumball rolls out, and you do this over and over again. It's very possible that you put 13 nickels in the machine and you get 13 blue gumballs. So the smallest amount of gumballs that is possible to have 13 of the same color would be 13 itself. Or it could be that like, oh, you buy 10 gumballs, they're blue, you buy the next one, it's red, then you buy three more, it's blue again, so you got 13 on the 14th buy. Again, these are possibilities, but our question is what's the smallest that guarantees you have 13 gumballs? And so we have to basically play around with this generalized pigeonhole principle like we did previously that we were just talking about. The idea is if you evenly distribute all the colors, right? The idea is if you have 12 gumballs in the blue bucket and 12 gumballs in the red bucket and 12 gumballs in the green bucket and 12 gumballs in the orange bucket, this is a possibility, which if you add these together, you end up with 48 gumballs. With 48 gumballs, you could, if they were perfectly even between all the colors, you don't have 13 colors, 13 gumballs of the same color yet. You're gonna need to have one more. So when you get 48 plus one, which is now 49 gumballs, you see that at this moment, you would have to put that gumball in one of these buckets, one of these colors, and that would push it over to 13. So when you reach the 49th gumball, that is when you are going to be guaranteed a 13th gumball of the same color. And where did this 49 come from? I kind of explained it in this way, but the idea is we have K equals four colors. Those are the boxes we're considering. And we have to then decide what N is. We're looking for N. But with some experimentation, the idea is we can play around with the following. Whoops, we're looking at the ceiling in this situation. We take 48 plus one over four buckets there. That's where this 13 came from, like so. And so therefore 49 had to be the number of gumballs that guarantees it. Again, it likely could show up faster than that, but 49 is the smallest number of gumballs where everyone would be guaranteed a 13th color, a 13th gumball of the same color.