For AI agents: use /llms.txt for the Nakafa content index.
A step function is a type of mathematical function that has constant values on certain intervals and experiences sudden jumps at specific points. The graph of this function resembles stairs, with horizontal lines connecting points of discontinuity.
A step function can be defined as a piecewise function of the form:
where c 1 , c 2 , c 3 , … , c n c_1, c_2, c_3, \ldots, c_n c 1 , c 2 , c 3 , … , c n are constants and [ a i , b i ) [a_i, b_i) [ a i , b i ) are non-overlapping intervals.
Characteristics of step functions:
Constant values on each interval
Jump discontinuities at interval boundary points
Graph shaped like stairs
Belongs to the category of piecewise functions
The floor function, denoted by ⌊ x ⌋ \lfloor x \rfloor ⌊ x ⌋ , gives the largest integer less than or equal to x x x .
To make it easier to understand, let's look at the following example:
Floor function value table:
x x x − 2.5 -2.5 − 2.5 − 1.7 -1.7 − 1.7 − 1 -1 − 1 − 0.3 -0.3 − 0.3 0 0 0 0.8 0.8 0.8 1 1 1 1.9 1.9 1.9 2.4 2.4 2.4 ⌊ x ⌋ \lfloor x \rfloor ⌊ x ⌋ − 3 -3 − 3 − 2 -2 − 2 − 1 -1 − 1
The ceiling function, denoted by ⌈ x ⌉ \lceil x \rceil ⌈ x ⌉ , gives the smallest integer greater than or equal to x x x .
Let's look at the following example:
The unit step function or Heaviside function, denoted by H ( x ) H(x) H ( x ) or u ( x ) u(x) u ( x ) , is defined as:
Unlike the floor and ceiling functions, the unit step function has a value of 0 0 0 for x < 0 x < 0 x < 0 and 1 1 1 for x ≥ 0 x \geq 0 x ≥ 0 .
Domain: R \mathbb{R} R (usually)
Range: Set of discrete values
Continuity: jump discontinuities at certain points
Special properties of floor and ceiling functions:
⌊ x ⌋ ≤ x < ⌊ x ⌋ + 1 \lfloor x \rfloor \leq x < \lfloor x \rfloor + 1 ⌊ x ⌋ ≤ x < ⌊ x ⌋ + 1
⌈ x ⌉ − 1 < x ≤ ⌈ x ⌉ \lceil x \rceil - 1 < x \leq \lceil x \rceil ⌈ x ⌉ − 1 < x ≤ ⌈ x ⌉
⌈ x ⌉ = ⌊ x ⌋ + 1 if x ∉ Z \lceil x \rceil = \lfloor x \rfloor + 1 \text{ if} x \notin \mathbb{Z} ⌈ x ⌉ = ⌊ x ⌋ + 1 if x ∈ / Z
⌈ x ⌉ = ⌊ x ⌋ if x ∈ Z \lceil x \rceil = \lfloor x \rfloor \text{ if} x \in \mathbb{Z} ⌈ x ⌉ = ⌊ x ⌋ if x ∈ Z
Comparison table of floor and ceiling functions:
x x x ⌊ x ⌋ \lfloor x \rfloor ⌊ x ⌋ ⌈ x ⌉ \lceil x \rceil ⌈ x ⌉ Difference − 2.3 -2.3 − 2.3 − 3 -3 − 3 − 2 -2 − 2 1 1 1 − 1 -1 − 1 − 1 -1 − 1 − 1 -1 − 1 0 0 0 0.7 0.7 0.7 0 0 0 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 0 0 0 3.8 3.8 3.8 3 3 3 4 4 4 1 1 1
The function f ( x ) = ⌊ x ⌋ + k f(x) = \lfloor x \rfloor + k f ( x ) = ⌊ x ⌋ + k shifts the floor function graph upward (if k > 0 k > 0 k > 0 ) or downward (if k < 0 k < 0 k < 0 ).
The function f ( x ) = ⌊ x − h ⌋ f(x) = \lfloor x - h \rfloor f ( x ) = ⌊ x − h ⌋ shifts the graph to the right (if h > 0 h > 0 h > 0 ) or to the left (if h < 0 h < 0 h < 0 ).
Determine the value of ⌊ 3.7 ⌋ + ⌈ − 2.3 ⌉ \lfloor 3.7 \rfloor + \lceil -2.3 \rceil ⌊ 3.7 ⌋ + ⌈ − 2.3 ⌉
A bookstore gives discounts based on the number of purchases:
1 - 5 1\text{-}5 1 - 5 books: no discount
6 - 10 6\text{-}10 6 - 10 books: 10 % 10\% 10% discount
11 - 20 11\text{-}20 11 - 20 books: 15 % 15\% 15% discount
> 20 > 20 > 20 books: 20 % 20\% 20% discount
If the price per book is Rp 50,000 \text{Rp}50{,}000 Rp 50 , 000 , create a function that represents the total price after discount!
Graph of function f ( x ) = 2 ⌊ x ⌋ − 1 f(x) = 2\lfloor x \rfloor - 1 f ( x ) = 2 ⌊ x ⌋ − 1 for − 3 ≤ x ≤ 3 -3 \leq x \leq 3 − 3 ≤ x ≤ 3
Solve the equation ⌊ 2 x + 1 ⌋ = 5 \lfloor 2x + 1 \rfloor = 5 ⌊ 2 x + 1 ⌋ = 5
An elevator can accommodate a maximum of 8 people 8 \text{ people} 8 people . If there are n people n \text{ people} n people who want to use the elevator, how many times must the elevator operate?
Calculating floor and ceiling function values:
Bookstore discount function model:
Let n n n be the number of books purchased, then the total price after discount is:
Graph of function f ( x ) = 2 ⌊ x ⌋ − 1 f(x) = 2\lfloor x \rfloor - 1 f ( x ) = 2 ⌊ x ⌋ − 1 :
For each interval:
− 3 ≤ x < − 2 : f ( x ) = 2 ( − 3 ) − 1 = − 7 -3 \leq x < -2: f(x) = 2(-3) - 1 = -7 − 3 ≤ x < − 2 : f ( x ) = 2 ( − 3 ) − 1 = − 7
Solving the equation ⌊ 2 x + 1 ⌋ = 5 \lfloor 2x + 1 \rfloor = 5 ⌊ 2 x + 1 ⌋ = 5 :
Calculating the number of elevator operations:
If there are n people n \text{ people} n people and the elevator can accommodate a maximum of 8 people 8 \text{ people} 8 people , then the number of elevator operations required is:
− 2 ≤ x < − 1 : f ( x ) = 2 ( − 2 ) − 1 = − 5 -2 \leq x < -1: f(x) = 2(-2) - 1 = -5 − 2 ≤ x < − 1 : f ( x ) = 2 ( − 2 ) − 1 = − 5
− 1 ≤ x < 0 : f ( x ) = 2 ( − 1 ) − 1 = − 3 -1 \leq x < 0: f(x) = 2(-1) - 1 = -3 − 1 ≤ x < 0 : f ( x ) = 2 ( − 1 ) − 1 = − 3
0 ≤ x < 1 : f ( x ) = 2 ( 0 ) − 1 = − 1 0 \leq x < 1: f(x) = 2(0) - 1 = -1 0 ≤ x < 1 : f ( x ) = 2 ( 0 ) − 1 = − 1
1 ≤ x < 2 : f ( x ) = 2 ( 1 ) − 1 = 1 1 \leq x < 2: f(x) = 2(1) - 1 = 1 1 ≤ x < 2 : f ( x ) = 2 ( 1 ) − 1 = 1
2 ≤ x ≤ 3 : f ( x ) = 2 ( 2 ) − 1 = 3 2 \leq x \leq 3: f(x) = 2(2) - 1 = 3 2 ≤ x ≤ 3 : f ( x ) = 2 ( 2 ) − 1 = 3
If we create the graph, it would look approximately like the following:
So the solution set is x ∈ [ 2 , 2.5 ) x \in [2, 2.5) x ∈ [ 2 , 2.5 ) .
The ceiling function is used because if there are remaining people (less than 8 8 8 ), one additional elevator operation is still required.