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

Tutorial 2

This document contains examples of: 1) Converting between different numeric bases including binary, octal, decimal. 2) Evaluating polynomials at given values using limited precision arithmetic and calculating relative percent errors. 3) Comparing the relative errors between evaluating a polynomial expressed in two different forms. The relative error was lower when the polynomial was expressed separated into individual terms rather than combined.

Uploaded by

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

Tutorial 2

This document contains examples of: 1) Converting between different numeric bases including binary, octal, decimal. 2) Evaluating polynomials at given values using limited precision arithmetic and calculating relative percent errors. 3) Comparing the relative errors between evaluating a polynomial expressed in two different forms. The relative error was lower when the polynomial was expressed separated into individual terms rather than combined.

Uploaded by

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

I convert thefollowing base2 numbers to base10

a 1101111

1120 1 2 1 E 1 23 O 24 I 2s I E
1 2 147 18 CO 323 164
111lo

b 111001132
1 I I I A 29 O 2 O2 ACE 1 24
I 10 01 10.125 10.0625
I patsy

c 0.00101
107120 10312 103122 1 23 101124 1 2s
10 10 10.03125
I fisnt
0.125

I convert thefollowing base8 numbers to base10

a 6157518

5180 7 8D 5184 11183 6 84


s S6 3203 1512 24576
25469310

b 2.4118
2180 48 1 8Y
2 os 10.015625

2.515625310

I convert thefollowing base10numbers to base2

a 150 o
150 Base2 10010110

75
15012 0
7512 37 I
3712 18 I
1812 9 0
912 4 I
412 2 0
212 1 0
112 0 I
b 150.61510
11503,0 110010110
0615 0 integerPart FractionalPart
0.615 2 I 0.230
10011101
0.23 2 O 0.460
046 2 O gg
0.92 2 I 0840
084 2 I 0.680
0.68 2 I 0.360
0.36 2 O 0.720
072 2 I 0.440

1506153,0 11001011010072

4 a Evaluate the polynomial Y x 8 2 4 0.39


at x 1.37 Use 3digits arithmetic withchoppingEvaluatethepercentrelative error
X 1.37 ExactValueYe Approximatevalue Ya
xxx x
1 8 xxx 15.0152 1490
4 x s 5.48
o o.gg 0.35
summation 7.353847 7.25

E true error x 100


true value

1 25 7353847 100
7.353847

1.41 1.41

b Repeat partla when y is expressed as


x5 8 x 0.39
y
x 1.37 ValueYe Approximatevalue Ya
Exact
x 5 3.63 3.63
x5 x 4.9731 4.97
15 8 3.0269 3.03
Kx5 8 x 4146853 4.151
0.39 0.39 0.39
summation 1819347 1.809

Ey true error x 100


t X 100
true value
1809111.819347 x100
1.819347

0.569 0.569

c comparethevalues of thepercent relative errorforbothcasesandcomment on the results


The percentrelativeerrorfor the second case is lowerthan thefirstcase
1.41 10.569 3 0.8410 difference betweenthetwo This showsthatthe secondequation is more
accurate thanthe first The lower the relative error the higher theprecision of the results to
the real valueThis mayhavebeen causedduetothefact that the second case was separated into
more different parts when doing the calculations

You might also like