-
Notifications
You must be signed in to change notification settings - Fork 6
/
Solution.txt
34 lines (24 loc) · 970 Bytes
/
Solution.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* DeveloperName(): Jignesh Chudasama
* GithubName(): https://github.com/Jignesh-81726
*/
Answer: -3/4
Step 1: Rewrite the 2 lines in proper form
Rewrite the 2 lines as:
y = -2 + (-3/4) * x
x = -7/4 + (-3/4) * y
so b1 = -3/4 and b2 = -3/4
Step 2: Apply Pearson's Coefficient formula
Let p = pearson coefficient
Let x_std = standard deviation of x
Let y_std = standard deviation of y
p = b1 (x_std / y_std)
p = b2 (y_std / x_std)
Multiplying these 2 equations together we get
p^2 = b1 * b2
p^2 = (-3/4) * (-3/4)
p^2 = 9/16
p = 3/4 or -3/4 (depending on correlation of x and y)
Step 3: Find out if p is postive or negative
We simply plot 2 sets of (x,y) points to see if x and y are positively or negatively correlated.
In this case, they are negatively correlated, so p = -3/4