What makes a recursive algorithm correct?
A recursive algorithm needs a base case that is solved directly and a recursive case that reduces the input toward that base case.
Study 08 Sequences and Recurrences with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What makes a recursive algorithm correct?
A recursive algorithm needs a base case that is solved directly and a recursive case that reduces the input toward that base case.
Why must a sequence’s starting index be specified?
The starting index matters because the same formula can produce different terms when indexing begins at different values.
What is the general term of an arithmetic sequence?
An arithmetic sequence has constant difference d, and its general term is an=a0+nd.
How do you sum the first n+1 terms of an arithmetic sequence?
The sum of the first n+1 terms is k=0∑nak=2n+1(a0+an).
What is the finite geometric-series formula?
For r=1, the finite geometric sum is k=0∑na0rk=a01−r1−rn+1.
What is the sum of an infinite geometric series when ∣r∣<1?
When ∣r∣<1, the infinite geometric series converges to k=0∑∞a0rk=1−ra0.
How does summation distribute over a linear combination?
By linearity, k=m∑n(cf(k)+dg(k))=ck=m∑nf(k)+dk=m∑ng(k).
What is the result of a telescoping sum?
If f(k)=g(k+1)−g(k), then k=m∑nf(k)=g(n+1)−g(m); the intermediate terms cancel.
Reindex k=1∑nak−1 using j=k−1.
Substituting j=k−1 changes the expression to j=0∑n−1aj. The bounds must change with the index.
What is the order of an=4an−1−an−2?
The recurrence an=4an−1−an−2 is second-order because it uses the two preceding terms.
What recurrence counts square-and-domino tilings of a 1×n board?
The tiling count satisfies an=an−1+an−2: a final square leaves an (n−1)-board, while a final domino leaves an (n−2)-board.
How is the characteristic equation formed?
For a homogeneous recurrence of order k, substituting an=rn gives rk−c1rk−1−c2rk−2−⋯−ck=0.