Mids Assignment 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Probability and Statistics

Mid Term Assignment 2

Muhammad Mohsin
F-63078
BS(CS) 32-B

Department of Computer Science


APCOMS, Rawalpindi

Submission Date: 20-May-2020

Evaluation Marks: Signature: Sir Shahid Mehmood


Question # 1:

x y xy 𝒙𝟐
1 2 2 1
2 3 6 4
4 4 16 16
5 7 35 25
6 12 72 36
8 10 80 64
10 7 70 100
∑ 𝑥= 36 ∑ 𝑦= 45 ∑ 𝑥𝑦= 281 ∑ 𝑥 = 246

i. Regression Line:

𝒚 = 𝒂 + 𝒃𝒙

For b,

𝒏 ∑ 𝒙𝒚 − ∑ 𝒙 ∑ 𝒚
𝒃=
𝒏 ∑ 𝒙𝟐 − (∑ 𝒙)𝟐

7(281) − (36)(45)
𝑏=
7(246) − (36)

1967 − 1620
𝑏=
1722 − 1296
347
𝑏=
426
𝒃 = 𝟎. 𝟖𝟏𝟒𝟓

For a,

𝒂 = 𝒚 − 𝒃𝒙

∑𝒙
𝒙=
𝒏
36
𝑥̅ =
7
𝒙 = 𝟓. 𝟏𝟒𝟐

∑𝒚
𝒚=
𝒏
45
𝑦=
7
𝒚 = 𝟔. 𝟒𝟐𝟖

Now, putting b, “𝒚” and “𝒙”

𝒂 = 𝒚 − 𝒃𝒙

𝑎 = 6.428 − (0.8145)5.142

𝑎 = 6.428 − 4.188

𝑎 = 2.24

Now, putting “a”, “b”

𝒚 = 𝒂 + 𝒃𝒙

𝑦 = 2.24 + 0.8145𝑥

ii. For 7 applications of fertilizer

x=7

𝑦 = 2.24 + 0.8145(7)

𝑦 = 2.24 + 5.7015

𝑦 = 7.9415

iii. Relationship:

Value of “b” is positive hence the relationship between “Fertilizer applications” and “Tons of
crops per acre” is positive.

Question # 2:

x y xy 𝒙𝟐 𝒚𝟐
1 1 1 1 1
3 2 6 9 4
4 4 16 16 16
6 4 24 36 16
8 5 40 64 25
9 7 63 81 49
11 8 88 121 64
14 9 126 196 81
∑ 𝑥=56 𝑦 = 40 𝑥𝑦 = 364 𝑥 = 524 𝑦 = 256

i. Correlation coefficients

𝒏 ∑ 𝒙𝒚 − ∑ 𝒙 ∑ 𝒚
𝒓=
√[𝒏 ∑ 𝒙𝟐 − (∑ 𝒙)𝟐 ][𝒏 ∑ 𝒚𝟐 − (∑ 𝒚)𝟐 ]
8(364) − (56)(40)
𝑟=
√[8(524) − (56) ][8(256) − (40) ]

2912 − 2240
𝑟=
√[4192 − 3136][2048 − 1600]

672
𝑟=
√[1056][448]

672
𝑟=
√473088
672
𝑟=
687.8139
𝑟 = 0.9770

ii. Interpretation:

Correlation coefficient is used to measure how strong a relationship is between two


variables.

Value of correlation is 0.9770; hence it’s concluded that very strong positive
correlation between advertising expenditure and sales revenue.

You might also like