practice midterm

3 pts) When implementing while loops, Python requires: a) an index that is incremented at the beginning of each loop b) a logical expression that is initially true c) a logical expression that is evaluated at the beginning of each loop d) knowledge of how many times the loop should be executed 2. (3 pts) When creating a function in Python, which of the following is not required? a) the name of the function b) that any input arguments be included after the function name c) that any output arguments be included in the return statement d) that all variables used in the function be declared at the beginning 3. (3 pts) True error is defined as a) Present Approximation – Previous Approximation b) True Value – Approximate Value c) abs (True Value – Approximate Value) d) abs (Present Approximation – Previous Approximation) 4. (3 pts) When should you use approximate error instead of true error a) The actual value is unknown b) You have limited significant digits c) To represent error in relative percent d) You are estimating error using Big O notation 5. (3 pts) Truncation error is caused by approximating a) irrational numbers b) fractions c) rational numbers d) exact mathematical procedures 6. (3 pts) For the matrix A = np.array([[1,2,3],[4,5,6],[7,8,9]]), A[:,1] = a) [3,6,9] b) [1,4,7] c) [2,5,8] d) [4,5,6] 7. (3 pts) Machine epsilon gives a) the smallest number the system can represent b) the spacing between the two smallest numbers in the system c) the maximum possible ratio of the spacing between one number and the next compared to its magnitude d) all of the above 8. (3 pts) Which of the following is not true of the first-order Taylor series approximation of f(x) at a? a) it is always tangent to the f(x) b) it always requires knowledge of the first derivative of f(x) BIOM 2315—Computational Biomedical Engineering Practice Midterm Exam, SOLUTION Name _________________________________ Page 3 of 7 c) its truncation error always approaches zero as x approaches a d) its truncation error is always less than that of the zero-order approximation 9. (3 pts) The Taylor series represents a function as an infinite sum of terms calculated from a) values of the function at a single point b) values of the function at future points c) values of the function's derivatives at a single point d) values of the function's derivatives at future points 10. (3 pts) Which of the following will not tend to decrease truncation error in Taylor series approximations? a) increasing the number of terms b) increasing the number of significant digits c) including higher-order derivatives d) decreasing the step size 11. (3 pts) The Taylor series error propagation formula for a function of two variables assumes that variation due to one variable a) does not affect variation in the value of the function b) increases the variation due to another variable c) decreases the variation due to another variable d) is independent of the variation due to another variable 12. (3 pts) Numerical differentiation allows us to compute rates of change without knowing a) the step size between points b) values at different points c) the underlying function d) any of the above 13. (3 pts) Numerical integration involves evaluating a definite integral from a) a set of polynomials b) a set of derivatives c) a set of values d) a set of functions 14. (3 pts) Simpson's 1/3 rule requires a) an even number of segments b) an odd number of data points c) evenly spaced segments d) all of the abov

robot