{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
Image of page 1
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 flxfl Hm P}/ a mm -—‘ d a” gem/“amt ...
View Full 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