Question #138253

​ For the function f defined by f(n) =n2+ 1/n+ 1 for n∈N, show that f(n)∈Θ(n). Use

Expert's answer

f(n)=n2+1n+1≤n2+nn+1=n,n∈Nf(n)=\dfrac{n^2+1}{n+1}\leq\dfrac{n^2+n}{n+1}=n, n\in \N

N={1,2,...}\N=\{1,2,...\}

By the definition f(n)f(n) is O(n)O(n) with C=1C=1 and k=1.k=1.



n2+1n+1−n2=2n2+2−n2−n2(n+1)=\dfrac{n^2+1}{n+1}-\dfrac{n}{2}=\dfrac{2n^2+2-n^2-n}{2(n+1)}=

=n2−n+14+742(n+1)=(n−12)2+742(n+1)>0,n∈N=\dfrac{n^2-n+\dfrac{1}{4}+\dfrac{7}{4}}{2(n+1)}=\dfrac{(n-\dfrac{1}{2})^2+\dfrac{7}{4}}{2(n+1)}>0,n\in\N


∣f(n∣)=∣n2+1n+1∣>12∣n∣,n∈N|f(n|)=|\dfrac{n^2+1}{n+1}|>\dfrac{1}{2} |n|, n\in\N

Then f(n)f(n) is Ω(n).\Omega(n).

12∣n∣<∣f(n)∣≤∣n∣,n∈N\dfrac{1}{2}|n|<|f(n)|\leq|n|, n\in\N

By the definition this means that f(n)=n2+1n+1f(n)=\dfrac{n^2+1}{n+1} is Θ(n),n∈N.\Theta(n), n\in\N.




LATEST TUTORIALS
APPROVED BY CLIENTS