 Well, again, and welcome to another screencast on reducing an integer modulo n. Now, before we go on, I want to just warn you that this is a subject, a concept that's actually not treated in section 3.1 of the Sunstrom Textbook. It comes up in other forms a little later in the book, but I think it might be helpful and we certainly can handle it to pull it forward a little bit. I think it's gonna make our lives easier to understand this concept coming up. So what is this concept of reducing an integer modulo n? I wanted to go back to the last screencast in the concept check you saw, where we were looking for integers that were congruent to 2 modulo 9. And remember, for an integer to be congruent to 2 modulo 9, I would have to have 9 dividing the difference between that integer and 2. And any of these in this list suffice. I've added a few more to the list than since the concept check. I think we stopped at negative 7, and any of these numbers will work. 38 also works, negative 16 also works. Once you have one of these numbers that's congruent to 2 mod 9, it's easy to generate infinitely many of them because they are all separated by 9 units. So there are actually infinitely many numbers that are congruent to 2 mod 9, and they all have the same property that they're separated by 9 units each. Now, we wanna use this idea and the listing idea to generate a pretty important concept here. Let me just go and look at, what if I change the question up, okay? Let's look at 16 mod 5. What are some integers that are congruent to 16 mod 5? And again, what that would mean is that 5 divides the difference between 16 and whatever integer I have. Anything that I could plug in for a that makes the difference between 16 and a divisible by 5 will work. Now, one such a number is definitely the number 16 itself. 16 is gonna be congruent to itself mod 5 because 16 minus 16 is 0 and 5 divides 0. Okay, so it's actually easy to come up with one answer to this. It's just the number itself. And like we said, if we can come up with one of these, we can come up with infinitely many of them just by adding five onto the one we have. So another number that would be another integer that would be congruent to 16 mod 5 would be 21. And you can very easily see this. The difference between 16 and 21 is equal to 5. And so 5 certainly divides that. Other numbers would be 26 and on and on we go, 31 and so forth. Infinitely many of them. Now what's interesting here is to go backwards. If I go backwards, I would have 11 would be congruent to, and 11 and 16 would be congruent mod 5. Also 6, also 1. And if I go back any farther, I'm gonna go under 0. I'm gonna go negative. So negative 4 and negative 9 and so forth. Keep your eye on this number right here, the smallest non-negative integer in this list. That will become important. Let's ask the same question using 121 mod 8. Now 121, as we kind of, to use the general idea from above, 121 is certainly one of those integers that's congruent to 121. If two integers are equal, they are definitely congruent to each other. Mod, really anything, but eight in this case. Let's, we could push forward in this. You know, 129 would also be congruent to 121 because their difference is divisible by 8, also 137 and so forth. But I wanna go back to this idea of what's the smallest non-negative number in this list. There is no smallest number in this list because it continues off to the left forever. But what's the smallest non-negative number in that list? Well, let's back it up here and I'll skip a little bit as we get close to the end. 113 would be congruent to 121, mod 8, 105 would be next and let's just skip a little while and I'll keep going and I will get to 17, eventually 17 and 121, the difference between 17 and 121 is 104. And that is divisible by 8, it's 13 times 8. So if we keep going backwards, I would have 9, then 1, and then the next integer backwards in the list would be negative. Okay, so again, there is this least non-negative integer that's congruent to 121, mod 8, and in this case it happens to be 1 again. Another example, let's start with a negative number and ask, okay, of the infinitely many numbers, integers that are congruent to negative 10, mod 4, which one is the least non-negative one in the list? The smallest that is either 0 or positive. So let's start with negative 10, that is congruent to itself, mod 4, and this time we'll have to go up. Another, the next number up the list that's congruent to 10, mod 4, would be the number negative 6. The next one up the list would be negative 2. And the next number up the list is positive 2. And that is the, the next one up the list would be 6 and 10. So 2 is the least non-negative, the smallest non-negative integer that is congruent to negative 10, mod 4. And again, you can see that it's 2 and negative 10 really are congruent modulo 4 because their difference is negative 12, which is a multiple of 4. So that leads us to a theorem, and I'd like to state this without proof at this point, we will be able to pick up the proof for this later on. Just to give you the idea, use the examples to convince yourself this is true that if you take any natural number at all, call that n, and then any integer a, then a is congruent mod n to infinitely many integers, okay? There's no finite list of integers to which a is congruent mod n. But there's exactly one element in the list 0, 1, 2, through n minus 1 that a is congruent to. So there is a least non-negative number to which a is congruent modulo n. And we're gonna call the fancy name for that integer is the least non-negative residue of a modulo n. And we're gonna say that if I take a and find its least non-negative residue, that smallest non-negative integer that it's congruent to mod n, we're gonna say we are reducing that integer mod n. So let's look at some examples here. These are things we've already seen. So 16 is congruent to many, many things mod 5. But there's only one least non-negative thing that's congruent to mod 5. That number is 1. So we would say that 16 is congruent to 1 mod 5. We reduce 16 to 1 mod 5 in other words. We also saw that 121 is congruent to many, many things, an infinite list of numbers. But the smallest non-negative number to which it's congruent is the number 1 again, so we would say that 121 reduces to 1 mod 8. This thing doesn't seem like reducing because we're going from a negative integer to a positive one, but negative 10 is reduces to 2 mod 4, because that is 2 is the smallest non-negative integer to which 10 is congruent mod 4. Notice that each of these numbers that end up being the reduction of the numbers they started with are between 0 and the modulus. So 0, it's in this list, 0, 1, 2, 3, and 4. This is in the list 0, 1, all the way up to 7. And this is in the list 0, 1, 2, and 3. So we can always take an integer and reduce it to its least non-negative residue, and that's an important operation. Since this is kind of independent of the textbook, let's do two concept checks to make sure we understand what we're doing here. So what is the number 85 reduced to mod 9? Look at your options and come back in a moment with your answer. So we can rule two things out already, 76 and 9. Because we're trying to reduce modulo 9, the answer has to be between 0 and 8, okay? So anything that's outside the range 0, 1, 2, 3, 4, 5, 6, 7, and 8 is wrong. Okay, so these other guys could possibly work here. So what's it gonna be? I think our answer is gonna be C or 4. That is certainly in the range 0 through 8 is 85 actually congruent to 4 mod 9. Well, yeah, it is because 9 divides the difference between 85 and 4. 85 minus 4, of course, is 81, and 9 certainly divides that. But that cannot be said for these other two guys here. So again, 85 reduces to a unique non-negative integer that's between 0 and 9 minus 1. Now another concept check for the same question. What about the integer negative 12? What does that reduce to mod 6? This time I've screened out any obviously wrong choices here. These are all in the realm of possibilities 0 through 5. If I'm reducing something mod 6, it's gonna reduce to 0, 1, 2, 3, 4, or 5. Which of those six integers is it gonna be? In this case, the answer is 0. That is a non-negative integer, right? How do I know? Well, what is a negative 12 congruent to? Let's do this with the list here. Start with negative 12, it's congruent to itself. And just start adding numbers onto it. The next mod 6, not adding numbers, but adding the modulus onto it, 6. I need to go from negative 12 to negative 6, negative 6 to 0. And there's my answer. The least non-negative integer to which negative 12 is congruent mod 6. There are obviously many other non-negative integers that are congruent to negative 12 mod 6 and of those, which one is the smallest and that's that one. And that's our least non-negative residue. So this idea of reducing an integer to its least non-negative residue, modulo n, actually helps out in a number of different ways. Again, this isn't really touched upon in your book, but I think it's important to bring it up. So thanks for watching.