Algorithms and Discrete Mathematics 20082009 - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Algorithms and Discrete Mathematics 20082009

Description:

An iterative algorithm for computing the square root of a number b: ... Computation of square roots. procedure square root ( b : positive real number ) x : = 1 ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 21
Provided by: dur9
Category:

less

Transcript and Presenter's Notes

Title: Algorithms and Discrete Mathematics 20082009


1
Algorithms and Discrete Mathematics 2008/2009
  • Lecture 5
  • Exponentiation and logarithms II

Ioannis Ivrissimtzis
10-Nov-2008
2
Overview of the lecture
  • Logarithms
  • Properties of logarithms
  • Computation of square roots
  • Computations of logarithms

3
Logarithms
  • For real positive numbers x,b with b?1, the
    logarithm of x to the base
  • b, written logbx is the unique real number y that
    satisfies byx.
  • That is, if we raise b to the power of logbx we
    get x.
  • When it does not create confusion, we do not put
    argument of the
  • logarithm in brackets. That is, we write logbx
    rather than logb(x).

4
Logarithms
  • Example 5.1

5
Logarithms
  • Example 5.2 Let b be a positive real number,
    b?1. We have

6
Logarithms
  • The logarithms are inverses
  • of the exponentials.
  • They are only defined on
  • positive real numbers.
  • For any base, the logarithm
  • of 1 is 0.
  • For bgt1 they increase
  • monotonically. They grow
  • slow.

1
0
7
Overview of the lecture
  • Logarithms
  • Properties of logarithms
  • Computation of square roots
  • Computations of logarithms

8
Properties of logarithms
  • Proposition 5.1 Let b,r,s be positive real
    numbers with b?1. We have
  • These properties are related to properties of the
    exponents mentioned
  • in the previous lecture.

9
Properties of logarithms
  • Proof of the first property
  • By the definition of logarithm
  • Using a property of the exponents, we get
  • and finally, again from the definition of the
    logarithms, we get

10
Properties of logarithms
  • Proposition 5.2 Let a,b,x be positive real
    numbers, with a,b ?1. We have,
  • This proposition allows the computation of the
    logarithm to any base, as
  • long as we can compute the logarithm to a given
    base.

11
Properties of logarithms
  • Proof By the definition of the logarithm
  • Taking logarithms (to base b) on both sides
  • Using proposition 5.1 (3) we get
  • giving,

12
Overview of the lecture
  • Logarithms
  • Properties of logarithms
  • Computation of square roots
  • Computations of logarithms

13
Computation of square roots
  • An iterative algorithm for computing the square
    root of a number b
  • 1. Start with an initial guess of the square
    root x1
  • 2. At each iteration of the algorithm, update x
    by
  • 3. Stop when the algorithm converges, that is,
    there is small difference in the value of x
    between two iterations.

14
Computation of square roots
  • Pseudo-code for computing the square root of a
    positive number b

procedure square root ( b positive real number
) x 1 while ( the algorithm has not
converged yet ) x is the square root of b
15
Computation of square roots
  • This algorithm is iterative. It is not
    immediately clear why the value of x
  • approaches the square root of b.
  • The algorithm has a simple geometric
    interpretation.
  • It was known (or something equivalent to it) to
    the Babylonians
  • 2000BC ?.
  • You dont have to memorize the algorithm.

16
Computation of square roots
The YBC 7289 tablet photo by Bill Casselman Yale
Babylonian Collection
  • Fowler and Robson, 1998
  • reprinted from Aaboe 1964

17
Overview of the lecture
  • Logarithms
  • Properties of logarithms
  • Computation of square roots
  • Computations of logarithms

18
The natural logarithm
  • The logarithm with base
  • arises naturally in many applications.
  • It is called the natural logarithm and denoted
    lnx.
  • e is an important mathematical constant (like the
    p 3.1415 )

19
Series expansion
  • If we can compute natural logarithms, than using
    Proposition 5.2 we
  • can compute logarithms at nay base.
  • We can compute natural logarithms using the
    series expansion
  • A series has infinite many terms.
  • The terms of this series decrease in absolute
    value (because -1ltxlt1)
  • and so, it is the first few terms that mainly
    influence the result.

for
20
Series expansion
  • We can find a good approximation of the logarithm
    by computing an
  • initial part of the series.
  • The larger the initial part (i.e. the most terms
    we take into account) the
  • better the approximation.
  • Different series can be used in the computation
    of other functions, for
  • example the trigonometric functions.
  • They can also be used to generalize a function
    beyond the realm of the
  • real numbers, e.g. matrix logarithms.
Write a Comment
User Comments (0)
About PowerShow.com