If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Absolute value as distance between numbers

In this video, we think about what |a-b| really means, and we verify that |a-b| = |b-a| by looking at an example.

Want to join the conversation?

Video transcript

- [Voiceover] Let's say that I have two numbers on a number line. So let me draw a little quick number line right over here. The two numbers on my number line that I care about, the number a and the number represented by b here. The way I've drawn it, b is to the right of a on our number line, and by our convention, b is going to be greater than a. So if I were to figure out the distance between a and b, what is this distance going from a, I want to draw a straight line here, this distance going from a to b, so this distance right over there, how would I figure it out? Well I could just take the larger of these two numbers, which is going to be b, and then subtract out the smaller. So I subtract out a, and I'll be left with this distance. This will give me a positive value. When I want a distance, I just think in terms of a positive value. How far apart are these two things? But I was only able to know to do b minus a because I knew that b was greater than a. This was going to give me a positive value. What if I knew that a was greater than b? Well then I would do it the other way around. So let me draw that again. Let me draw another number line right over here. In this world, in this world, I'm going to make a greater than b. This is b, that is a, and if I wanted to calculate the distance between b and a here, well now I would take the larger of the two, a, remember I want the positive distance here, and then I would subtract out the smaller. I would do a minus b. Well so here I did b minus a, here I did a minus b, but what if I didn't know which one was greater? If I didn't know whether b or a was greater, what could I do? Well what you could do is just take either a minus b or b minus a and take the absolute value. If you do that, it doesn't matter if you take b minus a or a minus b. It turns out that regardless of whether a is greater than b, or b is greater than a, or they're equivalent, that the absolute value of a minus b is equivalent to the absolute value of b minus a, and this is equivalent, either of these expressions is the distance between these numbers. I encourage you to play around with the negatives to see if you can factor out some negatives and think about the absolute value. It will actually make a lot of sense why this is true. In another video, I might do a little bit more of a rigorous justification for it. But I think the important thing for this video is to see that this is actually true. So let's say we're in a world, let's get a number line out, and let's look at some examples. So let's say that we want to figure out the distance between, between, let's say negative two, the distance between negative two and positive three. So we can look at the number line and figure out what that distance is. To go from negative two to positive three, or the distance between them, we see is one, two, three, four, five. Actually, let me draw a straighter line here. This distance right over here, this distance right over here is equal to five. You see it right over here. One, two, three, four, five. Or you'd have to go five backwards to go from three to negative two. But let's see that what I just wrote actually applies right over here. So if we took negative two to be our a and three to be our b, then we could write this as the absolute value of negative two minus three, what is this going to be equal to? Well this is going to be equal to negative two minus three is negative five, so it's the absolute value of negative five. So this indeed equals five. So notice I subtracted the larger number from the smaller number. I got a negative value, but then I took the absolute value of it. That gave me the actual distance between these two numbers. Now what if I did it the other way around? What if I took three minus negative two? So it's going to be the absolute value of three, let me do it in the blue color, the absolute value of three minus, and in parentheses I'll write the negative two. Negative two. Now if you subtract a smaller number from a larger number, you should get a positive value. So the absolute value sign here is just kind of extra. You don't really need it, unless to verify that that's true. This is going to be three minus negative two. That's the same thing as three plus positive two, or five. So this is just going to be the absolute value of five, which of course, is equal to five. So hopefully this makes you feel good that if you want the distance between two numbers, you subtract one from the other, and it doesn't matter which order you do it. You could subtract three from negative two, or negative two from three, be careful with the negative symbols here, and then take the absolute value, and then that is going to give you the distance between these two numbers. This is super important because later in your mathematical careers, you're going to see a math professor just say, oh, you know, I care about the distance between two variables, you know, a and b, so the distance is a minus b, and then later they might write it like this. And then to realize that these are actually the same thing, and these are gonna give the same value, and they represent the distance between these numbers.