Professional Documents
Culture Documents
BACHELOR OF ENGINEERING
In
CE/IT/EC
Prepared By
Ms. Mansi G. Vaishnani
• Introduction
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥
Example – 1
Fit a straight line to the following data. Also estimate the value of 𝑦 at 𝑥 = 2.5.
𝑥 0 1 2 3 4
Solution:
𝑦 = 𝑎 + 𝑏𝑥
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥
Here 𝑛 = 5,
𝒙 𝒚 𝒙𝟐 𝒙𝒚
0 1 0 0
1 1.8 1 1.8
2 3.3 4 6.6
3 4.5 9 13.5
4 6.3 16 25.2
∑𝒙 = 𝟏𝟎 ∑𝒚 = 𝟏𝟔. 𝟗 ∑𝒙𝟐 = 𝟑𝟎 ∑𝒙𝒚 = 𝟒𝟕. 𝟏
33.8 = 10 𝑎 + 20𝑏
−13.3 = −10𝑏
−13.3
𝑏=
−10
∴ 𝒃 = 𝟏. 𝟑𝟑 put in Eq (1),
➢ 16.9 = 5𝑎 + 10(1.33)
16.9 − 13.3 = 5𝑎
3.6
𝑎=
5
∴ 𝒂 = 𝟎. 𝟕𝟐
⟹ 𝑦 = 4.045
Example – 2
By a method of least square, find the straight line that best fits the following data.
𝑥 1 2 3 4 5
𝑦 14 27 40 55 68
Solution:
Here 𝑛 = 5,
𝒙 𝒚 𝒙𝟐 𝒙𝒚
1 14 1 14
2 27 4 54
3 40 9 120
4 55 16 220
5 68 25 340
−136 = −10𝑏
−136
𝑏=
−10
204 = 5𝑎 + 15(13.6)
204 − 204 = 5𝑎
∴ 𝒂 = 𝟎. 𝟕𝟐
we get, 𝑎 = 0 & 𝑏 = 13.6
Example – 3
If 𝑃 is the pull required to lift a load 𝑊 by means of a pulley block, find a linear law of the form
𝑃 12 15 21 25
𝑊 50 70 100 120
Where 𝑃 & 𝑊 are taken in 𝑘𝑔 − 𝑤𝑡. Compute 𝑃 when 𝑊 = 150 𝑘𝑔
Solution:
∑𝑃 = 𝑛𝐶 + 𝑚∑𝑊
Here 𝑛 = 4,
𝑷 𝑾 𝑾𝟐 𝑷𝑾
12 50 2500 600
15 70 4900 1050
73 = 4𝐶 + 340𝑚 … … 𝐸𝑞 (1)
−6.41 = −34.12𝑚
∴ 𝒎 = 𝟎. 𝟏𝟖𝟕𝟗 Put in Eq (1)
∴ 73 = 4𝐶 + 340(0.1879)
73 = 4𝐶 + 63.886
4𝐶 = 9.114
∴ 𝑪 = 𝟐. 𝟐𝟕𝟖𝟓
When 𝑊 = 150 𝑘𝑔
❖ Exercises
1. Fit a straight line to the following data. Also estimate the value of 𝑦 at 𝑥 = 2.5.
𝑥 1 2 3 4 6 8
𝑦 2.4 3 3.6 4 5 6
Ans: 𝑦 = 1.9764 + 0.5059𝑥
2. Using method of least squares, find the best fitting straight line to the following data.
𝑥 1 2 3 4 5
𝑦 1 3 5 6 5
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥 2
∑𝑥 2 𝑦 = 𝑎∑𝑥 2 + 𝑏∑𝑥 4
∑𝑥 2 𝑦 = 𝑎∑𝑥 3 + 𝑏∑𝑥 4
Example – 1
Fit a second-degree polynomial using the least square method to the following data:
𝑥 0 1 2 3 4
Solution:
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥 + 𝑐∑𝑥 2
Here 𝑛 = 5
𝒙 𝒚 𝒙𝟐 𝒙𝟑 𝒙𝟒 𝒙𝒚 𝒙𝟐 𝒚
0 1 0 0 0 0 0
1 1.8 1 1 1 1.8 1.8
2 1.3 4 8 16 2.6 5.2
3 2.5 9 27 81 7.5 22.5
4 6.3 16 64 256 25.2 100.8
∑𝒙 = 𝟏𝟎 ∑𝒚 ∑𝒙𝟐 = 𝟑𝟎 ∑𝒙𝟑 ∑𝒙𝟒 ∑𝒙𝒚 ∑𝒙𝟐 𝒚
= 𝟏𝟐. 𝟗 = 𝟏𝟎𝟎 = 𝟑𝟓𝟒 = 𝟑𝟕. 𝟏 = 𝟏𝟑𝟎. 𝟑
Example – 2
Using method of least squares, Find the best fitting second-degree curve to the following data:
𝑥 1 2 3 4
𝑦 6 11 18 27
Solution:
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥 + 𝑐∑𝑥 2
Here 𝑛 = 5
𝒙 𝒚 𝒙𝟐 𝒙𝟑 𝒙𝟒 𝒙𝒚 𝒙𝟐 𝒚
1 6 1 1 1 6 6
2 11 4 8 16 22 44
3 18 9 27 81 54 162
4 27 16 64 256 108 432
∑𝒙 = 𝟏𝟎 ∑𝒚 = 𝟔𝟐 ∑𝒙𝟐 = 𝟑𝟎 ∑𝒙𝟑 ∑𝒙𝟒 ∑𝒙𝒚 ∑𝒙𝟐 𝒚
= 𝟏𝟎𝟎 = 𝟑𝟓𝟒 = 𝟏𝟗𝟎 = 𝟔𝟒𝟒
Substituting these values in the normal equations:
(4) − (5) ⟹ −2 = 𝑎 − 5𝑐
⟹ −3.2 = 𝑎 − 6.2𝑐
+ − +
1.2 = 1.2𝑐 ……..(5)
∴𝑐=1 put in (4)
➢ 𝑎 = −2 + 5𝑐
𝑎 = −2 + 5(1)
𝑎 = 3 𝑝𝑢𝑡 𝑖𝑛 (1),
➢ 10𝑏 = 62 − 4𝑎 − 30𝑐
= 62 − 4(3) − 30(1)
10𝑏 = 20
𝑏=2
we get, 𝑎 = 3, 𝑏 = 2, 𝑐 = 1
Therefore, the required curve is: 𝒚 = 𝟑 + 2𝒙 + 𝒙𝟐
Example – 3
𝑥 1 2 3 4 5
Solution:
∑𝑦 = 𝑛𝑎 + 𝑏∑𝑥 2
∑𝑥 2 𝑦 = 𝑎∑𝑥 2 + 𝑏∑𝑥 4
Here 𝑛 = 5
𝒙 𝒚 𝒙𝟐 𝒙𝟒 𝒙𝟐 𝒚
1 1.8 1 1 1.8
2 5.1 4 16 20.4
3 8.9 9 81 80.1
4 14.1 16 256 225.6
5 19.8 25 625 495
∑𝒙 = 𝟏𝟓 ∑𝒚 = 𝟒𝟗. 𝟕 ∑𝒙𝟐 = 𝟓𝟓 ∑𝒙𝟒 = 𝟗𝟕𝟗 ∑𝒙𝟐 𝒚 = 𝟖𝟐𝟐. 𝟗
= 49.7 − 55(0.7385)
= 9.0825
∴ 𝒂 = 𝟏. 𝟖𝟏𝟔𝟓
❖ Exercises
1. Fit a second-degree polynomial using the least square method to the following data:
𝑥 1 2 3 4
𝑦 1.7 1.8 2.3 3.2
Also Estimate 𝑦(2.4)
𝑥 1 2 3 4 5 6
𝑦 2.51 5.82 9.93 14.84 20.55 27.06
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
The other curves 𝑦 = 𝑎𝑥 𝑏 and 𝑦 = 𝑎𝑒 𝑏𝑥 can be obtained by the same method.
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
➢ For the curve 𝑦 = 𝑎𝑥 𝑏 ,
Take logarithm on both sides,
log 𝑦 = log 𝑎 + 𝑏 log 𝑥
Now put log 𝑦 = 𝑌, log 𝑎 = 𝐴, 𝑙𝑜𝑔𝑥 = 𝑋 𝑎𝑛𝑑 𝑏 = 𝐵, then equation becomes,
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
Example – 1
𝑥 1 2 3 4 5 6 7
𝑦 87 97 113 129 202 195 193
Solution:
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
Here 𝑛 = 7
𝒙 𝒚 𝑿 𝒀 𝑿𝟐 𝑿𝒀
1 87 1 4.4659 1 4.4659
2 97 2 4.5747 4 9.1494
3 113 3 4.7274 9 14.1822
4 129 4 4.8598 16 19.4392
5 202 5 5.3083 25 26.5415
6 195 6 5.2730 36 31.6380
7 193 7 5.2627 49 36.8389
∑𝑿 = 𝟐𝟖 ∑𝒀 ∑𝑿𝟐 = 𝟏𝟒𝟎 ∑𝑿𝒀
= 𝟑𝟒. 𝟒𝟕𝟏𝟖 = 𝟏𝟒𝟐. 𝟐𝟓𝟓𝟏
1
∴𝐴= (34.4718 − 28𝐵)
7
1
= (30.1038)
7
∴ 𝑨 = 𝟒. 𝟑𝟎𝟎𝟓
Example – 2
Using a method of least square fit the curve of the form 𝑦 = 𝑎𝑒 𝑏𝑥 to the following data:
𝑥 0 2 4
𝑦 5.012 10 31.62
Solution:
7.3682 = 3𝐴 + 6𝐵 ……(1)
18.4204 = 6𝐴 + 20𝐵……(2)
1
∴𝐴= (7.3682 − 6𝐵)
3
∴ 𝑨 = 𝟏. 𝟓𝟑𝟓𝟏
Example – 3
𝑥 61 26 7 2.6
𝑦 350 400 500 600
Solution:
𝑌 = 𝐴 + 𝐵𝑋
Then the normal equations are,
∑𝑌 = 𝑛𝐴 + 𝐵∑𝑋
∑𝑋𝑌 = 𝐴∑𝑋 + 𝐵∑𝑋 2
Here 𝑛 = 4,
𝒙 𝒚 𝑿 = 𝐥𝐨𝐠𝒆 𝒙 𝒀 = 𝐥𝐨𝐠 𝒆 𝒚 𝑿𝟐 𝑿𝒀
61 350 4.1109 53.8579 16.8995 24.0814
26 400 3.2581 5.9915 10.6152 19.5208
7 500
500 1.9459 6.2146 3.7866 12.0931
2.6 600 0.9555 6.3969 0.9130 6.1123
∑𝑿 = 𝟐𝟖 ∑𝒀 𝟐 ∑𝑿𝒀
∑𝑿
= 𝟐𝟒. 𝟒𝟔𝟎𝟗 = 𝟑𝟐. 𝟐𝟏𝟒𝟑 = 𝟔𝟏. 𝟖𝟎𝟕𝟔
Divide Eq (1) with constant 4 & Divide Eq (2) with constant 10.2704
6.1152 = 𝐴 + 2.5676𝐵
6.0180 = 𝐴 + 3.1366𝐵
− − −
0.0972 = −0.5690𝐵
1
∴𝐴= (24.4609 − 10.2704𝐵)
4
∴ 𝑨 = 𝟔. 𝟓𝟓𝟑𝟖
𝑥 1 2 3 4 5 6 7 8
Ans: 𝑦 = 0.6823(1.3828)𝑥
𝑥 1 2 3 4