Class 2
Class 2
ME – 263
Credit: 3.00 Contact hour: 3.00
Class: 1
Date: 2 December 2024 (Monday)
Round off error 0 +
1. Limiting factor of computer hardware and software 1 -
2. Omits significant value. 13 = 1101
Representation of integer and floats
0 0 0 0 1 1 0 1 0 1 1 1 +7
+13
1 1 1 1 -7
Sign bit number
𝟐𝟖 − 1
Float
𝑚 → 1101 → 13
0 1 1 0 1 1 0 1 𝑒 → 10 → 2 1 0 1 0 1 1 0 1
𝑏 → 𝑏𝑎𝑠𝑒 𝑜𝑓 𝑡ℎ𝑒 𝑛𝑢𝑚𝑏𝑒𝑟 𝑠𝑦𝑠𝑡𝑒𝑚 → 2
𝑛𝑢𝑚𝑏𝑒𝑟 = 𝑚 × 𝑏𝑒 = −0.13 × 22
= +0.13 × 2−2 = −0.52
= +0.0325
0 1 0 1 0 0 1 1
Magnitude of mantissa (m)
Magnitude of exponent (e) = 0.3 × 2−1
Sign of exponent = 0.15
Sign bit
3
Memory limitation
0 1 1 0 1 1 0 1
0 1 1 0 1 1 1 0
= +0.14 × 2−2
= +0.035
It can store 0.0325 then next number will be 0.035
To store 0.033
+𝑚 × 2−2 = 0.033
𝑚 = 0.132
So, we need enough memory to store the binary number format of 132 = 10000100
0 1 1 0 1 0 0 0 0 1 0 0
4
Taylor Series
Taylor theorem has great importance in the realm of numerical methods. Using this theorem, any smooth, non-
polynomial function can be approximated as a polynomial
Polynomimal → a + bx + cx 2 + dx 3 + ex 4 + ⋯
sin x − ex
Non polynomial → cos x , sin x , ax ,
cos(x)
5 + 10x 3 = 5 + 0𝑥 + 0𝑥 2 + 10𝑥 3
Polynomial Advantages:
3. General format
5
6
Expansion of a function
cos 𝑥 = 𝐶0 + 𝐶1 𝑥 + 𝐶2 𝑥 2 + 𝐶3 𝑥 3 + 𝐶4 𝑥 4 + ⋯
𝑙𝑒𝑡 𝑥 = 0 cos 0 = 𝐶0 + 𝐶1 .0 + 𝐶2 .02 +𝐶3 .03 +𝐶4 .04 + ⋯
1 = 𝐶0
cos 𝑥 = 1 + 𝐶1 𝑥 + 𝐶2 𝑥 2 + 𝐶3 𝑥 3 + 𝐶4 𝑥 4 + ⋯
𝑑 𝑑
(𝑐𝑜𝑠 𝑥) = (1 + 𝐶1 𝑥 + 𝐶2 𝑥 2 + 𝐶3 𝑥 3 + 𝐶4 𝑥 4 + ⋯)
𝑑𝑥 𝑑𝑥
𝑙𝑒𝑡 𝑥 = 0 −si𝑛 𝑥 = 0 + 𝐶1 + 2𝐶2 𝑥 + 3𝐶3 𝑥 2 + 4𝐶4 𝑥 3 + ⋯
−si𝑛 0 = 0 + 𝐶1 + 2𝐶2 . 0 + 3𝐶3 .02 +4𝐶4 .03 + ⋯
0 = 𝐶1
cos 𝑥 = 1 + 0. 𝑥 + 𝐶2 𝑥 2 + 𝐶3 𝑥 3 + 𝐶4 𝑥 4 + ⋯
𝑑2 𝑑2 2 + 𝐶 𝑥 3 + 𝐶 𝑥 4 + ⋯)
(𝑐𝑜𝑠 𝑥) = (1 + 0. 𝑥 + 𝐶2 𝑥 3 4
𝑑𝑥 2 𝑑𝑥 2
−cos 𝑥 = 0 + 0 + 2𝐶2 + 6𝐶3 𝑥 + 24𝐶4 𝑥 2 + ⋯
𝑙𝑒𝑡 𝑥 = 0 −cos 0 = 0 + 0 + 2𝐶2 + 6𝐶3 . 0 + 24𝐶4 .02 + ⋯
1
− 2 = 𝐶2
1 2
cos 𝑥 = 1 + 0. 𝑥 − 𝑥 + 𝐶3 𝑥 3 + 𝐶4 𝑥 4 + ⋯ (𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑒. . ) 7
2