 In this final video for section 1.2, we're going to learn how we can solve linear equations over finite fields, particularly using this modular arithmetic. Now we learned earlier that in order to solve a linear equation, we have to have all ten of the field axioms. Those are the axioms I guarantee that we can do addition, subtraction, multiplication, and division in the usual manner. Now this modular set, Zn, that we've been learning about, it can be a field so that modular addition, subtraction, multiplication, and division are well-defined. A lot of the times, but there is one extra stipulation. It turns out there's no problem with the addition, subtraction, multiplication. But the technique we learned about being able to simplify modular fractions only is going to work when the modulus is prime. So Zn here is only a field when the modulus is a prime number. So in this course, we're going to nearly exclusively talk about Zp, where p is a prime number, when we do a finite field. Because, again, in order to do linear algebra, we need a field and a general number n doesn't exactly work. You can see in the homework questions some explanation of what goes wrong if you have a composite number instead of a prime. But with that assumption, let's work over some finite fields and solve the associated linear equations. So if you want to solve the equation 2x plus 1 is congruent to 6 mod 13, we can go about solving this. Since 13 is a prime number, we can solve it using the field axioms. We're going to subtract 1 from both sides and get 2x is congruent to 5 mod 13, 5. There's no reason to reduce whatsoever. So we're going to divide both sides by 2 and we get that x is congruent to 5 halves. Now, in order to, we want, we have to get a number between 0 and 12 as our final answer. So we need to simplify the modular fraction 5 divided by 2. 2 doesn't divide into 5, so instead we're going to replace 5 with 5 plus 13. 5 plus 13, of course, is 18. 2 does go into 18 there, in which case we get 9 as our final answer. And so that gives us the solution. And we can check our solution by plugging it back into the original equation. Notice if we take 2 times 9 plus 1, this would equal, 2 times 9 is 18 plus 1. Notice 18, we can add 1 to it. We can reduce the 18 now or we can do it later. Adding 1's not too problematic. This would give us 19, which of course, if you take 19 minus 13, this is 6 again. And thus verifying we found a solution to the linear equation. Let's take another example. 3x plus 5 is congruent to 1 mod 7. 7's a prime number, so this would be solving a linear equation over a field. We'll subtract 5 from both sides, in which case we get 3x is congruent to negative 4 mod 7. And so if we wanted to, we could then proceed to solve for x by taking negative 4 over 3. That's a great option. We could try to simplify that fraction. But also as negative 4 is not inside the scope of 0 to 6, we actually could just replace it by adding some multiple of 7 to it. This would give us a 3x is congruent to 3, right? And this is a great observation because in this case then, we're trying to compute 3 over 3, which is going to be a 1. So since the numerator was genuinely divisible by 3 from the get-go, we can then, we don't have to replace the numerator. But if the denominator doesn't divide into the numerator completely, we can just replace the numerator with some integer congruent to it with respect to the current modulus and then simplify the fraction in a usual manner. And so with these ideas of modular arithmetic in hand, turns out solving a modular equation is really not that different than solving a linear equation over the rational field. It's just the arithmetic is a little bit different because of the modular reduction there.