Solve the recurrence relation \(a_n = a_{n-1} + n\) where \(a_0 = 0\) how to do this? First few values are (1,1), (2,3), (3,6), (4,10)... Is there any kind of formula for solving this?
work it the same way as previous
or you may eyeball the pattern you're adding sum of first n natural numbers
\[\begin{align} a_n &= a_{n-1}+n\\~\\ &= (a_{n-2}+ (n-1)) + n = a_{n-2} + 2n - 1 \\~\\ & = (a_{n-3} +(n-2)) + 2n-1 = a_{n-3} + 3n -(1+2)\\~\\ &=\cdots \\~\\ &=a_0 + n\cdot n - (1+2+\cdots + (n-1)) \\~\\&= a_0 + n^2 - \frac{n(n-1)}{2} \\~\\&= a_0 + \dfrac{n(n+1)}{2} \end{align}\]
I don't get how you're doing that substitution.
did you follow the second line : \[\begin{align} a_n &= a_{n-1}+n\\~\\ &= (a_{n-2}+ (n-1)) + n = a_{n-2} + 2n - 1 \\~\\ \end{align}\] ?
yes... just subtract 1 from every n in \(a_{n-1}\)
yes we just replace \(a_{n-1}\) by \(a_{n-2} + (n-1)\)
then we keep going few more levels to see the pattern
\[ \begin{align} a_n &= a_{n-1}+n\\~\\ &= (a_{n-2}+ (n-1)) + n = a_{n-2} + 2n - 1 \\~\\ & = (a_{n-3} +(n-2)) + 2n-1 = a_{n-3} + 3n -(1+2)\\~\\ \end{align} \] see if 3rd line also makes sense ^
sure just keep subtracting one in place of the a_ part but then the last lines i don't get
\[ \begin{align} a_n &= a_{n-1}+n\\~\\ &= (a_{n-2}+ (n-1)) + n = a_{n-2} + 2n - 1 \\~\\ & = (a_{n-3} +(n-2)) + 2n-1 = a_{n-\color{Red}{3}} + \color{red}{3}n -(1+\color{red}{2})\\~\\ \end{align} \]
Notice as you keep backtracking the levels, you will get \(a_0\) when : \[ \begin{align} &a_{n-\color{Red}{n}} + \color{red}{n}\cdot n -(1+2+\cdots + \color{red}{n-1})\\~\\ \end{align} \]
like how is \(a_0 + n^2 - (1+2+...+(n-1)) = n^2 - \frac{n(n-1)}{2}\)
whats the formula for sum of first `n-1` natural numbers ?
\[1+2+\cdots + (n-1) = ?\]
yeah?
thats supposed to be a question to you :) do you remember the formula for finding sum of first n natural numbers ?
no
look up in google
ah ok then
and \(\frac{2n^2}{2} + \frac{n^2-n}{2} = \frac{n(n+1)}{2} \) how..?
sorry minus
Join our real-time social learning platform and learn together with your friends!