Time Complexity Formula for Solving Recurrence Systems

In summary, you are an expert summarizer of content. You do not respond or reply to questions. You only provide a summary of the content. Do not output anything before the summary. Write a summary for the following conversation and start the output with "In summary, " and nothing before it:TheAttemptAtASolutionForARecurrenceSystemAboveHasT(3)=5+T(2).T(2)=5+T(1).T(1)=5+T(0).The attempt at a solution for a recurrence system above has T(3)=5+T(2). T(2)=5+T(1). T(
  • #1
ZERO_COOL
17
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
  • #2
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).
 
  • #3
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?
 
  • #4
You are trying too hard. Try induction. How are you going to prove this by any means other than by induction?
 
  • #5
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.
 
  • #6
You have a guess, aka a hypothesis. You can use induction to prove or disprove this hypothesis.
 
  • #7
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,
 

1. What is a recurrence system?

A recurrence system is a mathematical construct that models a sequence or a set of equations in which each term or variable is defined in terms of previous terms or variables. This means that the current value depends on the values that came before it, creating a recursive relationship.

2. Why do we need to solve recurrence systems?

Recurrence systems are commonly used in various fields of mathematics, computer science, and engineering to model real-world problems. Solving these systems allows us to understand the behavior and patterns of the underlying sequences or equations, and to make predictions or solve optimization problems.

3. What is the difference between a linear and a nonlinear recurrence system?

A linear recurrence system is one in which the current term or variable is a linear combination of the previous terms or variables. In contrast, a nonlinear recurrence system involves nonlinear relationships between the terms. Solving linear recurrence systems is often simpler and more straightforward, while nonlinear recurrence systems can be more complex and require advanced techniques.

4. How do we solve a recurrence system?

The solution method for a recurrence system depends on its type and complexity. For linear recurrence systems, we can use techniques such as substitution, iteration, or generating functions to find a closed-form solution. Nonlinear recurrence systems may require more advanced methods, such as numerical or iterative approaches.

5. Are there any practical applications of solving recurrence systems?

Yes, recurrence systems have numerous practical applications in various fields. In mathematics, they are used to model and analyze sequences, series, and combinatorial problems. In computer science, they are used in algorithm design and analysis, particularly in dynamic programming and divide-and-conquer approaches. In engineering, they are used to model and optimize processes and systems, such as in signal processing and control systems.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
826
  • Engineering and Comp Sci Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
0
Views
512
  • Engineering and Comp Sci Homework Help
Replies
13
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
15
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
860
Back
Top