MIT6_042JS10_lec25_sol

MIT6_042JS10_lec25_sol - Massachusetts Institute of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Massachusetts Institute of Technology 6.042J/18.062J, Spring ’10 : Mathematics for Computer Science April 7 Prof. Albert R. Meyer revised April 7, 2010, 888 minutes Solutions to In-Class Problems Week 9, Wed. Problem 1. Recall that for functions f,g on N , f = O ( g ) iff c N n 0 N n n 0 c · g ( n ) ≥ | f ( n ) | . (1) For each pair of functions below, determine whether f = O ( g ) and whether g = O ( f ) . In cases where one function is O() of the other, indicate the smallest nonegative integer , c , and for that small- est c , the smallest corresponding nonegative integer n 0 ensuring that condition ( 1 ) applies. (a) f ( n ) = n 2 ,g ( n ) = 3 n . f = O ( g ) YES NO If YES, c = , n 0 = Solution. NO. g = O ( f ) YES NO If YES, c = , n 0 = Solution. YES, with c = 1 , n 0 = 3 , which works because 3 2 = 9 , 3 3 = 9 . · (b) f ( n ) = (3 n 7) / ( n + 4) ,g ( n ) = 4 f = O ( g ) YES NO If YES, c = , n 0 = Solution. YES, with c = 1 ,n 0 = 0 (because | f ( n ) | < 3 ). g = O ( f ) YES NO If YES, c = , n 0 = Solution. YES, with c = 2 ,n 0 = 15 . Since
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

MIT6_042JS10_lec25_sol - Massachusetts Institute of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online