0% found this document useful (0 votes)
7 views

Computational methods

The document outlines a tutorial and exam for STA3122: Computational Methods and Data Analysis I at the University of Nairobi, detailing instructions for answering questions and the use of arithmetic. It includes various mathematical problems related to binary and decimal conversions, error analysis, polynomial functions, and iterative methods. The document serves as a comprehensive guide for first-year students in actuarial science, mathematics, and statistics.

Uploaded by

luckynduki86
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Computational methods

The document outlines a tutorial and exam for STA3122: Computational Methods and Data Analysis I at the University of Nairobi, detailing instructions for answering questions and the use of arithmetic. It includes various mathematical problems related to binary and decimal conversions, error analysis, polynomial functions, and iterative methods. The document serves as a comprehensive guide for first-year students in actuarial science, mathematics, and statistics.

Uploaded by

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

UNIVERSITY OF NAIROBI

SCHOOL OF MATHEMATICS
COLLEGE OF BIOLOGICAL AND PHYSICAL SCIENCES (CBPS)

FIRST YEAR, SECOND SEMESTER 2023: TUTORIAL


BSC ACTURIAL SCIENCE/MATHEMATICS/STATISTICS
STA3122: COMPUTATIONAL METHODS AND DATA ANALYSIS I
DATE: May 8, 2023 Time: XX00-YY00HRS (6 Hours)

INSTRUCTIONS1 :
• EXAM: Answer question ONE, and TWO other questions.
• TUTORIAL: Attempt all the questions.
• You may use your books, notes, or phones (Phones are absolutely prohibited in the exam).
• You are required to show your work on each problem on this exam.
• Unless otherwise stated, use 4dp arithmetic.

1. (a) Express the following numbers in binary form


1. 1414.214
(b) Convert the following to the decimal representation
1. 110012
2. 111112
3. 100012
4. .111112
5. .100012
(c) Convert the following to the hexadecimal representation
1. 20310
2. 25510
3. 10610
(d) Perform the following operations
1. 110012 + 10112 + 111012 ; 2A16 + FF16
2. 7638 − 5758 ; 110102 − 1112
3. 168 x 138 ; 11012 x 1012 ;
4. 101012 / 112 ; 2578 / 78
2. Suppose x = 0.54617 and y = 0.54601. Use four-digit arithmetic to approximate the following
• rounding (4dp) and
• chopping (4dp)
(a) z = x · y, where the notation · represents multiplication
(b) z = x + y
(c) z = x − y
1 This document was typeset using LAT X 2ε and Kile; TeXworks; TeXstudio, TeXmaker, etc. L
AT X 2ε is an extension of L
AT X.
E E E
LATEX is a collection of macros for TEX. TEX is a trademark of the American Mathematical Society.
Prepared by Timothy K. K. Kamanu, B.Sc, PG.Dip, CPA, M.Sc, PhD.
STA3122: COMPUTATIONAL METHODS
STA3122
AND DATA
- PageANALYSIS
2 of 4 I May 8, 2023

(d) z = x/y
Determine the absolute and relative errors in each case.
3. Find the argument for which f (x) = 8 given the following table

x 1 2 4
f (x) 4 12 20

4. (a) Determine the number of decimal integers that can be stored in a 32-bit computer
(b) Clearly derive the solution to the quadratic formulae ax2 + bx + c = 0
(c) Show that one of the roots can be expressed as x1 = √ 2c
b+ b2 −4ac

5. (a) Find the relative error in computing the following values


• f = x + y with x = 20.01 and y = 4.76; ∆x = 0.008 and ∆y = 0.003
• f = 7x7 + 3x3 if at x = 1 then ∆x = 0.05
6. Simplify, evaluate and/or express the following functions in to allow computation and/or avoid loss of
significant digits. Hint: rationalize, simplify and/or use Taylor series expansion.
sin x
(a) x for small x
√ √
(b) x + 1 − x for large x
(c) sin(x + ϵ) − sin x for small ϵ
1−cos x
(d) sin x for small x
(e) √ − √1
1
for large x
x 1+x
x
(f) e − 1 for small x
R N +1
(g) N ln x dx
 √   √ 2 
2
1+ 5
(h) 5
√3
2 − 1−2 5

7. Using the following table, find the argument for which f (x) = 9

