151k views
2 votes
Given the recurrence relation:

T(n) = 6 if n ≤4 and

T(n) = T(n - 5) + 8 for all n> 4.

Find the value of T(326).

[Hint: Use a recursion tree to solve the recurrence exactly and plug the argument into the function you obtain.]

User Elan
by
7.3k points

1 Answer

2 votes

Final answer:

To find the value of T(326), we can use the given recurrence relation and a recursion tree. By summing up the 8's added at each step, we can find that T(326) = 526.

Step-by-step explanation:

To find the value of T(326), we need to use the given recurrence relation: T(n) = 6 if n ≤ 4 and T(n) = T(n - 5) + 8 for all n > 4. We can solve this recurrence relation using a recursion tree.

Step 1: We start with T(326).

Step 2: Since n = 326 > 4, we use the second part of the recurrence relation: T(n) = T(n - 5) + 8.

Step 3: Evaluating T(321), we again use the second part of the recurrence relation: T(n) = T(n - 5) + 8.

Step 4: We continue this process until we reach T(n) = 6, which satisfies the first part of the recurrence relation when n ≤ 4.

Step 5: Now, to find the value of T(326), we sum up all the 8's that were added at each step of the recursion tree, starting from T(326) and going backwards to T(n ≤ 4).

By doing this, we get:

T(326) = T(321) + 8 = T(316) + 8 + 8 = ... = T(6) + 8 + 8 + ... + 8 (summing up 65 times)

Since T(6) = 6 (according to the first part of the recurrence relation), we can substitute that value:

T(326) = 6 + 8 + 8 + ... + 8 (summing up 65 times)

T(326) = 6 + 65*8 = 6 + 520 = 526

Therefore, the value of T(326) is 526.

User Practual
by
7.3k points