e6exam1secAsolnsW06 - Engineering 6, Winter 2006 Midterm...

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

View Full Document Right Arrow Icon
Engineering 6, Winter 2006 Midterm Solutions Lecture Section A (TTh3:00-4:30) Regrade requests: Regrade requests must be submitted in writing to Dr. Lagerstrom no later than the lecture section on Thursday, March 2. Regrades will only be considered in cases where it looks like the grader missed something. That is, requests along the lines of "I think I deserve more points" will not get very far, because the the grading scale on each problem was applied consistently for all students. Note also : Your exam may have been photocopied before it was returned, so please don't risk your engineering career here at UCD by changing an answer and submitting it for a regrade. Exam Version A = blue and green copies Exam Version B = white and yellow copies Version A: Problem 1. (16 points total, 4 points for each part) Version B: Problem 5. (16 points total, 4 points for each part) Grading Note: Exact wording as below not required, but definition/description must be correct. (a) List the two basic types of programming errors and give a brief definition or description of each. Syntax error = spelling or typographical error, e.g., leaving off required punctuation or misspelling a variable name or not defining a variable before it's used. Logic and/or runtime error = errors in programming logic, such that the program runs properly but does not produce the intended result because of an error in its logic. (Note: The lecture notes distinguish between logic and runtime errors on p. 48, with runtime errors specifically being errors that occur for a particular set of data leading to an infinite or NaN result. Listing, therefore, "logic error" and "runtime error" as the two types of errors is also a correct answer to this problem, as long as each was defined/described correctly.) (b) What is the significance of the special Matlab variable named eps ? (Note: you don’t have to give its exact value, but just explain what it is.) eps is the smallest amount by which two numbers can differ in Matlab (or in the IEEE double-precision standard).
Background image of page 1

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

View Full DocumentRight Arrow Icon
(c) When Matlab executes the assignment statement theResult = 1 – 0.2 – 0.2 – 0.2 – 0.2 – 0.2 it gives the result as 5.5511e-17, when we all know the answer should be 0 exactly. Why doesn't Matlab get this right? Because Matlab has to convert the base-10 notation to base-2 notation to do the calculation, and then
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/02/2009 for the course EEC eng 6 taught by Professor Lagerstrom during the Winter '06 term at UC Davis.

Page1 / 8

e6exam1secAsolnsW06 - Engineering 6, Winter 2006 Midterm...

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

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