x -2 3 6
f (x) 0 4 10

8. (a) Discuss/define
• Newton forward difference polynomial
• Lagrange interpolating polynomial
(b) Prove the following relations
• (1 + ∆)(1 − ∇) = 1
• ∆2 ex = (eh − 1)2 ex
• ∆{f (x) · g(x)} = f (x) · ∆g(x) + g(x + h) · ∆f (x)
• ∇{f (x) · g(x)} = f (x) · ∇g(x) + g(x − h) · ∇f (x)
9. Show that ∆ · ∇ = ∆ − ∇ where the operators are within their usual meaning.
10. Show that the operators ∆ and E are commutative i.e. ∆Ef (x) = E∆f (x), where the operators are
within their usual meaning.
STA3122: COMPUTATIONAL METHODS
STA3122
AND DATA
- PageANALYSIS
3 of 4 I May 8, 2023

∆ 2

11. Find E ex give that the interval of differencing is h.
∆ 2
 ∆2 f (x)
12. Distinguish between E and E 2 f (x) .

13. Find ∆f (3), ∆2 f (5), ∆3 f (7), ∆4 f (7) and ∆5 f (3) given that

x 3 5 7 9 11 13
f (x) 10 27 36 43 46 51

Similarly, find ∇f (13), ∇2 f (11), ∇3 f (7), ∇4 f (11) and ∇5 f (13).

14. Let y = Ax3 + Bx2 + Cx + D be a third degree polynomial which passes through the points (0, −1),
(1, 1), (2, 1) and (3, −2). Determine the values of the coefficients A, B, C and D.
15. Describe in detail the following iterative methods
1. Bisection method
2. Newton’s method
dy d2 y
16. Calculate the values of dx and dx2 at x = 0 and x = 5 from the following table

x 0 1 2 3 4 5 6
f (x) 1.3448 2.9781 3.2782 4.5899 5.9133 6.7051 7.0135

17. (a) (8 points) For some functions f (x) and g(x) and with the usual notation of operators ∆, ∇, δ, E,
µ, etc. Prove that
• ∆{f (x) · g(x)} = f (x) · ∆g(x) + g(x + h) · ∆f (x)
• ∇{f (x) · g(x)} = f (x) · ∇g(x) + g(x − h) · ∇f (x)

18. (a) (5 points) Consider the function f (x) = x2 − 5. Show that:


• the iterative Newtwon’s method is
xn 5
xn+1 = − xn
2 2

• The zero of the function is x = 5 = 2.236068
(b) (10 points) Suppose x = 0.54617 and y = 0.54601. Use four-digit arithmetic to approximate the
following
• rounding (4dp) and
• chopping (4dp)
Determine the absolute and relative errors in each cases below
• z = x · y, where the notation · represents multiplication
• z =x+y
• z =x−y
• z = x/y
19. (a) (10 points) Define the terms
• Forward differences
• Percentage error
STA3122: COMPUTATIONAL METHODS
STA3122
AND DATA
- PageANALYSIS
4 of 4 I May 8, 2023

• Truncation error
• Finite differences
• Interpolating polynomial

20. (a) (5 points) Given that



X x2n+1
sin(x) = (−1)n −1<x<1
n=0
(2n + 1)!

Determine the equivalent representation of cos(x) using this result


(b) (10 points) Compute the difference table for f (x) = √1x for x = 2(1)5. Approximate the value of
√1 and √14.5 using the Newton Forward Difference Formula (NFDF) and Newton Backward
2.5
Difference Formula (NBDF), respectively.
• Estimate the inherent errow in NFDF and/or NBDF.
• Comment on how the error can be mitigated or reduced.

21. (a) (10 points) Consider the quadratic equation ax2 + bx + c = 0


• Show that √
b2 − 4ac
−b ±
x=
2a
(b) (6 points) Define and distinguish the following terms
• Forward differences
• Backward differences
22. Compute the difference table for f (x) = √1x for x = 2(1)5. Approximate the value of √12.5 and √14.5
using the Newton Forward Difference Formula (NFDF) and Newton Backward Difference Formula
(NBDF), respectively.
• Estimate the inherent errow in NFDF and/or NBDF.
• Comment on how the error can be mitigated or reduced.

You might also like