Big O: find ##c## and ##n_0## if ##g(n)## is known

  • Context: C# 
  • Thread starter Thread starter Korisnik
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on determining constants ##c## and ##n_0## for the function ##f(n) = a\cdot n^{143} + b \cdot n! + d \cdot (n!)! + m \cdot 2^n - p \cdot \sqrt{n} + 42##, given that it is known to be ##\mathcal{O}((n!)!)##. The participants assert that while one can sum the absolute values of the coefficients to find ##c##, the choice of ##n_0## is critical and must ensure that all terms in ##f(n)## are asymptotically dominated by ##g(n)##. The discussion concludes that negative terms can be excluded from the calculation of ##c##, but careful selection of ##n_0## is essential for the inequality to hold.

PREREQUISITES
  • Understanding of Big O notation and asymptotic analysis
  • Familiarity with factorial growth rates and their implications
  • Knowledge of polynomial and exponential functions
  • Basic principles of inequalities in mathematical analysis
NEXT STEPS
  • Study the properties of factorial functions and their growth rates
  • Learn about asymptotic notation and its applications in algorithm analysis
  • Explore techniques for determining constants in Big O analysis
  • Investigate examples of functions where negative terms affect asymptotic behavior
USEFUL FOR

Mathematicians, computer scientists, and software engineers involved in algorithm analysis and performance optimization, particularly those working with complex functions and Big O notation.

Korisnik
Messages
62
Reaction score
1
TL;DR
easy way to find c and n0 if g(n) known in O(g(n))
Is it guaranteed that when I have any kind of function ##f##, that I'll be able to find constants ##c## and ##n_0## if I know ##g## by simply adding up the factors multiplying all the terms in the equation?

Suppose ##f(n) = a\cdot n^{143} + b \cdot n! + d \cdot (n!)! + m \cdot 2^n - p \cdot \sqrt{n} + 42##, now I know here that ##f## is ##\mathcal{O}((n!)!)##, meaning that ##g(n) = (n!)!## (where ##\mathcal{O}## takes ##g(n)##).

But can I immediately assume that that holds if I pick ##c = a + b + d + m + p + 42## (taking absolute values of all the factors multiplying each term in ##f(n)##) and letting ##n_0 = 1## such that ## 0 \leq f(n) \leq c \cdot g(n), \ \forall n\in\mathbb{Z}^+,\ n\geq n_0##?

Will this technique work for all functions ##f##? Moreover, I think this can be simplified further by not even taking the factors before negative terms (in this case ##p##).

Thanks in advance.

Edit:

Actually, I think this is sort of trivial to prove, because if indeed we have the "biggest" function ##g(n)## figured out, then if we simply do the following: $$0 \leq f(n) = a\cdot n^{143} + b \cdot n! + d \cdot (n!)! + m \cdot 2^n - p \cdot \sqrt{n} + 42 \leq c \cdot g(n) = (a + b + d + m + p + 42) \cdot (n!)! = a \cdot (n!)! + b \cdot (n!)! + d \cdot (n!)! + m \cdot (n!)! + p \cdot (n!)! + 42 \cdot (n!)!$$ and each of these new terms grows faster than each of the terms in ##f(n)##, and further, since negative terms only "discontribute", there's no need to even include those, because by excluding them, you get a faster growing function than ##f(n)##.
 
Technology news on Phys.org
With n0=1 this won't work.

Consider f(x)=x!+2x. Your approach would lead to g(x)=2x!, then g(1)=2 but f(1)=3.

The approach works if you choose an n0 such that the other terms have the asymptotic inequalities, in this case ##x! \geq 2^x##.
 

Similar threads

Replies
59
Views
9K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
6
Views
2K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 61 ·
3
Replies
61
Views
10K