Grading Guide for Assignment 3 The correct answer for the pile depth is: 3.4218 ************************************************************************* Points | C | S ________ _______ _____________ 5 | 0-3 | 0-1 ________ _______ _____________ 4 | 4-8 | 2-3 ________ _______ _____________ 3 | 9-14 | 4-5 ________ _______ _____________ 2 | 15-20| 6-7 ________ _______ _____________ 1 | 20-30| 7-8 ________ _______ _____________ 0 | more | more ************************************************************************* UNIVERSAL STYLE/CORRECTESS POINTS (same for all problems) X represents problem # (i.e. 1,2,4...) cXa: doesn't compile, or no submitted file, or discussion is not in a text file // c1a counts as 4 correctness points, ie. c1a = 4 // similarly, c2a = 5, c3a = 9, c4a = 10, c5a = 8 cXb: compilation warning sXa: redundant code; sXb: bad formatting for code style; sXc: no comments; sXd: no header; sXx: bad file name; sXy: bad formatting for output; sXz: using break in the loop; if they do it for every loops, treat it as one mistake ************************************************************************* 1. guessmethod c1c: code syntax: if ... else ... end c1d: test case1 input = 3 output: bad guessing! equation produces value -33.06 of depth 3.00 c1e: test case2 input = 3.4218 output: good guessing! equation produces value -0.00 of depth 3.42 c1f: user input error handling input = -1 -> some error message ************************************************************************* 2. manualmethod test c2c: [0, 10] c2d: [3, 4.5], look at the plot, there should be a root error handling c2e: low = -1 c2f: low = 3; high = 2; prompt for retesting c2g: if user says no, program should terminate c2h: if user says yes, program should correctly execute another time style s2e: xlabel, ylabel, s2f: title, s2g: tick mark labels ************************************************************************* 3. lhsrhsmethod code syntax / algorithm correctness c3c: correct condition in loop while ( abs(eqn-target) > eps && iterations <= max_iterations) c3d: increase the iteration counter c3e: if sign changes, need to refine the increment --- divide it by 10; c3f: if d becomes smaller than 0, need to change direction c3l: need to change direction, when the sign changes. test c3g: [1, pos] -> 3.4218, iterations is about 260 c3h: [4, pos] -> "takes too long", see if terminated c3i: [1, neg] -> 3.4218, see if reverse direction when hitting 0, not neccessarily to print out user input error handling c3j: [-1, ..] c3k: [3, yes] style s2e: print out # of iterations s2f: prints solution s2g: prints value of the equation at solution (Note: DO NOT take off if program doesn't prompt for retesting) ************************************************************************* 4. bisection code syntax / algorithm correctness c4c: correct condition in loop while ( abs(eqn-target) > eps && iterations <= max_iterations) c4d: increase the iteration counter c4e: compute the mid point and its equation value correctly c4f: update the interval correctly test c4g: [1, 4] -> 3.4218, iterations is about 13 c4h: [4, 10] -> "takes too long", see if terminated c4i: [1, 1000000] -> 3.4218, iterations is around 31 user input error handling c4j: [-1, ..] c4k: [10, 5] c4l: it needs to prompt for another interval if solution isn't found. style s4e: print out # of iterations s4f: prints solution s4g: prints value of the equation at solution ************************************************************************* 5. newtonsmethod code syntax / algorithm correctness c5c: correct condition in loop while ( abs(eqn-target) > eps && iterations <= max_iterations) c5d: increase the iteration counter c5e: compute the derivative correctly; c5f: compute the new value correctly; test c5g: input = 1 -> -0.0705, iterations = 3; or they can ask for a new guessing.. c5h: input = 4 -> 3.4219, iterations = 3; c5i: input = 1e+10 -> 3.4219, iterations = 79; user input error handling c5j: input = -5 (Note: DO NOT take off points for returning negative root for input value near 0. This is technically wrong, but our p-code solution also had this wrong, so we can't penalize students for this) ************************************************************************* 6. Discussion c6c: newtonsmethod is the best, c6d: bisection is good, similar to binary search c6e: lhsrhsmethod is slow, similar to linear search ************************************************************************* The bonus question is either right or wrong. DON'T PUT THE BONUS POINTS IN ASSIGNMENT 3, PUT THEM IN THE "BONUS POINTS" --- a separate assignment. If they used symbolic toolbox and did it right: 10 points If they didn't use symbolic toolbox, but also return the right solution: 2 points ************************************************************************* Points | C | S ________ _______ _____________ 5 | 0-3 | 0-1 ________ _______ _____________ 4 | 4-8 | 2-3 ________ _______ _____________ 3 | 9-14 | 4-5 ________ _______ _____________ 2 | 15-20| 6-7 ________ _______ _____________ 1 | 20-30| 7-8 ________ _______ _____________ 0 | more | more