{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

scan0013

scan0013 - MIDTERM EXAM I(continued PROBLEM#2 Let problem H...

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: MIDTERM EXAM I (continued) PROBLEM #2 Let problem H be the problem of determining 6 whether a given positive integer k is composite (n_otprime). Consider the following NP program for solving H .' program is_composite ( int k ) { 1nt j ; if ( k == 1 ) success() ; if ( k == 2 ) failure() ; for ( j = 2 ; j < k ; j++ ) if ( k % j == ) success() ; failure() ; TRUE or FALSE ? " If we can prove that the above program gives the correct answer for every positive integer k , then we have proved that II E P " 4 D TRUE or E FALSE ? (Check one box corresponding to your answer, and explain below why you chose the answer you did) 31:4? , J52 1247-. 3/ Jr/) 5 0 Q41 9 v N 1* W7“ m - feq M" A?" ”V 71/ ‘ . ‘/ . ”iii (god/(1 a He'?{MW/{7C' \ 6) [/y YEW; W ﬂxﬂ Hm P}/ a mm -—‘ d a” gem/“amt ...
View Full 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