2

Is anyone familiar with using Mathematica to determine whether a function is asymptotic (big O) to another.

A function $f$ is asymptotic to function $g$ if there are positive $c, n0$ such that $|f(n)| ≤ c|g(n)|$, for all $n ≥ n0$. This relationship is written $f(n) ∈ O(g(n))$.

Example

Determine whether the function $f(x) = 17x + 11$ satisfies $f(x) ∈ O(x^2)$.

My solution is True, because the determining factor in $f(x)$ is less than or equal to x^2.

I would like to use Mathematica to check my answer. How can I do that?

Cael Ho
  • 21
  • 2

1 Answers1

2

(As long as your functions are analytical at the point of comparison), you can use the Series command

Series[f[x]/g[x],{x,x0,0}]

If this is O[1] our smaller than f[x] is O[g[x]] (at x0).

In your example, (presuming this is asked at infinity)

Series[(17x+11)/x^2,{x,\[Infinity],0}]

returns

17/x + O[1/x]^2

and hence is O[1/x]. Consequently, 17x+11 is O[x].

TimRias
  • 3,160
  • 13
  • 17