Relations between Exponential and Logarithmic Functions 1 Relations
Relations between Exponential and Logarithmic Functions 1
Relations between Exponential and Logarithmic Functions For positive numbers b 1, the exponential function with base b, denoted expb, is the function from R to R+ defined as follows: For all real numbers x, where b 0 = 1 and b–x = 1/bx. 2
Relations between Exponential and Logarithmic Functions When working with the exponential function, it is useful to recall the laws of exponents from elementary algebra. 3
Relations between Exponential and Logarithmic Functions Equivalently, for each positive real number x and real number y, It can be shown using calculus that both the exponential and logarithmic functions are one-to-one and onto. Therefore, by definition of one-to-one, the following properties hold true: 4
Relations between Exponential and Logarithmic Functions These properties are used to derive many additional facts about exponents and logarithms. In particular we have the following properties of logarithms. 5
Computing Logarithms with Base 2 on a Calculator In computer science it is often necessary to compute logarithms with base 2. Most calculators do not have keys to compute logarithms with base 2 but do have keys to compute logarithms with base 10 (called common logarithms and often denoted simply log) and logarithms with base e (called natural logarithms and usually denoted ln). Suppose your calculator shows that ln 5 1. 609437912 and ln 2 0. 6931471806. Use Theorem 7. 2. 1(d) to find an approximate value for log 25. 6
Graphs of Exponential Functions 7
Graphs of Exponential Functions The exponential function with base b > 0 is the function that sends each real number x to bx. The graph of the exponential function with base 2 (together with a partial table of its values) is shown in Figure 1. Note that the values of this function increase with extraordinary rapidity. The Exponential Function with Base 2 Figure 1 8
Graphs of Exponential Functions The graph of any exponential function with base b > 1 has a shape that is similar to the graph of the exponential function with base 2. If 0 < b < 1, then 1/b > 0 and the graph of the exponential function with base b is the reflection across the vertical axis of the exponential function with base 1/b. 9
Graphs of Exponential Functions These facts are illustrated in Figure 2. (a) Graph of the exponential function with base b > 1 (b) Graph of the exponential function with base b where 0 < b < 1 Graphs of Exponential Functions Figure 2 10
Graphs of Logarithmic Functions 11
Graphs of Logarithmic Functions We have known the definition of the logarithmic function with base b. We state it formally below. The logarithmic function with base b is, in fact, the inverse of the exponential function with base b. It follows that the graphs of the two functions are symmetric with respect to the line y = x. 12
Graphs of Logarithmic Functions The graph of the logarithmic function with base b > 1 is shown in Figure 3 The Graph of the Logarithmic Function with Base b > 1 Figure 3 13
Application: Number of Bits Needed to Represent an Integer in Binary Notation 14
Application: Number of Bits Needed to Represent an Integer in Binary Notation Any positive integer n can be written in a unique way as where k is a nonnegative integer and each c 0, c 1, c 2, . . . ck− 1 is either 0 or 1. Then the binary representation of n is and so the number of binary digits needed to represent n is k + 1. 15
Application: Number of Bits Needed to Represent an Integer in Binary Notation What is k + 1 as a function of n? Observe that since each ci ≤ 1, But by the formula for the sum of a geometric sequence (Theorem 5. 2. 3), 16
Application: Number of Bits Needed to Represent an Integer in Binary Notation Hence, by transitivity of order, In addition, because each ci ≥ 0, Putting inequalities (11. 4. 6) and (11. 4. 7) together gives the double inequality 17
Application: Number of Bits Needed to Represent an Integer in Binary Notation Then, Thus the number of binary digits needed to represent n is 18
Number of Bits in a Binary Representation How many binary digits are needed to represent 52, 837 in binary notation? 19
Exponential and Logarithmic Orders 20
Exponential and Logarithmic Orders Now consider the question “How do graphs of logarithmic and exponential functions compare with graphs of power functions? ” It turns out that for large enough values of x, the graph of the logarithmic function with any base b > 1 lies below the graph of any positive power function, and the graph of the exponential function with any base b > 1 lies above the graph of any positive power function. 21
Exponential and Logarithmic Orders In analytic terms, this says the following: These statements have the following implications for O-notation. 22
Exponential and Logarithmic Orders Another important function in the analysis of algorithms is the function f defined by the formula For large values of x, the graph of this function fits in between the graph of the identity function and the graph of the squaring function. More precisely: 23
Exponential and Logarithmic Orders The O-notation versions of these facts are as follows: 24
Exponential and Logarithmic Orders Next example shows how a logarithmic order can arise from the computation of a certain kind of sum. It requires the following fact from calculus: The area underneath the graph of y = 1/x between x = 1 and x = n equals ln n, where ln n = loge n. 25
Exponential and Logarithmic Orders This fact is illustrated in Figure 4 Area Under Graph of y = Between x = 1 and x = n Figure 4 Sums of the form are called harmonic sums. 26
- Slides: 26