When a counting recurrence's characteristic polynomial has a repeated root r, why is A*r^n + B*r^n not a general solution?
answer
- two copies of one solution is one solution
- count the free constants
- multiply by n for independence
- multiplicity m gives powers of n
- (A + Bn) times r to the n
basics
~20 sBecause it collapses: Ar^n + Br^n is (A+B)r^n, one free constant where a second-order recurrence needs two, so it cannot match two independent starting values. The missing second solution is nr^n, giving (A + B*n)*r^n.
solid answer
~40 sWriting the repeated root twice adds nothing: `A*r^n + B*r^n = (A+B)*r^n`, a one-parameter family. A second-order recurrence needs two free constants, because its first two values are independent, so the form is not general — for most starting pairs there is no choice of `A` and `B` that fits. The fix is a genuinely different second solution, `n*r^n`, so the general solution is `(A + B*n)*r^n`. Take `f(n) = 4f(n-1) - 4f(n-2)`, whose polynomial is `(r-2)^2` with the double root 2: with `f(0)=1`, `f(1)=6` you get `A=1`, `B=2`, and `(1+2n)*2^n` reproduces 1, 6, 20, 56, 144. For a root of multiplicity `m` the basis is `r^n, n*r^n, ..., n^(m-1)*r^n`.
go deeper
Know only that a closed form needs as many free constants as the recurrence looks back positions. The repeated-root case itself is not screening material.
Be able to say why two identical geometric terms collapse into one, and recognise that the fix introduces a factor of n rather than a second base.
Derive the form under pressure and verify it against the recurrence for two or three values, and state that the exponential base is unchanged while the magnitude gains a linear factor.
Watch the reporting consequence: a count described as plain exponential with base r understates a repeated-root sequence by a growing linear factor, which matters when the number backs a capacity claim.
## The dimension argument A linear homogeneous recurrence of order `k` with constant coefficients has a solution space of dimension exactly `k`: the first `k` values may be chosen freely and everything after them is forced. So a general solution must carry **k independent arbitrary constants**, and a candidate form that carries fewer is not general, however many letters appear in it. With distinct roots `r1, ..., rk`, the geometric sequences `ri^n` are independent and the count works out. When two roots coincide you have only one distinct geometric sequence, and writing it twice is arithmetic theatre: `A*r^n + B*r^n = (A+B)*r^n` That is one parameter wearing two names. Given two independent initial conditions, it will generally fail to satisfy both — the symptom in an interview is a candidate producing two equations in what is really one unknown and getting a contradiction. ## Why n*r^n is the missing solution The repair is to multiply by `n`, which is not a constant factor, so `n*r^n` is genuinely independent of `r^n`. It also genuinely satisfies the recurrence. Take the order-2 example `f(n) = 4f(n-1) - 4f(n-2)`, whose characteristic polynomial is `r^2 - 4r + 4 = (r-2)^2` with the double root `r = 2`. Substituting `f(n) = n*2^n`: `4*(n-1)*2^(n-1) - 4*(n-2)*2^(n-2) = 2*(n-1)*2^n - (n-2)*2^n = (2n - 2 - n + 2)*2^n = n*2^n` It checks out exactly. The general rule is that a root of **multiplicity m** contributes the `m` independent solutions `r^n, n*r^n, n^2*r^n, ..., n^(m-1)*r^n`, so the total number of basis solutions is still the order of the recurrence — multiplicities are counted, never dropped. ## A worked instance end to end With `f(0) = 1` and `f(1) = 6`, the form `(A + B*n)*2^n` gives `A = 1` from `n = 0`, and `(1 + B)*2 = 6` so `B = 2`. Now compare the two routes: | n | from the recurrence 4f(n-1) - 4f(n-2) | from (1 + 2n)*2^n | |---|---|---| | 0 | — (given) | 1 | | 1 | — (given) | 6 | | 2 | 4*6 - 4*1 = 20 | 5*4 = 20 | | 3 | 4*20 - 4*6 = 56 | 7*8 = 56 | | 4 | 4*56 - 4*20 = 144 | 9*16 = 144 | They agree, which is the check worth doing aloud before trusting any closed form. ## What the extra factor does to growth - The **base is unchanged**: the exponential part is still `r^n`. The `n` factor is polynomial, not exponential. - The growth is therefore `n*r^n` in order of magnitude — strictly bigger than `r^n`, but by a factor that grows only linearly. - The ratio of consecutive terms still tends to `r`, but approaches it from one side rather than sitting on it, so a naive fit of a pure geometric to a few values will mis-estimate the constant. - Reporting such a sequence as "exponential with base r" is right about the base and understates the total by a linear factor — worth saying explicitly when the number is a capacity claim. ## How to spot the case before you are stuck 1. For an order-2 recurrence `f(n) = p*f(n-1) + q*f(n-2)`, the polynomial is `r^2 - p*r - q`, and the root repeats exactly when its discriminant `p^2 + 4q` is zero. 2. More generally, a polynomial has a repeated root precisely when it shares a factor with its own derivative, so a non-trivial greatest common divisor of the two is the general test. 3. Empirically: if the values do not fit `A*r1^n + B*r2^n` for any constants, and the recurrence is genuinely linear with constant coefficients, suspect a repeated root rather than an error in the data. ## What is actually being checked This is a differentiator rather than a screening question. The interviewer is watching whether you understand the **structure** of the solution — that the answer is a basis for a `k`-dimensional space, not a formula to reproduce. A candidate who knows why two copies of one solution is still one solution will re-derive the `n*r^n` fix under pressure; a candidate who memorised the distinct-roots formula will not.
- What is the growth of a sequence whose only characteristic root is 2, with multiplicity two?It is `(A + B*n)*2^n`, so the magnitude is `n*2^n`: exponential with base 2 carrying a linear factor. The ratio of consecutive terms tends to 2 but stays above it, so treating the sequence as a pure `2^n` underestimates it by a factor that keeps growing.
- Does the same rule extend to a root repeated three times?Yes. Multiplicity `m` contributes `r^n, n*r^n, ..., n^(m-1)*r^n`, so a triple root at `r` gives `(A + B*n + C*n^2)*r^n`. The number of arbitrary constants still equals the order of the recurrence, which is the invariant worth remembering.
- How do you detect a repeated root without factoring the polynomial?For order 2, the discriminant of `r^2 - p*r - q` being zero — that is, `p^2 + 4q = 0` — is the test. In general a polynomial has a repeated root exactly when it shares a factor with its derivative, so a non-trivial greatest common divisor of the two settles it.
Two rulers laid along the same direction still measure only that one direction, however you combine them. To pin down a point in a plane you need a second, genuinely different direction — which is what multiplying by n supplies.
saying these in an interview costs you the question
- Uses A*r^n + B*r^n and then cannot satisfy both initial conditions
- Invents a second root by negating the first one
- Says a repeated root means no closed form exists
- Claims the extra n factor changes the exponential base
- Lists the repeated root twice in the basis without the n factor