0% found this document useful (0 votes)
57 views4 pages

University of Victoria Midterm Exam 1 February 7 2019 Computer Science 349A

This document is a midterm exam for a Computer Science 349A course taken on February 7, 2019. It contains 3 questions worth a total of 18 marks. Question 1 involves evaluating an expression using floating-point arithmetic and calculating relative error. Question 2 describes a hypothetical base-5 floating-point number system and asks the student to represent decimal values in this system. Question 3 involves determining the second order Taylor approximation for a logarithmic function and calculating the upper bound on the error of this approximation for a given value.

Uploaded by

Malcolm Fenelon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
57 views4 pages

University of Victoria Midterm Exam 1 February 7 2019 Computer Science 349A

This document is a midterm exam for a Computer Science 349A course taken on February 7, 2019. It contains 3 questions worth a total of 18 marks. Question 1 involves evaluating an expression using floating-point arithmetic and calculating relative error. Question 2 describes a hypothetical base-5 floating-point number system and asks the student to represent decimal values in this system. Question 3 involves determining the second order Taylor approximation for a logarithmic function and calculating the upper bound on the error of this approximation for a given value.

Uploaded by

Malcolm Fenelon
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

UNIVERSITY OF VICTORIA

MIDTERM EXAM 1 FEBRUARY 7 2019


COMPUTER SCIENCE 349A

NAME: STUDENT NO.


INSTRUCTOR: Rich Little
. DURATION: 40 minutes
TO BE ANSWERED ON THE PAPER
STUDENTS MUST COUNT THE NUMBER OF PAGES IN THIS EXAMINATION PAPER BEFORE
BEGINNING TO WRITE, AND REPORT ANY DISCREPANCY IMMEDIATELY TO ME.
PLEASE PUT YOUR NAME ON THE VERY BACK SHEET AS WELL.
THIS QUESTION PAPER HAS 4, SINGLE-SIDED PAGES. YOU MAY USE THE BACK
PAGES.
NOTES: (0) CLOSED BOOK EXAM; ONLY BASIC CALCULATORS ARE ALLOWED, (1)
ANSWER ALL QUESTIONS, (2) THERE ARE A TOTAL OF 18 MARKS, (3) THE BACK
PAGE OF EACH QUESTION MAY BE USED FOR YOUR ANSWERS. (4) STUDENTS ARE
ALLOWED ONE 8.5-by-11 INCH SHEET CONTAINING ANY INFORMATION — BOTH
SIDES CAN BE USED.

Question Possible marks Actual marks


1 6
2 6
3 6
Total 18
FEB 7, 2019 CSC 349A, 2

1. (a) [4 points] Evaluate


x − sin x
g(x) =
x3
using b = 10, k = 4 floating-point arithmetic with chopping where x = 0.02468
radians.
(b) [2 points] Given that the actual value is g(0.02468) = 0.1666616, what is the relative
error of your approxiamtion in (a)?
FEB 7, 2019 CSC 349A, 3

2. Consider a base-5 normalized, floating-point number system. Assume that a hypothetical


computer using this system has the following floating-point representation:

sm d1 d2 d3 d4 se e1 e2

where sm is the sign of the mantissa, se is the sign of the exponent (1 for negative, 0 for
positive), di are the digits of the mantissa, and ej are the digits of the exponent.

(a) [2 points] Consider the base-5 number, using the above representation, 02003004.
What exact decicmal value does it represent?
(b) [4 points] How does the above hypothetical base-5 computer represent the decimal
value −25.8?
FEB 7, 2019 CSC 349A, 4

3. (a) [4 points] Determine the second order (n = 2) Taylor approximation for f (x) =
ln (x − 1), expanded about a = 2, including the remainder term. Do not simplify the
form of this polynomial; that is, do not multiply out any powers.
(b) [2 points] What is the upper bound on the error in (a) when approximating ln (1.2)?

You might also like