Quiz4_sol

Quiz4_sol - Solutions to Quiz 4 Question 1 proc...

This preview shows page 1. Sign up to view the full content.

Solutions to Quiz 4 Question 1 proc mean(a_1,...,a_n: integers) m:=a_1 for i:=2 to n m:=m+a_i end for m:=m/n end proc {m is the mean} worst case: n operations. Question 2 (a) Is | 2 n 2 - 7 n | ≤ C | 3 n 2 | , x > k for some k 1 ? Let k = 4 , then both sides are always positive and definition is 2 n 2 - 7 n 3 Cn 2 2 n - 7 3 Cn . For n = 4 , 1 12 C works for C = 1 . So C = 1 , k = 4 works. (b) We know 2 n 2 - 7 n O (3 n 2 ) . Show 2 n 2 - 7 n Ω(3 n 2 ) | 2 n 2 - 7 n | ≥ C | 3 n 2 | , n > k . Set k = 4 and 2 n - 7 3 Cn , k > 4 . For n = 4 , 2 - 3 C 7 / 4 . So C = 1 / 12 , k = 4 works. Thus
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern