Mathematics

Algorithmic Recurrence Relations

Algorithmic recurrence relations are equations that describe the relationship between the input size of an algorithm and the number of operations required to solve the problem. They are used to analyze the time complexity of algorithms and to determine their efficiency. By solving these equations, we can predict the running time of an algorithm for different input sizes.

Written by Perlego with AI-assistance

6 Key excerpts on "Algorithmic Recurrence Relations"

  • Book cover image for: Essential Discrete Mathematics for Computer Science
    Chapter 25 Recurrence Relations Let a 0 , a 1 , ... be any infinite sequence (perhaps of numbers, but perhaps of strings or some other kind of mathematical objects). A recurrence relation is an equation or set of equations that makes it possible to find the value of a n in terms of the values of the a i for i < n . Recurrence relations are accompanied by one or more base cases, giving the value of a i for one or more fixed small values of i . Proofs by induction such as the ones in Chapters 3 and 4 include recur-rence relations. For example, the proof of (3.3) on page 27 relies on the proof that a n = n i = 0 2 i = 2 n + 1 − 1 by means of the recurrence relation and base case a n + 1 = a n + 2 n + 1 a 0 = 1. We also used a recurrence relation in Theorem 23.17 on page 253 to help calculate the number of partitions of an integer n into k parts. Recurrence relations arise naturally in the analysis of algorithms. Let’s start by revisiting (3.12), the formula for the sum of the first n nonnegative integers: n i = 0 i = n · ( n + 1 ) 2 . (25.1) This formula arises in the analysis of the simple sorting algorithm that follows. This selection sort puts a list of numbers in increasing order by repeatedly finding the greatest number in the unprocessed part of the list 278 essential discrete mathematics for computer science and moving it to the beginning of the list. (The name “selection sort” refers to any sorting algorithm that operates by repeatedly selecting the next item and processing it.) We assume that lists are maintained as linked data structures, so that items can be removed and prepended in constant time. The notation A · B will mean a list that contains the elements of list A followed by the elements of list B . Algorithm S ( L ) , to sort a list L : 1. Set M ← λ 2. While L = λ (a) Find the greatest element of L , call it x (b) Let A and B be sublists such that L = A · x · B (c) L ← A · B ; that is, the result of removing x (d) M ← x · M 3.
  • Book cover image for: Methods in Algorithmic Analysis
    Chapter 5 Recurrences or Difference Equations Sequences, also known as functions of a discrete variable, appear in many applications of computer science, in numerical analysis, and, naturally, in discrete mathematics. Many of these applications are rooted in practical, engineering problems, where systems have a finite or denumerable state space. Other such scenarios arise when systems change their state at discrete instants of time only. A recurrence is an equation that describes the evolution or behavior of such a function. In this chapter, we present many such equations, and solve only a few special types. More solutions will be introduced and derived in subsequent chapters. A major application that relies on recurrences is the derivation of numerical approximation schemes for differential equations, obtained by a discretization of the continuous problem space; this scenario is not our objective here. However, a special section (§5.6) is dedicated to some numerical approximations. In general, a recurrence is used to find out the properties of a sequence, numeric or symbolic. In our applications, a sequence almost always is a function defined on a set of integers, typically, N = { 0 , 1 , 2 ,... } with values in the set of real (or complex) numbers. Traditionally, terms of sequences are denoted by subscripted symbols such as a n rather than a ( n ) . There will be exceptions, for example, when the subscripts become complex; thus we prefer A ( ⌈ n 2 2 ⌉ ) to A ⌈ n 2 2 ⌉ . A sequence is usually denoted by { a n } ∞ n = 0 or { a n } n greaterorequalslant 0 or simply { a n } , when the range is obvious. If a sequence of interest is finite, it is assumed to be embedded into an infinite one typically padded with zeroes. Infinite sequences also exist outside analysis of algorithms. For example, they arise in com-munication whenever we consider a signal that is sampled at discrete times. A signal might be electrical, mechanical, or optical.
  • Book cover image for: How to Count
    eBook - PDF

    How to Count

    An Introduction to Combinatorics, Second Edition

    Recursive functions are studied in the branch of mathematical logic known as recursive function theory or computability theory. Recursive definitions are also allowed in several programming languages. Recurrence relations are classified according to the form of the function f that occurs in the relation. In this chapter we discuss recurrence relations that can be solved using the device of generating functions. Exercises 7.3.1A Find a recurrence relation and initial conditions for the sequence { a n }, where a n is the number of strings of n digits (that is, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9) that do not contain consecutive even digits (where 0 counts as an even digit). 7.3.1B Find a recurrence relation and initial conditions for the sequence { a n }, where n is the number of strings of n digits that contain no consecutive 0s, no consecutive 1s, and no consecutive 2s. 7.4 FIBONACCI NUMBERS We have already seen in Section 7.2 how to work out the generating function of the sequence defined by the recurrence relation given by Equation 7.8. We are now going to take this idea further. If we have an explicit formula for the generating function, we may be able to use this to derive a formula for the coefficients in its power series. These coefficients are, of course, just the terms of the sequence in which we are interested. Before discussing the general method we give another illustration in relation to, perhaps, the best known of all sequences defined by a recurrence relation, namely, the Fibonacci numbers . These numbers are named after the Italian mathematician Leonardo of Pisa,* who introduced them in connection with the following problem. * Leonardo of Pisa lived during the late twelfth and early thirteenth century.
  • Book cover image for: Introductory Discrete Mathematics
    Recurrence Relations
    3.1    INTRODUCTION
    Consider a sequence a0 , au a2 , . . . , where ar is the solution of a certain combinatorial problem that depends on the input r. In Chapter 2 we discussed some methods to compute ar using generating functions. In some cases it will be possible to reduce the computation of the rth term of the sequence to earlier members of the sequence if ar can be expressed as a function of the earlier elements of the sequence. For example, consider the arithmetic progression sequence 4, 7, 10, 13, 16, . . . , where the initial number a0 is 4 and the common difference d is 3. Then the rth term of the sequence can be expressed in terms of the (r – l)th term by the equation ar = a
    r
    1 , + d. This equation is an example of a recurrence relation. The condition a0 = 4 is called the initial condition of this relation. Obviously, once the initial condition and the common difference are known any arbitrary term can be obtained by computing a1 , a2 , . . . , sequentially. Or we can obtain the rth term by solving the recurrence relation. In this case the solution is ar = 4 + 3r, where r is any nonnegative integer. Similarly, if we take the geometric progression sequence 4, 4.3, 4.32 , 4.33 . . . , the recurrence relation is ar = 3 . ar–1 , with initial condition a0 = 4 and the solution is ar = 4 . 3
    r
    .
    Recurrence Relations and Difference Equations
    The first difference d(an ) of a sequence {an } of real numbers is the difference an an–1 .The second difference d2 (an ) is d(an ) – d(an –1 ), which is equal to an – 2an-1 + an–2 . More generally the kth difference dk (an ) is dk- 1 (an ) – dk–1 (an _x ) . A difference equation is an equation involving an and its differences. For example, 3d2 (an ) + 2d(an ) + 7an = 0 is a second-order homogeneous difference equation. Observe that every ai , (i = 0, 1, 2, . . . ,n – 1) can be expressed in terms of an and these differences because an– 1 = an – d(an );
    and so on. Thus every recurrence relation can be formulated as a difference equation. On the other hand, using the definition of these differences, any difference equation can be formulated as a recurrence relation. For instance, the difference equation 3d2 (an ) + 2d(an ) + 7an = 0 can be expressed as the recurrence relation 12a
  • Book cover image for: Discrete Mathematics with Applications
    Chapter 5 Recursion It is common sense to take a method and try it. If it fails, admit it frankly and try another. But above all, try something. — FRANKLIN ROOSEVELT R ecursion is an elegant and powerful problem-solving technique, used extensively in both discrete mathematics and computer science. Many programming languages, such as ALGOL, FORTRAN 90, C++, and Java, support recursion. This chapter investigates this powerful method in detail. In addition, we will study three simple methods for solving recurrence relations: iteration, characteristic equations, and generating functions. We also will establish the validity of recursive algorithms using induction and analyze their complexities using the big-oh and big-theta notations. Some of the interesting problems we pursue in this chapter are: • There are three pegs X, Y, and Z on a platform and 64 disks of increasing sizes at X. We would like to move them from X to Z using Y as an auxiliary peg subject to the following conditions: Only one disk can be moved at a time. No disk can be placed on the top of a smaller disk. If it takes one second to transfer a disk from one peg to another, how long will it take to solve the puzzle? • Is there a formula for the number of n -bit words containing no two consecutive 1’s? • Suppose we introduce a mixed pair (male and female) of 1-month-old rabbits into a large enclosure on January 1. By the end of each month, the rabbits become mature, and each pair produces k − 1 mixed pairs of offspring at the beginning of the following month. Find the average age of the rabbit pairs at the beginning of the n th month. • Can we estimate the number of divisions required to compute gcd { a , b } by the euclidean algorithm? • What is a divide-and-conquer algorithm? If f ( n ) denotes the number of operations required by such an algorithm, what can you say about its order of complexity? 261
  • Book cover image for: Recursive Algebra, Analysis and Combinatorics
    • Y.L. Ershov, A. Nerode, S.S. Goncharov, J.B. Remmel(Authors)
    • 1998(Publication Date)
    • North Holland
      (Publisher)
    Relations with other subjects and future developments We have attempted to show in this introduction that there is a natural re- lation between Recursive Mathematics and other areas of Mathematics. For example, there is a natural relation between Recursive Mathematics and Con- structive Mathematics. There is also an intimate relation between Recursive Mathematics and Reverse Mathematics which was started by Friedman to classify theorems of mathematics by their proof theoretic strength over weak theories of arithmetics (see Simpson's article in this volume). Similarly, some of the work on Recursive Combinatorics is naturally connected with the the- ory of on-line algorithms (see Kierstead's article in this volume). There are many important unsolved problems in Recursive Mathematics and many areas which require further development. For example, the effec- tiveness of model-theoretic constructions continues to supply a rich source of problems. Pour-E1 and Richards [122] looked at the effective content of results from mathematical physics, but their work has just scratched the sur- face of a large area of interesting problems concerning the effective content of other applied areas, such as physics, control theory (see the article by Ge and Nerode [50]), and statistics. The work on Feasible Model Theory still lacks the sort of general sufficient conditions for the construction of polynomial- time models that abound in Recursive Model Theory. Similarly a theory of Polynomial-space Model Theory and Algebra is yet to be developed. In general, the work on Feasible Algebra has not yet yielded the equivalences xxxii Y. L. Ershov, S. S. Gonchavov, A. Nerode, and J. B. Remmel with classical complexity theoretic questions that can be found in the theory of Polynomial-time Analysis. In contrast, the use of the priority method which has many applications in Recursive Model Theory and Algebra has not found any uses in Recursive Analysis.
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.