Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

anyone possible prove by using proof of contraposition on this function...? I ha

ID: 3667381 • Letter: A

Question


anyone possible prove by using proof of contraposition on this function...? I have no idea how to start

b) For any Integer J. II a.-1 Is even. tnen 1: IS 0dd c) There exists no integer a and b for which 21a+ 30b = 1. d) If 2,5-4x4 + 3x32,2 + 3x _ 4 > 0 , then x > 0 ^ or racire a 3r"-t a m-120.then +0.6. 1 2 Problem 2. (20 points) Assume a simplified version of project 1 where grades for each assignment are stored in an one dimensional array. Use (i) induction and (ii) proof by con- tradiction to prove the correctness of the following C function which finds the maximum grade in the given array of n elements. Show the induction steps. 1 float find.max (float *arr, int n)f float max= *arr; for(int i=0; i

Explanation / Answer

We can prove by contraposition by this way ..
Normally to find maximum from array, we must go through n-1 comparisions.
By contraposition ..
if Array A have comparisions lesser than n-1 comparisions, then A is not correct.
So for our contrapostive proof we will consider reverse..

"Array A is correct, if it doesnt have minimum n-1 comparisions in all cases."
So by going to fewer comparisions, we will not found exact maximum number from array.
So our assumption "Array A is correct, if it doesnt have minimum n-1 comparisions in all cases."
is wrong.
Hence proved