Skip to content

Commit

Permalink
Adição da solução do exercício 2.1 nº 04.
Browse files Browse the repository at this point in the history
  • Loading branch information
BeyondMagic committed Aug 16, 2024
1 parent 6863548 commit c764067
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions computacao/problems_on_algorithms/solutions/2_1_04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
4. Prove por indução em $n >= 0$ que:

$$
\begin{aligned}
\sum_{i = 0}^{n} (2i + 1)^2 = \frac{(n + 1)(2n + 1)(2n + 3)}{3}
\end{aligned}
$$

Para o caso base $\( n := 0 \)$:

$$
\begin{aligned}
\sum_{i = 0}^{0} (2i + 1)^2 &= \frac{(0 + 1)(2 \times 0 + 1)(2 \times 0 + 3)}{3} \\
\sum_{i = 0}^{0} (4i^2 + 2i + 1) &= \frac{(1)(1)(3)}{3} \\
1 &= 1
\end{aligned}
$$

Suponha que agora para um $\( n \geq 0 \)$, e:

$$
\begin{aligned}
\sum_{i = 0}^{n + 1} (2i + 1)^2 &= \frac{(n + 2)(2(n + 1) + 1)(2(n + 1) + 3)}{3} \\
&= \frac{(n + 2)(2n + 3)(2n + 5)}{3} \\
&= \frac{(n + 2)(4n^2 + 16n + 15)}{3} \\
&= \frac{4n^3 + 24n^2 + 47n + 30}{3}
\end{aligned}
$$

Então:

$$
\begin{aligned}
\sum_{i = 0}^{n + 1} (2i + 1)^2 &= \sum_{i = 0}^{n} (2i + 1)^2 + (2(n + 1) + 1)^2 \\
&= \frac{(n + 1)(2n + 1)(2n + 3)}{3} + (2(n + 1) + 1)^2 \quad \text{hipótese da indução} \\
&= \frac{(n + 1)(2n + 1)(2n + 3) + 3(2(n + 1) + 1)^2}{3} \\
&= \frac{(n + 1)(2n + 1)(2n + 3) + 3(2n + 3)^2}{3} \\
&= \frac{(n + 1)(4n^2 + 8n + 3) + 3(4n^2 + 12n + 9)}{3} \\
&= \frac{(4n^3 + 12n^2 + 11n + 3) + (12n^2 + 36n + 27)}{3} \\
&= \frac{4n^3 + 24n^2 + 47n + 30}{3} \\
&\square \\
\end{aligned}
$$

0 comments on commit c764067

Please sign in to comment.