0

I am trying to prove the closed form of this recurssion:

$$T(1)=0$$

$$T(n)=3*T(n/3)+log(n)$$

$n=3^k$ (1, 3, 9, 27...). All Logarithm are to the base of 3.

The closed form I found is: $T(k)=\sum_{i=0}^{k-1}3^{i}(k-i)$

For the induction:

$$T(3n) = 3*T(n)+k+1$$

$$T(3n) = 3*T(3^k)+k+1$$

$$T(3n) = 3*\sum_{i=0}^{k-1}3^{i}(k-i)+k+1$$

From here on I am stuck. How to continue?

  • 3
    I wouldn't quite consider this form "closed". The sum that expands with $n$ is not ideal. To remove the sum, consider$$\sum_{i=0}^{k-1} 3^i (k - i) = 3^k\sum_{i=0}^{k-1} (k - i)(1/3)^{k - i} = 3^k\sum_{j=1}^k j(1/3)^j.$$You can then look at this question. If you get a truly closed form, the induction will typically be easier. – Theo Bendit Jul 04 '22 at 22:38

2 Answers2

1

UPDATE I have added a few details for this problem. On 7/7, I added details for the first inductive proof and added an inductive proof for the non-sum expression given by GEdgar. On 7/5, I altered the proof somewhat from what was originally posted and fixed an inconsistency. My best renditions thus far follow.

I seek to show by induction that:

$$T(3^k) = 3T(3^{k-1}) + log_3(3^k)$$

Assuming that

$$T(k) = \sum_{i = 0}^{k-1}3^i(k - i)$$

Substituting the non-recursive expression into the recursive equation yields:

$$\sum_{i = 0}^{k-1}3^i(k - i) = 3\sum_{i = 0}^{k-2}3^i((k - 1) - i) + log_3(3^k)$$

It turns out that:

$$\sum_{i = 0}^{0}3^i(k - i) = log_3(3^k)$$

And also that:

$$\sum_{i = 1}^{k-1}3^i(k - i) = 3\sum_{i = 0}^{k-2}3^i((k - 1) - i)$$

For the induction:

Let $S$ equal the set of 1, $k > 1 \in \mathbb{N}$ such that

$$\sum_{i = 0}^{k-1}3^i(k - i) = 3\sum_{i = 0}^{k-2}3^i((k - 1) - i) + log_3(3^k)$$

Then $1 \in S$ by definition, $k+1 = 2 \in S$ since

$$\sum_{i = 0}^{1}3^i(2 - i) = 3\sum_{i = 0}^{0}3^i((2 - 1) - i) + log_3(3^2) = 5$$

So if $k \in S$, then $k + 1 \in S$ since the substitution of $k + 1$ for $k$ yields the original expression:

$$ \sum_{i = 0}^{(k+1)-1}3^i((k + 1) - i) = 3\sum_{i = 0}^{(k+1)-2}3^i(((k+1) - 1 - i) + log_3(3^{k + 1})$$

Therefore $S = \mathbb{N}$. QED.

7/7/2022 Update: inductive proof for the non-sum expression.

For clarity, it can be verified that for $k \in \mathbb{N}$,

$$\sum_{i = 0}^{k-1}3^i(k - i) = \frac{3^{k+1}-3}{4} - \frac{k}{2}$$

meaning that either one satisfies the recursive expression for $k > 1$. I will leave the derivation of these formulas as a separate problem.

My best rendition of proving the non-sum formula by induction follows:

Let $S$ equal the set of 1, $k > 1$ such that

$$\frac{3^{k+1}-3}{4} - \frac{k}{2} = 3*(\frac{3^{k}-3}{4} - \frac{(k - 1)}{2}) + log_3(3^k)$$

Then $1 \in S$ by definition, and $k+1 = 2 \in S$ since:

$$\frac{3^{2+1}-3}{4} - \frac{2}{2} = 5$$ and

$$3*\frac{3^{2}-3}{4} - \frac{(2 - 1)}{2} + log_3(3^2) = 5$$

So if $ if k \in S$, then $k+1 \in S$, since:

$$\frac{3^{k+2}-3}{4} - \frac{k+1}{2} = 3(\frac{3^{k+1}-3}{4} - \frac{k}{2}) + log_3(3^{k+1})$$

This equality can be established with basic algebra on both sides of the equation. Therefore $S = \mathbb{N}$.

  • I don't understand this line: $\sum_{i = 0}^{(k+1)-1}3^i((k + 1) - i) = 3\sum_{i = 0}^{k-2}3^i((k - 1) - i) + log_3(3^{k + 1}) + 3^k((k + 1) - k)$ Why do you use T(k-1) instead of T(k)? And where does the term $3^k((k + 1) - k)$ come from? – stackNutzer89 Jul 05 '22 at 17:30
  • This "assuming" I think needs some justification! –  Jul 06 '22 at 02:05
  • The sum shown is from the original question post. Perhaps the original poster can provide a source? – Jeffrey Harkness Jul 06 '22 at 03:18
0

To solve: $$ T(1)=0;\quad T(n)=3T(n/3)+\log_3(n)\quad \text{where }n=3^k. $$ That is, $$ T(3^0)=0;\quad T(3^k)=3T(3^{k-1})+k\quad \text{where } k=1,2,3,\dots . $$ Write $S(k) := T(3^k)$. Then we have to solve $$ S(0)=0;\quad S(k)=3S(k-1)+k. $$ Solution of this is $$ S(k) = \frac{3^{k+1}-3}{4}-\frac{k}{2} . $$ [Proof by induction.]
Therefore, $$ T(n) = \frac{3(n-1)}{4}-\frac{\log_3(n)}{2},\quad n=3^k. $$

GEdgar
  • 111,679