
Patrick B. answered 07/14/20
Math and computer tutor/teacher
FALSE
T(n) = n+1
S(n) = n-1
O(n) = n+2
T(n) = n+1 = (n-1)+2 = O(S(n))
T(n) + 2 S(n) = n+1 + 2(n-1) = n+1 + 2n - 2 = 3n - 1
which is NOT O(S(n))
Mohamad Z.
asked 09/25/19Assume you have functions T and S such that T(n) =O(S(n)).
For the following statement, decide whether you think it is True or False.
If you think the answer is True, prove it, otherwise, provide a counter example.
Statement: T(n)+2S(n)=O(S(n))
Patrick B. answered 07/14/20
Math and computer tutor/teacher
FALSE
T(n) = n+1
S(n) = n-1
O(n) = n+2
T(n) = n+1 = (n-1)+2 = O(S(n))
T(n) + 2 S(n) = n+1 + 2(n-1) = n+1 + 2n - 2 = 3n - 1
which is NOT O(S(n))
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.