Time Complexity Formula for Solving Recurrence Systems

  • Thread starter Thread starter ZERO_COOL
  • Start date Start date
  • Tags Tags
    Recurrence Systems
Click For Summary

Discussion Overview

The discussion revolves around solving a recurrence system to determine a formula for the time complexity function T(n). Participants explore various methods, including algebraic techniques and mathematical induction, to derive and validate the formula.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant proposes that the formula for T(n) should be T(n) = 5 * n + 4, providing specific values for T(0) and T(3) based on this formula.
  • Another participant suggests using mathematical induction to prove the proposed formula, indicating that this is a common method for validating solutions to recurrence relations.
  • A participant expresses uncertainty about their algebraic technique in deriving the formula, indicating a desire for feedback on their approach.
  • There is a discussion about the distinction between establishing a formula from a recurrence system and proving an already established formula.
  • One participant asserts that they have derived the formula T(n) = 5n + 4 using induction and classifies it within the Big O notation as O(n), seeking confirmation of this classification.

Areas of Agreement / Disagreement

Participants generally agree on the proposed formula T(n) = 5n + 4, but there is disagreement on the method of deriving and proving it, with some advocating for induction while others focus on algebraic techniques. The discussion remains unresolved regarding the best approach to establish the formula.

Contextual Notes

Participants express uncertainty about their algebraic manipulations and the steps involved in proving the formula. There are also discussions about the assumptions underlying the recurrence system and the implications of using different proof techniques.

Who May Find This Useful

This discussion may be useful for students and practitioners interested in recurrence relations, time complexity analysis, and methods of mathematical proof, particularly in the context of algorithm analysis.

ZERO_COOL
Messages
17
Reaction score
0

Homework Statement


Solve the recurrence system below and dtermine a formula for the time complexity function T(n).
T(0) = 4.
T(n) = 5 + T(n - 1) (n > 0)


The Attempt at a Solution


T(3) = 5 + T(2).
T(2) = 5 + T(1).
T(1) = 5 + T(0).

T(3) + T(2) + T(1) = 3 * 5 + T(2) + T(1) + T(0)
T(3) = 3 * 5 + T(0)
T(3) = 15 + 4.

Now try to obtain a formula for T(n) in terms of n.

T(n) = 5 + T(n - 1).
T(n - 1) = 5 + T(n - 2).
T(1) = 5 + T(0).
T(0) = 4.

T(n) + T(n - 1) + T(1) + T(0) = 3 * 5 + T(n - 1) + T(n - 2) + T(0) + 4.

**THIS IS WHERE MY BRAIN HITS MELTING POINT AND THE COOLANT IS RELEASED.

I'm pretty sure the formula should be T(n) = 5 * n + 4. So,

T(0) = 5 * 0 + 4 = 4
T(3) = 5 * 3 + 4 = 19.

I need to prove it though :(
 
Physics news on Phys.org
ZERO_COOL said:
I'm pretty sure the formula should be T(n) = 5 * n + 4. So,

T(0) = 5 * 0 + 4 = 4
T(3) = 5 * 3 + 4 = 19.

I need to prove it though :(
That is the correct formula.

Have you tried to prove it via induction? (That is a big fat hint).
 
I have guessed at the formula being that it is a fairly simple pattern. I was taught that induction is used to prove a formula is a solution of a recurrence system when you have been given the solution. I'm trying to solve a recurrence system first using this algebraic technique. It's my fault for not explaining correctly I understand why you suggested induction. My problem is in my algebraic technique.

How does this look below:-

Now try to obtain a formula for T(n) in terms of n.

T(n) = 5 + T(n - 1).
T(n - 1) = 5 + T(n - 2).
T(2) = 5 + T(1)
T(1) = 5 + T(0).
T(0) = 4.

Sum each side and equate result...

T(n) + T(n - 1) + T(2) + T(1) + T(0) = T(n - 1) + T(n - 2) + T(1) + T(0) + 4 + (n - 1) * 5 + 4.

Subtract terms that appear on both sides...

T(n) = (n - 1) * 5 + 4 = 5n - 5 + 4 = 5n + 4 = 4 + 5n.

I'm a bit dubious about my algebra above, I feel like I'm close, I can taste it. Is it close / correct?
 
You are trying too hard. Try induction. How are you going to prove this by any means other than by induction?
 
Technically I do not have a formula to prove via induction.

I am trying to work out a formula from the recurrence system.

My goal is not to prove an established formula for a recurrence system but rather establish a formula for a recurrence system.

So when I am able to establish a formula from the recurrence system I will then be able to prove it is correct by using induction.

What I'm trying to achieve is using algebra solve a recurrence system.

Until I'm able to solve the recurrence system I am not able to prove the formula because there is no formula.
 
You have a guess, aka a hypothesis. You can use induction to prove or disprove this hypothesis.
 
I've used induction to get the formula as T(n) = 5n + 4.

Classifying this as O(f(n)) for a suitable function of f in the Big Oh hierarchy I get.

f(n) = 5n + 4 = O(n). This is because n is the dominant term.

I'm pretty sure on this just need a quick nod of approval if possible.

Thanks,
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
0
Views
2K
  • · Replies 15 ·
Replies
15
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K