Computers and Technology

Formally prove that n^2 + n + 1 is in O(n^2).
Solution:
Let T(n) = n^2 + n + 1. Let f(n) = n^2.
Choose c = 3, and N = 1. Then, we know T(n) is in O(n^2) if we can prove
T(n) <= c f(n),
or equivalently, n^2 + n + 1 <= 3 n^2, for all n >= 1.
Is this inequality true? Well, for any n >= 1, we know that 1 <= n <= n^2.
Hence, all of the following are true:
1 <= n^2
n <= n^2
n^2 = n^2
Adding the left and right sides of these inequalities together, we have
n^2 + n + 1 <= 3 n^2, which completes the proof.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:30, kikilax
What is linux? an open source operating system a version of ms dos the first version of unix the newest technology available
Answers: 1
image
Computers and Technology, 22.06.2019 11:00, babbybronx
Lisa’s company, abc ltd., lost its biggest client and is now facing a financial crunch. most of her colleagues have resigned, but lisa decides to stay with the company and assist the management in overcoming the financial situation. which quality is lisa demonstrating? a. self-management b. cooperativeness c. responsibility d. loyalty
Answers: 2
image
Computers and Technology, 22.06.2019 14:20, capo9972
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
image
Computers and Technology, 22.06.2019 15:30, tfornwalt4390
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
Do you know the correct answer?
Formally prove that n^2 + n + 1 is in O(n^2).
Solution:
Let T(n) = n^2 + n + 1. Let f(n)...

Questions in other subjects:

Konu
Mathematics, 11.10.2020 09:01
Konu
Mathematics, 11.10.2020 09:01