The modulus, the greatest integer and other special functions · Mathematics Class 11–12 | StemPy Lab
Course 1.2·Lesson 2 of 4
The modulus, the greatest integer and other special functions
The modulus |x| is the distance of x from zero. The signum gives the sign of x. The greatest integer [x] is the largest integer not more than x, and the fractional part is x − [x], which always lies in [0, 1). A function defined by different rules on different parts of its domain is a piecewise function.
about 25 min1 simulation2 practice questions
Lesson 2 of 4Show all lessonsHide
Try the code and the simulations beside the lesson.
The modulus
The modulus (or absolute value) of x is its distance from zero on the number line. Distance is never negative.
∣x∣={x−xif x≥0if x<0
So ∣5∣=5 and ∣−5∣=5. The graph of y=∣x∣ is a "V" with its point at the origin. The domain is R, and the range is [0,∞).
Some facts that you use all the time:
∣ab∣=∣a∣∣b∣, and x2=∣x∣. Notice that x2 is notx when x is negative.
∣x∣≤a (with a>0) means −a≤x≤a. The distance from zero is at most a.
∣x∣≥a means x≤−a or x≥a.
∣x−c∣ is the distance of x from c. So ∣x−2∣<3 means that x is less than 3 away from 2, which is −1<x<5.
The signum function
The signum function gives only the sign of a number:
sgn(x)=⎩⎨⎧10−1x>0x=0x<0
The domain is R and the range is the three-element set {−1,0,1}. Also x=∣x∣sgn(x).
The greatest integer function
The greatest integer[x] is the largest integer that is not more thanx. On the number line, you step to the left until you stand on an integer.
[3.7]=3, [5]=5, [0.2]=0.
[−2.3]=−3. This one surprises many people. The integers near −2.3 are −3 and −2, and −3 is the one on the left, so [−2.3]=−3 and not −2.
The graph is a staircase. It is flat between two integers, and it jumps by 1 at every integer. The filled dot shows the value at the integer, and the empty dot shows that the value is not reached. The domain is R and the range is Z, the integers.
Three facts follow:
[x]≤x<[x]+1.
[x+n]=[x]+n for every integer n.
[x]=x exactly when x is an integer.
The fractional part
What is left of x after the whole part is taken away is the fractional part, {x}=x−[x]. For x=3.7 it is 0.7. For x=−2.3 it is −2.3−(−3)=0.7. The fractional part is always in [0,1).
Four graphs. The modulus y equal to the absolute value of x is a V with its point at the origin. The signum function is minus 1 for negative x, 0 at the origin and 1 for positive x, with empty dots at minus 1 and 1 above and below the origin. The greatest integer function is a staircase of flat steps, each with a filled dot on the left end and an empty dot on the right end. The fractional part, x minus the greatest integer of x, is a row of slanted lines from 0 up toward 1, repeating at every integer.
The graph of {x} is a row of slanted lines. The pattern repeats after every 1 unit, so the function is periodic with period 1.
Slide x across a whole number. The staircase jumps up by 1 and the sawtooth drops from nearly 1 back to 0.
Piecewise functions
All four functions above use different rules on different parts of the domain. A function like this is a piecewise function. For example,
f(x)=⎩⎨⎧x+12x2x<0x=0x>0
To find f(−3), ask which part holds: −3<0, so we use x+1 and f(−3)=−2. To find f(0) we use the middle part, and f(0)=2. To find f(3) we use x2, and f(3)=9.
When you draw a piecewise function, draw each piece on its own part of the axis. At the ends, use a filled dot where the point belongs to the graph and an empty dot where it does not. A jump in the graph means that the function is not continuous there.
Practise with new numbers
Try it in Python
This program finds the modulus, the signum, the greatest integer and the fractional part of some numbers. Look at the row for −2.5.
Remember these
∣x∣=x when x≥0 and ∣x∣=−x when x<0. Also x2=∣x∣.
∣x∣<a means −a<x<a.
[x] is the greatest integer not more than x, so [−2.3]=−3.
{x}=x−[x] lies in [0,1), and it repeats with period 1.
A piecewise function uses a different rule on each part of the domain.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Find [4.9], [−4.9] and [−4].
Solve ∣x−1∣≤4.
Find {−1.25}.
If f(x)=x+1 for x<0 and f(x)=x2 for x≥0, find f(−2)+f(2).
Enroll free in Graphs and Special Functions
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.