Opposites Attract: Understanding O Notation in Math & CS

  • Context: Undergrad 
  • Thread starter Thread starter Max.Planck
  • Start date Start date
  • Tags Tags
    Cs Notation
Click For Summary

Discussion Overview

The discussion centers on the interpretation of the O notation in mathematics and computer science, exploring the differences in limits applied in each context. Participants examine the implications of these definitions and whether they lead to contradictions.

Discussion Character

  • Debate/contested
  • Conceptual clarification

Main Points Raised

  • One participant notes that in mathematics, a term T is in O(x^p) if lim x->0 T/x^p=c for a constant c, while in computer science, it is defined as lim x->∞ T/x^p being a constant.
  • Another participant asserts that the O symbol is valid in both contexts, suggesting that the definition depends on the chosen limit for x.
  • A participant questions whether the two definitions contradict each other, providing an example where x^7 is in O(x^5) in mathematics but not in computer science.
  • Some participants argue that these are simply two distinct cases of a general concept and emphasize the importance of specifying the limit when using O notation.

Areas of Agreement / Disagreement

Participants express disagreement regarding whether the two definitions of O notation contradict each other. Some believe they are distinct cases of a broader concept, while others see potential contradictions in specific examples.

Contextual Notes

The discussion highlights the need for clarity in defining the limit when applying O notation, as different limits can lead to different interpretations and results.

Max.Planck
Messages
128
Reaction score
0
Hi, I noticed in mathematics the O symbol is used in the following way:

A term T is in O(x^p), if lim x->0 T/x^p=c, for a constant c.

While in computer science the O symbol is used is this way:

A term T is in O(x^p), if lim x->∞ T/x^p is a constant.

What gives, these two notations seem to be the complete opposite of each other?
 
Mathematics news on Phys.org
The O symbol is valid in both cases. It is up to you to define what the x limit is.
 
mathman said:
The O symbol is valid in both cases. It is up to you to define what the x limit is.

But don't they contradict each other?

For example, in the first case x^7 is in O(x^5), but in the second case it is not.
 
No, they are just two distinct cases of a general concept. We should aways say "f(x)= O(g(x)) as x-> a and specify a. They are using two different values of a and so getting two different results.
 
HallsofIvy said:
No, they are just two distinct cases of a general concept. We should aways say "f(x)= O(g(x)) as x-> a and specify a. They are using two different values of a and so getting two different results.

Aha, thanks!
 

Similar threads

  • · Replies 25 ·
Replies
25
Views
2K
Replies
11
Views
12K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 19 ·
Replies
19
Views
5K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K