Part I 5. Part II 2. Part III 8. Part IV 10. Part V 5 TOTAL 30

Similar documents
CPS 5310: Parameter Estimation. Natasha Sharma, Ph.D.

Catholic Central High School

Least squares regression

Math 42: Fall 2015 Midterm 2 November 3, 2015

Chapter 8 Linear Algebraic Equations

ORF 523 Final Exam, Spring 2016

Worksheet Topic 1 Order of operations, combining like terms 2 Solving linear equations 3 Finding slope between two points 4 Solving linear equations

Spring /11/2009

MATH 3330 INFORMATION SHEET FOR TEST 3 SPRING Test 3 will be in PKH 113 in class time, Tues April 21

1 Review of Interpolation using Cubic Splines

Chapter 8: Linear Algebraic Equations

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /8:00-9:30

Polynomial Functions

ES-2 Lecture: More Least-squares Fitting. Spring 2017

MATH 3795 Lecture 12. Numerical Solution of Nonlinear Equations.

CHAPTER Order points and then develop a divided difference table:

MATH 2210Q MIDTERM EXAM I PRACTICE PROBLEMS

Spiral Review Probability, Enter Your Grade Online Quiz - Probability Pascal's Triangle, Enter Your Grade

Review. Numerical Methods Lecture 22. Prof. Jinbo Bi CSE, UConn

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20

Applied Linear Algebra in Geoscience Using MATLAB

Math 108 Final Exam Page 1 NO CALCULATORS OR CELL PHONES ALLOWED.

MA2501 Numerical Methods Spring 2015

Accelerated Advanced Algebra. Chapter 1 Patterns and Recursion Homework List and Objectives

GOOD LUCK! 2. a b c d e 12. a b c d e. 3. a b c d e 13. a b c d e. 4. a b c d e 14. a b c d e. 5. a b c d e 15. a b c d e. 6. a b c d e 16.

Math 1132 Practice Exam 1 Spring 2016

MA 161 Final Exam December 13, You must use a #2 pencil on the scantron sheet (answer sheet).

Unit 1 Vocabulary. A function that contains 1 or more or terms. The variables may be to any non-negative power.

Solutions to Systems of Linear Equations

Justify all your answers and write down all important steps. Unsupported answers will be disregarded.

Applied Numerical Analysis Quiz #2

Math 110 (Fall 2018) Midterm II (Monday October 29, 12:10-1:00)

Test 2 Review Math 1111 College Algebra

Math 131 Exam 1 October 4, :00-9:00 p.m.

Chapter 3: Inequalities, Lines and Circles, Introduction to Functions

Math 520 Exam 2 Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Math 343 Lab 7: Line and Curve Fitting

Math 51 Second Exam May 18, 2017

ORF 363/COS 323 Final Exam, Fall 2016

BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES

Numerical techniques to solve equations

INSTRUCTIONS USEFUL FORMULAS

Basic Fraction and Integer Operations (No calculators please!)

E7 Midterm Exam 2. Exam Date: November 14 E7 Midterm 2, Fall 2014 NAME : SID : SECTION : 1 or 2 (please circle your discussion section ) LAB :

Review. Midterm Exam. Midterm Review. May 6th, 2015 AMS-UCSC. Spring Session 1 (Midterm Review) AMS-5 May 6th, / 24

171S1.1 Graphs, Functions, Models August 23, 2012

MATHEMATICAL METHODS INTERPOLATION

MA 262, Fall 2017, Final Version 01(Green)

LHS Algebra Pre-Test

Cheat Sheet for MATH461

Honors Algebra II Final Exam Order - Fall 2018

Midterm 1 Solutions, MATH 54, Linear Algebra and Differential Equations, Fall Problem Maximum Score Your Score

Math 3C Midterm 1 Study Guide

Revised: 2/19/09 Unit 1 Pre-Algebra Concepts and Operations Review

MA3457/CS4033: Numerical Methods for Calculus and Differential Equations

Preliminary Examination, Numerical Analysis, August 2016

Part I Directions: MULTIPLE CHOICE Place your answer to each question on the space provided. 1. Which is equivalent to the equation y? 4.

