What Are the Big-O Notations for n^(n-1) and (n-1)^n?

  • Context: Undergrad 
  • Thread starter Thread starter peterlam
  • Start date Start date
  • Tags Tags
    Notation
Click For Summary

Discussion Overview

The discussion revolves around determining the big-O notations for the functions n^(n-1) and (n-1)^n. Participants explore the implications of big-O notation, its definitions, and the search for tighter asymptotic upper bounds for these functions.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant asks whether the big-O notations for n^(n-1) and (n-1)^n are the same as the original functions.
  • Another participant explains that according to the definition of big-O notation, both functions can be considered O(n^n), as n^n grows faster than both.
  • A participant expresses understanding that O(n^(n-1)) can be equated to n^n but questions if it can also be equated to n^(n-1) while seeking a tighter upper bound.
  • Another participant clarifies that while it is correct to state n^(n-1) = O(n^n), it is misleading to say O(n^(n-1)) = n^(n-1) as O() denotes an order rather than a function equality.
  • Concerns are raised about finding upper bounds that are simpler than n^(n-1) and tighter than n^n.

Areas of Agreement / Disagreement

Participants express differing views on the interpretation of big-O notation and whether tighter bounds can be established. No consensus is reached on the exact relationships between the functions and their big-O notations.

Contextual Notes

Participants note the importance of context in determining the appropriateness of big-O notations and the nuances in interpreting the notation itself.

peterlam
Messages
16
Reaction score
0
Hi!

For the following functions, what are their big-O notation?

1. n^(n-1)
2. (n-1)^n

Should their big-O notations be the same as the original functions? i.e.

1. O(n^(n-1)) = n^(n-1)?
2. O((n-1)^n) = (n-1)^n?

Please help!
Many thanks!
 
Physics news on Phys.org
If you look at the definition of big-O notation, it is an asymptotic inequality. Roughly speaking, f(x) = O(g(x)) whenever g grows as fast or faster than f.

In this case, g(x) = nn grows faster than both. So it would be both convenient and correct to say that both are O(nn).

Without more context, it is impossible to say whether this is "good enough" for your purposes.
 
  • Like
Likes   Reactions: 1 person
Thanks! I can understand that O(n^(n-1)) = n^n. But can I say O(n^(n-1)) = n^(n-1)? I am trying to find a tighter asymptotic upper bound.

Similar to the second case.

Thanks!
 
peterlam said:
Thanks! I can understand that O(n^(n-1)) = n^n. But can I say O(n^(n-1)) = n^(n-1)? I am trying to find a tighter asymptotic upper bound.

I have a quibble with the notation you use above. It is correct to say that nn-1 = O(nn). This is not a real equality. It's just a notation. One might loosely read "=O(g)" as "is of order g". It is incorrect to say that O(nn-1) = nn. The latter notation suggests that O() is a function which returns a single function as its value.

I can't think of any upper bounds that are both simpler than nn-1 and tighter than nn.
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 29 ·
Replies
29
Views
6K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K