chapter 9 efficiency of algorithms. 9.1 real valued functions

12
Chapter 9 Efficiency of Algorithms

Upload: damian-miller

Post on 14-Jan-2016

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Chapter 9

Efficiency of Algorithms

Page 2: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

9.1

Real Valued Functions

Page 3: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Real-Valued Functions of a Real Variable

• Definition– Let f be a real-valued function of a real variable.

The graph of f is the set of all points (x, y) in the Cartesian coordinate plane with the property that x is in the domain of f and y = f(x).

– y = f(x) the point (x, y) lies on the graph of f.⇔

Page 4: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Example

Page 5: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Power Functions

• Definition– Let a be any nonnegative number. Define pa, the

power function with exponent a, as follows:pa(x) = xa for each nonnegative real number

x.

Page 6: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Example

• p1/2 = x1/2 point(x,x1/2)

• p0 = x0 = 1 point(x, 1)

• p2 = x2 point(x, x2)

Page 7: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Graphing Function on Integers

• A real-valued function may be graphed on a set of integers.

Page 8: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Multiple of a Function

• Definition– Let f be a real-valued function of a real variable

and let M be any real number. The function Mf, called the multiple of f by M, is the real-valued function with the same domain as f that is defined by the rule

(Mf)(x) = M* ((f(x)) for all x in the domain of f

Page 9: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Example

Page 10: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Increasing & Decreasing Functions

f (x) = x =x, if x ≥ 0

−x, if x < 0

⎧ ⎨ ⎩

⎫ ⎬ ⎭

y is decreasingy i

s incre

asing

Page 11: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Increasing & Decreasing Function

• Definition– Let f be a real-valued function defined on a set of

real numbers, and suppose the domain of f contains a set S. We say that f is increasing on the set S if, and only if, for x1 and x2 in S, if x1 < x2 then f(x1) < f(x2).

We say that f is decreasing on the set S if, and only if, for x1 and x2 in S, if x1 < x2 then f(x1) > f(x2).

Page 12: Chapter 9 Efficiency of Algorithms. 9.1 Real Valued Functions

Example