MAC College Algebra

Curve Fitting and Interpolation

Engineering 7: Introduction to computer programming for scientists and engineers

18.06 Problem Set 8 Due Wednesday, 23 April 2008 at 4 pm in

MATH 220 CALCULUS I SPRING 2018, MIDTERM I FEB 16, 2018

Elementary Algebra Sample Final Exam Spring 2017

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. EGR 103L Fall Test 2 Solutions. Michael R. Gustafson II

Statistical methods. Mean value and standard deviations Standard statistical distributions Linear systems Matrix algebra

AMSC/CMSC 466 Problem set 3

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. C) x 8. C) y = x + 3 2

'XNH8QLYHUVLW\ (GPXQG73UDWW-U6FKRRORI(QJLQHHULQJ. EGR 103L Fall Test 2. Michael R. Gustafson II

Homework and Computer Problems for Math*2130 (W17).

Hani Mehrpouyan, California State University, Bakersfield. Signals and Systems

Lecture 28 The Main Sources of Error

COURSE SYLLABUS Part I Course Title: MATH College Algebra Credit Hours: 4, (4 Lecture 0 Lab G) OTM-TMM001

Last/Family Name First/Given Name Seat # Exam # Failure to follow the instructions below will constitute a breach of the Honor Code:

GOOD LUCK! 2. a b c d e 12. a b c d e. 3. a b c d e 13. a b c d e. 4. a b c d e 14. a b c d e. 5. a b c d e 15. a b c d e. 6. a b c d e 16.

BSM510 Numerical Analysis

MAT30S Grade 10 Review Mr. Morris

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

Practice Exam 2 (Solutions)

AP CALCULUS AB SUMMER ASSIGNMNET NAME: READ THE FOLLOWING DIRECTIONS CAREFULLY

SUMMER MATH PACKET for students

6A Lab Post-test. Instructions for printed version. Week 10, Fall 2016

Elementary Algebra SAMPLE Final Examination Spring 2015

Section 4.1 Polynomial Functions and Models. Copyright 2013 Pearson Education, Inc. All rights reserved

CS 170 Algorithms Spring 2009 David Wagner Final

University of British Columbia Math 307, Final

Math Sec 4 CST Topic 7. Statistics. i.e: Add up all values and divide by the total number of values.

Companion. Jeffrey E. Jones

(4) Statements that contain the word "including" reference content that must be

10-725/ Optimization Midterm Exam

MATH ASSIGNMENT 07 SOLUTIONS. 8.1 Following is census data showing the population of the US between 1900 and 2000:

The University of British Columbia Final Examination - April 11, 2012 Mathematics 105, 2011W T2 All Sections. Special Instructions:

Midterm Examination. Mth 136 = Sta 114. Wednesday, 2000 March 8, 2:20 3:35 pm

Geometry Summer Assignment 2018

Section 4.1: Polynomial Functions and Models

SUMMER MATH PACKET students. Entering Geometry-2B

College Algebra: Midterm Review

Mark Test 01 and Section Number on your scantron!

2018 Fall 2210Q Section 013 Midterm Exam II Solution

a factors The exponential 0 is a special case. If b is any nonzero real number, then

2012 Texas Essential Knowledge and Skills for Algebra II in Pearson Texas Algebra II

Transcription:

Page 1 of 10 Name/SID SOLUTION UNIVERSITY OF CALIFORNIA, COLLEGE OF ENGINEERING E77: INTRODUCTION TO COMPUTER PROGRAMMINGFOR SCIENTISTS AND ENGINEERS Professor Raja Sengupta Spring 2007 2nd Midterm Exam April 11, 2007 Exam Statistics Total Mean 23.83462 Mean % 79.45% StDev 3.720904 StDev% 12.40% Median 25 Median% 83.33% Max 30 Max% 100.00% Question Points Part I 5 Part II 2 Part III 8 Part IV 10 Grade Part V 5 TOTAL 30 Notes: 1. Write your name/sid on the top of every page and your signature below. 2. Please give all your answers only in the spaces provided. 3. You may NOT ask any questions during the exam. 4. You may NOT leave the exam room before the exam ends. Your signature: Your E77 LECTURE SECTION 1(12-1pm) or 2(1-2pm) (Circle your section #) Circle your Lab Section (where the graded midterms will be returned). #11: MW 8-10 #12: MW 10-12 #13: MW 2-4 #14: MW 4-6 #15: TuTh 8-10 #16: TuTh 10-12 #17: TuTh 12-2 #18: TuTh 2-4 #19: TuTh 4-6

Page 2 of 10 PART I Questions 1-5: Systems of Linear Equations Questions 1-5 refer to the following system of equations: x+ y+ 2z = 2 3x y+ z = 6 x+ 3y+ 4z = 4 1.( 1 point ) Write the matrices so that this system of equations in the form Ax = b. 1 1 2 2 A = 3 1 1, b = 6 1 3 4 4 2.(1 point) After correctly assigning the matrices A and b in Matlab, to solve this system of equations via Gaussian elimination we should type at the command prompt: a. >> A\b b. >> pinv(a)*b c. >> inv(a)*b d. >> A'\b 3.(1 point) If det(a) = 0 a. The system of equations have no solution. b. The system of equations have a unique solution. c. The system of equations have more than one solution. d. The system of equations has either no solution or more than one solution. 4.(1 point) Consider the equations 2x + 4y = 5 and 2x + 4y = 7. The rank([2 4 5;2 4 7]) will be a. 0 b. 1 c. 2 d. 3 Hint: rank([2 4;2 4]) = 1. 5.(1 point) Consider the equations 2x + 4y + 3z = 5, 2x + 4y + z = 5. To find a solution to these equations we can type: a. pinv([2 4 3;2 4 1])*[5;5] b. inv([2 4 3;2 4 1])*[5;5] c. pinv([2 4 3;2 4 1])*[5 5]

Page 3 of 10 PART II Questions 6-7: Computer Representation of Numbers 6.(1 point) The general form of an encoded number, according to IEEE 754, is: sign Exponent a. ( 1) * 2 * Fraction sign biasedexponent b. ( 1) *2 * Fraction sign Exponent c. ( 1) *( 2) * Fraction sign biasedexponent d. ( 1) * 2 * Fraction 7.(1 point) How many bits are allocated to the biasedexponent for IEEE 754 single precision? a. 127 b. 8 c. 7 d. 255

Page 4 of 10 PART III Questions 8-15: Regression and Interpolation Y Axis 8 7 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 X Axis 8.(1 point) Consider the graph shown in the above figure. What would be the Y value, using linear interpolation, corresponding to X=7.5. a. Y=4.25 b. Y=4.5 c. Y=4.75 d. Y=5 9.(1 point) Consider the same graph. What would be the Y value, using cubic spline Interpolation, corresponding to X=5. a. Y=3 b. Y=3.25 c. Y=3.5 d. Y=4 10.(1 point) If you were to estimate a regression model (named model1) on these data using the polyfit, what would be the slope coefficient and y intercept, respectively? a. 7/12, 0 b. 0, 1 c.6/12, 0 d. 6/12, 1 11.(1 point) If you specified a new model (named model2) on the same data set, but did not include an intercept (regression line passes through (0,0)), which of the following statements is true? a. Sum of square errors (model1)<sum of square errors (model2) b. Sum of square errors (model1)=sum of square errors (model2) c.sum of square errors (model 1)>sum of square errors(model 2)

Page 5 of 10 12.(1 point) Suppose you have a vector x and a vector y and you typed b = polyfit(x,y,4) at the Matlab command prompt and it returned: b = 0.0014 0.2345-0.1661-2.1284 1.7561 Write out the polynomial function that these numbers represent 4 3 y=.0014x +.2345x -.1661x 2-2.1284x+1.7561 13.(1 point) Which of the following statements are true for least squares: a. The mean of the residuals is zero b. The mean of the residuals squared is zero c. The mean of the residuals should be the slope of the regression line d. The mean of the residuals should be the intercept of the regression line <Note that b. has an ambiguous statement: It could be interpreted as 2 1 1 2 e i or as ei where e i i is the residual of observation i. It was n i n i intended to mean the second of these formulae, however the following three answers are acceptable: (a) or (b) or (a and b) >

Page 6 of 10 12 10 8 Line 1 Line 2 6 Line 3 Line 4 Data 4 2 0 0 2 4 6 8 10 12 14. (1 point) Which of the lines in the above figure is the least squares regression line? a. Line 1 b. Line 2 c. Line 3 d. Line 4 15. (1 point) Which of the lines in the above figure is the worst fit to the data in terms of the coefficient of determination? a. Line 1 b. Line 2 c. Line 3 d. Line 4

Page 7 of 10 PART IV Questions 16-22: Root Finding 16.(1 point ) The roots of a function f(x) are the values of x upon solving the equation a. f(x) 1 = 0 b. f(x) 2 = 0 c. f(x) = 0 d. None of the above. 17.(1 point) Consider the spring mass damper system && x + 2 x & + 1 = 0 with initial conditions x ( 0 ) = 2, x& ( 0) = 0. Which of the following statements is true? a. x(t) has oscillations that die down over time. b. x(t) has no oscillations and the values die down over time. c. x(t) has oscillations that grow over time. d. x(t) has no oscillations but its value grows over time. 18.(1 point) Fill in the blank with a single Matlab command to find the roots of 3 2 2x + 3x 5x + 1. >> R = roots([2,3,-5,1]) 19.(1 point) The polynomial x 3 + 2x 2 + 30x + 1 has a local maximum and minimum. Fill in the blank with a Matlab command to find the values of x corresponding to the maximum and minimum. >> R = roots(polyder([-1,2,30,1]))_or_ R = roots(-3,4,30) 20.(1 point) fzero( 1/x,-1,1) will return a value near a. 0 b. 1 c. -1 d. 0.5 21.(1 point) fzero(@tan,-0.5,0.2) will return a value near a. -0.5 b. 0 c. 0.2 d. 1.57 22.(2 points) You are given the file myfunc.m as shown below: function y = myfunc(x) y = exp(x) 2; end Fill in the blank below with a single matlab command which will find its root: >> fzero(@(x) myfunc(x),0,10)

Page 8 of 10 23.(3 points) Complete the following program so that it will find the root of func lying in the interval [lower, upper] to the precision specified by tol. function root = bisection(func, lower, upper, tol) midpoint = (upper + lower)/2; midfunc = feval(func, midpoint); upperfunc = feval(func, upper); if le(upper - lower, tol) root = midpoint ; elseif eq(sign(midfunc),sign(upperfunc)) root = bisection(func,lower,midpoint,tol) ; else root = bisection(func,midpoint,upper,tol) ; end end

Page 9 of 10 PART V Questions 24-28: Numerical Differentiation and Integration Answer the following questions using the below figure. Assume you wish to numerically differentiate F(x) at x = -2 to obtain approximations of the first derivative. You have data values at x = -10, -6, -2, 2, and 6. The true derivative at x = -2 is plotted in the graph. 500 Plot of F(x) = x 3-4x 2-69x + 216 400 300 200 100 Y 0-100 -200-300 -400-500 -10-8 -6-4 -2 0 2 4 6 8 10 24.(1 point) The 1 st order, forward-difference method derivative estimate will be the true derivative at x = -2. a. greater than b. less than c. exactly the same as 25.(1 point) The 1 st order, backward-difference method derivative estimate will be the true derivative at x = -2. a. greater than b. less than c. exactly the same as 26.(1 point) The 2 nd order, central-difference method derivative estimate will be the true derivative at x = -2. a. greater than b. less than c. exactly the same as 27.(1 point) The 4 th order central-difference method derivative estimate will be the true derivative at x = -2. a. greater than b. less than c. exactly the same as X

Page 10 of 10 28.(1 point) Assume you numerically integrate the function f(x) = 3x 2 + 2x + 1 using Simpson s rule integration on the interval [0,1], for points at 0,.25,.5,.75, and 1 (i.e. you are trying to find the integral of f(x) from 0 to 1 using 4 subintervals). The value you compute will be closest to: a. 2 b. 2.9 c. 3 We know this immediately since Simpson s rule is exact for polynomials of degree <= 3 d. 3.1 e. 4