The Real Number Line In this lecture, we will see the first example of an infinite set. It is one that pervadesall of data science, the idea of the real number line. In this lecture, we will reviewfundamental concepts such as positive numbers and negative numbers, nonnegativenumbers and nonpositive numbers, and absolute value. The Real Number Line is the concept of a line that has infinite points on it. You may have heard the term real number before. Real numbers are numbers that can beexpressed as a decimal (or fraction). For example, 5, 6, 7 and -8 are all realnumbers. But 0 or π are not real numbers because they cannot be expressed asdecimals or fractions. The Real Number Line is simply a collection of all the possiblepoints in this infinitely long continuous line. The real numbers are represented by the number line. When we graph them, we plotthem on an extension of the number line that extends from positive infinity on theright to negative infinity on the left. We define the set of real numbers, R, as theinfinite set containing all rational and irrational numbers. It is said that every realnumber can be represented as an infinite sequence of digits, each digit being either0 or 1. Now, we will mark some numbers we know with an equal sign. The equal signmeans that the sequence of digits continues infinitely in both directions. So here aresome integers: 0, 1, 2 , 3 , 4 , 5 ……The real number line includes all numbers between and including the integers, butnot every number on the real number line is an integer. In fact, most aren't. If weblow up this little stick between one and two, we can see this more clearly. The only thing you need to know is that every single real number can be obtained byadding together an integer and any number of integers that follow it. For example,1.1 is a real number. So are the numbers 1.4 and 1.1538. And anything else that youcan create by continuing the sequence of integers forever is also a real number. Thisis true for any subinterval of the real numbers because no matter how small or largea subinterval may be, if you blow it up enough to see all of its possible values, youwill be able to see every single real number within it somewhere.
As you already may know, there are real numbers such as pi. Pi is approximately3.14, and it goes on forever without any pattern or repetition. There are alsonumbers that do repeat, like 2.353199258, which is called a repeating decimal. Wewill not discuss that type of number here because it is not relevant to the main pointof this paper. The take-home message is that a real number is any number on thereal line; there are an infinite amount of them, with some being positive and somebeing negative.So an example of a positive real number might be 5.3 might be 0.001. For examplethe negative real number right here might be negative 11.7 if we include zero, So thepositive reals but including zero we often write the non negative reals- and if weinclude 0 on the other side we go from right, non positive reals. Let us draw the real number line again, using increasingly straight lines. It isimportant to note that numbers come in pairs: a positive number and its negativecounterpart. For example, here we have 0; the positive version of this number is +0.And here we have 7.1; its negative counterpart is –7.1. Likewise, 10 has a friend onthe other side called –10. Now notice 7.1 is not equal to -7.1. 10 is not equal to -10.However, 7.1 and -7.1 have one important thing in common, which is that they havethe same distance to zero. The distance from here to here is about 7.1, is exactly7.1. And the distance from here to here is 7.1. There's a concept called absolutevalue. Let's define that.The absolute value of a real number is the distance from 0 to that number, which wedenote by X. Notice that the absolute value symbol looks like the definition ofcardinality for sets, which is unfortunate.
We will notice over here that the absolute value of 7.1 is 7.1 and the absolute valueof negative 7.1 is 7.1, which by the way is the same thing as saying that negative 7.1is positive 7.1, or -7.1 is +7.1. That's not just a huge little formula that we all know:negative times negative equals positive. But it allows us to make a general definitionthrough what is known as a definition by cases: For any real number in R (that is,any x in R), the following is true: The absolute value of an x can be one of two things:It can be equal to plain old x if x is nonnegative (that's 0 or greater than 0). But it canalso be equal to negative x if x is negative (that's less than 0). Let's check if that's true, and while we check this, this'll sort of show us how to parsethe definition by cases. So let's compute the absolute value of 8.7. So according to this definition, 8.7 is ourIt's either going to be 8.7 or negative 8.7. But which case happens? 8.7 isnon-negative so we`re in this case up here. So this is just equal to 8.7. And that'strue.The distance between -1 and -10 is 10. Let's check another example: the distancebetween 8.7 and -1. If x = 8.7, then by our definition d(x) = -1. The distance between8.7 and -1 is negative 10, because this formula tells us to take the negative of anynumber whose absolute value is greater than 0, which means it's greater than orequal to 0. In this case, we want to take the absolute value of 8.7, which is 9. Thisgives us a result of 9; therefore, the distance between 8.7 and -1 is 9 units awayfrom zero on the number line.