Prove that $\frac{f(n)+a}{g(n)+b} = O(\frac{f(n)}{g(n)})$

83 Views Asked by At

I was reading about algorithm analysis and I saw a similar simplification done in order to find the complexity. I became interested in proving that this simplification is formally correct but I am having trouble with the proof using the definition of big oh, so I ask your help.

Prove that $\displaystyle \frac{f(n)+a}{g(n)+b} = \mathcal O\left({\frac{f(n)}{g(n)}}\right)$ where $a,b$ are constants.

This is the definition I am using:

$f(n) = \mathcal O(g(n))$ if $\exists c,n_0\geq0 : \forall n\geq n_0, 0\leq f(n) \leq cg(n)$

1

There are 1 best solutions below

0
On

Just notice that $f +a \leq 2f$ and $g+b > \frac{g}{2}$, fomr which you get the $O(\cdot)$.