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

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

View Full Document Right Arrow Icon
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
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern