Is there a difference between $O(x^n)$ and $O((x-1)^n)$?

79 Views Asked by At

In computer science, I learnt that for some pair of functions $f,g\colon \mathbb N \to \mathbb R$, we write $f=O(g)$ if there is a fixed constant $c > 0$ and $N \in \mathbb N$ such that for all $n \geqslant N$, $|f(n)| \leq c\cdot g(n)$.

For the functions $x^n$ and $(x-1)^n$, I think that it is not hard to see that $x^n = O((x-1)^n)$ (indeed, if we take $c=2$, we get that for $n \geq N = \sqrt[n]2/(\sqrt[n]2-1)$, $|x^n| = x^n \leq 2 \cdot (x-1)^n$), and it's even easier to see that $(x-1)^n=O(x^n)$ (take $c=1$ and $n=0$).

But then when I use Mathematica to expand Taylor series for example, I get that $\ln x$ centred at $x=1$ (Series[Log[x],{x,1,5}) yields $$\ln x = (x-1)-\frac{1}{2} (x-1)^2+\frac{1}{3} (x-1)^3-\frac{1}{4} (x-1)^4+O((x-1)^5),$$ where presumably the big-O at the end there is saying that the error is within some constant multiple of $(x-1)^5$. Am I right in saying that I can simply substitute this with ${}+O(x^5)$, in view of the reasoning above? Because, if I substitute $x=1$ in this expansion (and the big-O), I interpret this as saying that there is an error in the order of $O((1-1)^5) = O(0)$, which is the case since the Taylor series has zero error at $x=1$, and similarly when I substitute other values I feel that $O((x-1)^5)$ accurately reflects the error more than $O(x^5)$.

I suspect that replacing $O((x-1)^5)$ with $O(x^5)$ is still accurate but not as precise as retaining $O((x-1)^5)$ which would require a smaller $c$ for the error, but I am not sure. I appreciate any assistance.

2

There are 2 best solutions below

2
On BEST ANSWER

No, in that case you can't substitute it with $O(x^5)$. $O(x^5)=O((x-1)^5)$ when $x\to\infty$. However, when instead $x\to 1$, there is no $C$ such that $x^5\leq C(x-1)^5$ for all $x$ some minimum distance away from $1$ because $x^5$ will approach $1$ while $(x-1)^5$ approaches $0$. That is what is meant here.

2
On

If $x=1.1$, then the series is accurate to $0.1^5=0.00001$.
On the other hand, $x^5=1.61051$, so you would not even claim the units digit was correct.