How do I find the hypothesis based on a training set without implementing linear regression? So I was going through Andrew Ng's ML course and I encountered this question.


As far as I know, the purpose of the cost function is to minimize the difference between $h(x^i) - y^i$. Since I can't assume that the output $y$ will be exactly on the regression line, I can't set $h(x^i) - y^i = 0$ to solve for $\theta_0$ and $\theta_1$. As mentioned in the question:

You should be able to select the right answer without actually
  implementing linear regression

Is it possible to obtain a solution to this question without plotting the graph? If so, how do I approach it?
 A: This is how I would argue .... 
First observe that as $x$ increase $y$ decrease hence the slope of the regression line measured by $\theta_1$ must be negative ruling out option 3 and 4. 
In both of the first two options the slope is the same $\theta_1 = -530.9$ hence the specific value of $\theta_1$ can therefore be assumed to be $-530.9$.
Putting this knowledge to use I observe that at $x=1$ the value for $y=-890$. If the line  good approximation then $\theta_0 + \theta_1 x$ should be fairly close to this value when $x=1$ implying that
$-890 \approx \theta_0 - 530.9$
which implies that
$\theta_0 \approx 530.9 - 890 =  -359.1$
since the candidates for $\theta_0$ are as given in option 1 and 2 I choose option 2 because this is the option where $\theta_0$ is closest to $-359.1$.
Do I know with certainty that this is the correct guess? NO, surely my guess is based solely on information from the point $x=1,y=-890$. So another procedure would be to plot the points and draw best line by hand while trying to approximate the slope $-530.9$ and then simply read of the value at $x=0$ this would be an easy way of using info on all points. 
Otherwise you can try with $x=2$ where $y=-1411$ so if the line is close to actual observation then
$$-1411 \approx \theta_0 - 530.9 * 2$$ such that
$$2*530.9-1411 =  -349.2 \approx \theta_0 $$
and off course you can do this for all points ...
And this process is just error minimization so yes you could also calculate errors as you suggest and square and add them for a number of points and then select based on that ... but off course in the end using all points this would be linear regression and the idea was not to perform linear regression ... 
