Page 32 - DCAP407_DATA_STRUCTURE
P. 32
Unit 2: Complexity Analysis
Function f(x)=2x
In this case, the function is assigned to every real number, the real number with
twice its value.
Assume x=5, then we can write f(5) = 10.
Some of the mathematical functions are described below:
Floor and Ceiling Functions
Floor function is represented as floor(x). Floor function which is also called greatest integer function
gives the largest integer less than or equal to x. The range of floor(x) is the set of all integers, but the
domain of floor(x) is the set of all real numbers.
Let us take an example to understand the floor function more clearly.
floor(1.01)=1
floor(0)=0
floor(2.9)=2
floor(-3)=-3
floor(-1.1)=-2
Find out floor(x) for various values of x.
Figure 2.4 shows the graph for floor(x).
Figure 2.4: Floor Function
Source: http://mathworld.wolfram.com/FloorFunction.html
Ceiling function is represented as ceiling(x). It gives the smallest integer value greater than or equal to x.
The domain of ceiling(x) is the set of all real numbers. The range of ceiling(x) is the set of all integers.
LOVELY PROFESSIONAL UNIVERSITY 25