Classifying T(n) as O(f(n)): O(n)

  • Thread starter Thread starter ZERO_COOL
  • Start date Start date
Click For Summary
SUMMARY

The discussion centers on classifying the recurrence relation T(n) = 5 + T(n - 1) as O(f(n)), specifically determining that T(n) simplifies to T(n) = 5 + 5n. Participants confirm that T(n) is O(n), with the dominant term being 5n. Additionally, the concept of Big Theta (Θ) is introduced, indicating that T(n) is also Θ(n). A clarification is made regarding the initial condition T(0) = 4, which is essential for verifying the non-recursive formula.

PREREQUISITES
  • Understanding of recurrence relations and their solutions.
  • Familiarity with Big O notation and its hierarchy.
  • Knowledge of Big Theta (Θ) notation and its implications.
  • Basic algebraic manipulation to simplify expressions.
NEXT STEPS
  • Study the Master Theorem for solving recurrence relations.
  • Learn about the differences between Big O, Big Omega (Ω), and Big Theta (Θ) notations.
  • Explore examples of time complexity analysis in algorithms.
  • Investigate the implications of initial conditions in recurrence relations.
USEFUL FOR

Students and educators in computer science, particularly those focusing on algorithm analysis and time complexity, as well as software developers seeking to optimize their code performance.

ZERO_COOL
Messages
17
Reaction score
0

Homework Statement


Give a classification of T(n) as O(f(n)) for a suitable function f in the hierarchy of Big Oh.

Homework Equations


T(n) = 5 + T(n - 1) (n > 0) *THIS IS PART OF THE RECURRENCE SYSTEM.

T(n) = 5 + 5N. *THIS IS THE FORMULA FOR THE TIME COMPLEXITY FUNCTION. WORKED OUT BY SOLVING THE RECURRENCE SYSTEM.

The Attempt at a Solution


I've got confused, not sure if I give a classification of the formula that I worked out by solving the recurrence system or of the recurrence system.

I think it is the formula T(n) = 5 + 5n. In which case I *think* it's a no brainer because the only term is 5n and so,

T(n) = 5n is (O^2) and also it is O(n). Thus T(n) = 5n is of order n. Which means 5n is BIG THETA O(n).

Would appreciate ir if someone could verify I'm on the right track with this.
 
Physics news on Phys.org
ZERO_COOL said:

Homework Statement


Give a classification of T(n) as O(f(n)) for a suitable function f in the hierarchy of Big Oh.

Homework Equations


T(n) = 5 + T(n - 1) (n > 0) *THIS IS PART OF THE RECURRENCE SYSTEM.
You're missing something - what is T(1)? Without this I can't verify your non-recursive formula.
ZERO_COOL said:
T(n) = 5 + 5N. *THIS IS THE FORMULA FOR THE TIME COMPLEXITY FUNCTION. WORKED OUT BY SOLVING THE RECURRENCE SYSTEM.

The Attempt at a Solution


I've got confused, not sure if I give a classification of the formula that I worked out by solving the recurrence system or of the recurrence system.

I think it is the formula T(n) = 5 + 5n. In which case I *think* it's a no brainer because the only term is 5n and so,

T(n) = 5n is (O^2) and also it is O(n). Thus T(n) = 5n is of order n. Which means 5n is BIG THETA O(n).

Would appreciate ir if someone could verify I'm on the right track with this.

If T(n) = 5 + 5n, then T(n) is O(n). I have no idea what O^2 means or what BIG THETA O(n) means. It's been a long while since I worked with this stuff, and I don't remember learning about BIG THETA or O^2. Otherwise, I agree that T(n) = O(n), assuming your nonrecursive formula is correct.
 
The recurrence system part I didn't include was T(0) = 4.

Thanks,
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
8K
Replies
8
Views
5K
  • · Replies 19 ·
Replies
19
Views
4K
Replies
24
Views
7K