1

I have the function:

$$ f(n) = \begin {cases} 4 & , n = 1 \\ f(\frac{n}{3}) + n^2 -3 & , n \ge2 \end {cases} $$

The given solutions shows the unwinding of the function as follows:

Assuming $ n \ge 2$

$$f(n) = f\bigg(\frac{n}{3}\bigg) + n^2 - 3$$ $$ = \bigg[f\bigg(\frac{n}{3}\bigg) + \bigg(\frac{n}{3}\bigg)^2 -3\bigg] + n^2 -3$$ $$ = f\bigg(\frac{n}{3^2}\bigg) + n^2 \bigg(\frac{1}{9} + 1\bigg) -6$$ $$ = \bigg[f\bigg(\frac{n}{3^3}\bigg) + \bigg(\frac{n}{3}\bigg)^3 -3\bigg] + n^2\bigg(\frac{1}{9} + 1\bigg) -6$$ $$ = f\bigg(\frac{n}{3^3}\bigg) + n^2 \bigg(\frac{1}{81} + \frac{1}{9} + 1\bigg) -6$$

Where I get lost are the last two lines of the unwinding because I do not understand where the $(\frac{n}{3})^3$ becomes to $n^2(\frac{1}{81} + \frac{1}{9} + 1)$.

Question is taken from UofT CSC236 Tutorial 6

R83nLK82
  • 41
  • 4

1 Answers1

1

The real question is where $\left(\frac{n}{3}\right)^3$ comes form. If you look at the formula, you see that it really should have been $\left(\frac{n}{3^2}\right)^2$.

The morale here is that people make mistakes. Calculations you see in tutorial, in lecture notes, and even in textbooks, are not infallible. When something seems to be amiss, try to understand what calculation is being done, and then try to reproduce it on your own. The mistake may disappear, as in this case, or may persist, in which case there might be a more serious issue in the mathematical development; unfortunately, this also sometimes happens. We are only humans, after all.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503