2. Use repeated expansions to solve the following recurrence: $T(1) = 1$ $T(n) = T(n-1) + n^2$ if $n > 1.$
Added by Timothy R.
Close
Step 1
T(n) = T(n-1) + n² = [T(n-2) + (n-1)²] + n² = T(n-2) + (n-1)² + n² = T(n-3) + (n-2)² + (n-1)² + n² = ... = T(1) + 1² + 2² + ... + (n-1)² + n² Show more…
Show all steps
Your feedback will help us improve your experience
Adi S and 87 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Find a particular solution to each nonhomogeneous recurrence: (a) an - 5an-1 - 6an-2 = 2^n (for n >= 2) (b) an - an-1 - 6an-2 = 5 * 3^n (for n >= 2) (c) an - an-1 - 6an-2 = n (for n >= 2)
Adi S.
Solve the following recurrence relation (Do not use the method of generating functions): An+2 - 2An+1 + An = 2n, n ≥ 0, a0 = 1, a1 = 2
Supreeta N.
Solve the recurrence relation an = 5an-1 - 6an-2 + 2n + 1 for n ≥ 2 with initial conditions a0 = 1 and a1 = 0.
Vysakh M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD