Docsity

Midterm Exam 2 - Computing Techniques | ME 2016, Exams of Computer Science

Toggle sidebar
bg1
Page 1
ME 2016 Section A-C
Fall Semester 2006
Computing Techniques 3-0-3
Midterm Exam 2
Wednesday, October 11, 2006
Section:
Name and email address:
READ THIS FIRST
This exam is a fifty-minute exam (the entire class period). The exam is closed book and
closed notes. A non-graphing pocket calculator can be used. You are on your honor not to
consult with your classmates. Cheating will not be tolerated and will result in immediate
and strict action.
Please feel free to use any pictures, graphs, flow charts, code fragments, or written comments in
describing your understanding of the problems and their solutions. Be sure to clearly state any
assumptions or conditions regarding the solution. Please write all of your answers on these
sheets. You may use the back of the paper if necessary. A total of 100 points are awarded.
An equation sheet is included on the last page of this exam.
Honor Code Statement:
My signature below indicates that I have read the above text. On my honor, I pledge that I have
neither given nor received inappropriate aid in the preparation of this examination. I also pledge
that I have not spoken with any students who have previously taken the ME 2016 exam today.
Further, I will not discuss this exam with any other student taking ME 2016 this semester who
has not yet taken the exam until after all the exams have been given (5PM on the day of the
exam).
Signature: _____________________________________________________________
Question Maximum Score Student’s Score
1 – True or False 10
2 – Short question 1 10
– Short question 2 10
– Short question 3 10
3 – Curve Fitting 30
4 – Matlab Function 30
TOTAL 100
pf3
pf4
pf5
pf8

Partial preview of the text

Download Midterm Exam 2 - Computing Techniques | ME 2016 and more Exams Computer Science in PDF only on Docsity!

ME 2016 Section A-C

Fall Semester 2006

Computing Techniques 3-0-

Midterm Exam 2

Wednesday, October 11, 2006

Section:

Name and email address:

READ THIS FIRST

This exam is a fifty-minute exam (the entire class period). The exam is closed book and

closed notes. A non-graphing pocket calculator can be used. You are on your honor not to

consult with your classmates. Cheating will not be tolerated and will result in immediate

and strict action.

Please feel free to use any pictures, graphs, flow charts, code fragments, or written comments in

describing your understanding of the problems and their solutions. Be sure to clearly state any

assumptions or conditions regarding the solution. Please write all of your answers on these

sheets. You may use the back of the paper if necessary. A total of 100 points are awarded.

An equation sheet is included on the last page of this exam.

Honor Code Statement:

My signature below indicates that I have read the above text. On my honor, I pledge that I have

neither given nor received inappropriate aid in the preparation of this examination. I also pledge

that I have not spoken with any students who have previously taken the ME 2016 exam today.

Further, I will not discuss this exam with any other student taking ME 2016 this semester who

has not yet taken the exam until after all the exams have been given (5PM on the day of the

exam).

Signature: _____________________________________________________________

Question Maximum Score Student’s Score

1 – True or False 10

2 – Short question 1 10

  • Short question 2 (^10)
  • Short question 3 (^10)

3 – Curve Fitting 30

4 – Matlab Function 30

TOTAL 100

Question 1: True or False (10 points; 2 points each)

Circle True or False. If False, briefly explain your reasoning

  1. In the figures below, the correlation of the data set A is smaller than that of the data set B.

True / False

  1. When a system of linear equations is ill-conditioned, the solution cannot be determined

accurately using floating point computations.

True / False

  1. A system of linear equation may have zero, one, or an infinite number of solutions.

True / False

  1. When using a linear least-squares curve fit, all the values for the independent variable in the

data set must be unique.

True / False

  1. When using ‘pchip’ interpolation (Piecewise Cubic Hermite Interpolating Polynomials) in

Matlab’s interp1 function, the data set below will result in oscillations in the interpolated

function.

True / False

x

f ( ) x (^) Data Set A

x

f ( ) x (^) Data Set B

x

f ( ) x (^) Data Set A

x

f ( ) x (^) Data Set A

x

f ( ) x (^) Data Set B

x

f ( ) x (^) Data Set B

x

f ( ) x

Question 3: Curve Fitting (30 points)

Consider the following data set:

x = 3 4 5 6 7

y = 38 32 25 21 15

Determine the coefficients k and b for which the following function fits the data best:

b / x y kx

−

Show your work and provide a short explanation of each solution step (so that we can give partial

credit in case you make a calculation error). Round intermediate results at 3 digits behind the

decimal point.

Partial credit alternative: Instead of answering the question above, you can answer the

following question for a maximum of 15 points (i.e., you will get at most 15 out of 30 on this

question): Derive the equations for a linear curve fit of the form y=ax+b and solve for a and b

using the data set given above.

Equation Sheet

n

− = ×

with 1

e m b m b

with | |

x (^) t eps eps b x

( ) ( ) 2 ( ) ( ) ( ) ( )( ) ( ) ( ) 2!!

n n n

f a f a f x f a f a x a x a x a R n

( 1) ( ) 1 ( ) ( 1)!

n n n

f R x a n

= −

l u r

x x x

new old r r u^ l a new r u l

x x x x

x x x

0

n a n

x E

u l u r u l u

f x x x x x f x f x

1

i i i i

f x x x f x

+ =^ −^

2 , 1 ,

r t i t i r

f x E E f x

2

1

n

r i i

S e

2

1

n

t i i

S y y

T T Z Z A = Z Y

(^1 2 ) ( )

i i i i

i i

n x y x y a n x x

a 0 (^) = y − a x 1 1

n

i i

x x

2 t r

t

S S

r S

2 2 2 2

i i i i

i i i i

n x y x y r

n x x n y y

1 0 1 0 0 1 0

f x f x f x f x x x x x

1 1 1 2 0 1 1 0 0

[ , ,..., ] [ , ,..., ]

[ , ,..., , ]

n n n n n n n

f x x x f x x x f x x x x x x

− − − −

0 1 0 0 2 1 0 0 1 2

1 0 0 1 1

( ) ( ) , , , ( )( )

+... , ,..., ( )...( )

n

n n n

f x f x f x x x x f x x x x x x x x x

f x x (^) − x x x x x x x −