5

In http://www.cs.fsu.edu/~lacher/courses/COT5405/spring07/notes2.html, it says that $T(n) = aT(n/b) + f(n) $ is nonlinear recurrence.

But I think it is linear because $T(n)$ is linear in $T(n/b)$.

So I was wondering how a linear recurrence is defined?

Thanks and regards!

Yuval Filmus
  • 57,157
Tim
  • 47,382
  • 2
    If $T(n)$ were recursively expressed in terms of $T(n-1),T(n-2),\dots$, then it would be linear. – J. M. ain't a mathematician Apr 25 '11 at 01:32
  • 1
    It's already nonlinear because of the $f(n)$ term. – Qiaochu Yuan Apr 25 '11 at 03:16
  • 1
    @Qiaochu: The $f(n)$ term makes it non-homogeneous. – Mitch Apr 25 '11 at 04:04
  • @Mitch: my definition of a linear recurrence is that the set of solutions forms a vector space. There are certainly other definitions but this one makes the most sense to me. – Qiaochu Yuan Apr 25 '11 at 05:51
  • @Qiaochu: In the similar case for non-homogeneous linear ODE, although the set of its solutions is not a subspace, the ODE is still called linear, right? – Tim Apr 25 '11 at 06:12
  • @Tim: I don't know. I would call such a thing affine (the set of solutions forms an affine space rather than a vector space), but that's just me. – Qiaochu Yuan Apr 25 '11 at 06:15
  • 2
    @Qiaochu, are you taking the Humpty-Dumpty approach to language, where a word means what you want it to mean - it's just a question of who's to be master? $y=3x+4$ is a linear equation, $y'=y+x$ is a linear DE, and $T(n)=T(n-1)+n$ is a linear recurrence, whether you would say so or not. – Gerry Myerson Apr 25 '11 at 11:59
  • @Gerry: not that I don't believe you, but do you have a reference for the second two examples? (The things I know about linear recurrences I learned half on my own and half from a hodgepodge of sources, so I don't know what's standard and what's not.) – Qiaochu Yuan Apr 25 '11 at 15:19
  • 1
    @Qiaochu: it's not the function itself implied by the recurrence that is linear, it is the operations on the function that are linear. See my addendum and the link..OK I'll give it away...it's the same terminology as for ordinary differential equations. – Mitch Apr 26 '11 at 01:46
  • @Qiaochu, I'm away from my references, but I imagine any textbook that does linear ODEs will vouch for my second example, and for the third any intro discrete math text. – Gerry Myerson Apr 26 '11 at 04:02
  • 1
    @Qiaochu, Boyce and DiPrima, Elementary Differential Equations and Boundary Value Problems, 1st edition, p.13: "we will first consider the linear first order equation $y'+p(x)y=g(x)$...." I confess that I had a harder time finding a cite for recurrences; the first few books I looked at dealt with equations like $T(n)=T(n-1)+n$ without explicitly giving that type a name. But Grimaldi, Discrete and Combinatorial Mathematics, 1st ed., p.303, has "The general first-order linear recurrence relation with constant coefficients has the form $a_{n+1}+ca_n=f(n)$...." – Gerry Myerson Apr 27 '11 at 04:47

1 Answers1

7

A linear recurrence relation does not have terms with more than one recurrent factor.

That is,

$$T(n) = T(n-1)T(n-2) + T(n-3)$$

is not linear because of the term $T(n-1)T(n-2)$, but

$$T(n) = T(n/2) + T(n/3) + 1$$

is linear.

A recurrence is of finite order is one where the 'number of steps back that one takes' are specified by a constant (which is finite). So

$$T(n) = T(n-1) +1$$

is of finite order but

$$T(n) = T(n/2) +1$$

is not.

A recurrence has constant coefficients if, naturally, all the coefficients are constants. So

$$T(n) = n(T(n-1) + T(n-2))$$

has non-constant coefficients but

$$T(n) = 2 T(n/2)T(n-1) + n^2 $$

has constant coefficients.

A recurrence is homogeneous if all terms have a factor that is recurrent. So

$$T(n) = n^2 T(n-1)T(n-2) + T(n-3)^3$$

is homogeneous but

$$T(n) = T(n-1) + 1 $$

has not homogeneous.

So in my language, $T(n)=aT(n/b)+f(n)$ is linear but not of finite order and not homogeneous (and would be orthogonally called a divide and conquer recurrence).

Those are the definitions that I follow (and learned from somewhere - texts on discrete mathematics - I think Rosen, Liu, Tucker). If those are your notes for a class you are taking, I'd go with that definition while you are taking the class, and be very aware that other texts use different meanings.

As an addendum, these definitions are useful, whatever their mismatch with what you expect, whether they match the terminology used in other ...oh... duh... the terminology for recurrences is based on that of linear differential equations. Pretty much the same stuff.

Mitch
  • 8,591
  • Thanks! That webpage of the class was just found by me via google. I was wondering which book by Tucker you mentioned? – Tim Apr 25 '11 at 03:06
  • Alan Tucker, Applied Combinatorics, Rosen; Kenneth Rosen, Discrete Mathematics and its Applications; Liu, Intro to Discrete Math (very old, probably not in there). Googling, I found it hard to support 'finite order' directly, but people seem to be using it as I defined. – Mitch Apr 25 '11 at 03:15