We are assuming that p is the price of the house and that q is the number of the houses.
The points given (q,p) , therefore, are:
(20 , 540000) and (50 , 450000)
The general form of the linear straight line is:
y = mx+c where m is the slope and c is the y-intercept.
(1) Calculating the slope:
The formula used to calculate the slope is:
m = (y2-y1) / (x2-x1) where:
y2 is the y-coordinate of the second point = 450000
y1 is the y-coordinate of the first point = 540000
x2 is the x-coordinate of the second point = 50
x1 is the x-coordinate of the first point = 20
Therefore:
m = (450000-540000) / (50-40) = -3000
(2) Calculating the y-intercept:
After getting the slope, the equation now is:
y = -3000x + c
To get the value of thec, use any point that belongs to the line and substitute with it in the equation above. I will use the point (20, 540000).
y = -3000 + c
540000 = -3000(20) + c
c = 540000 + 3000(20) = 600000
Based on the above calculations, the equation of the line is:
y = -3000x + 600000