# Linear Regression - finding thetha using Normal equation This is to find thetha which will give minimum cost function. Why is the x0 column required? why cant we assign size as x0? why do we need the feature count to be n+1?

Consider the 1-D equivalent of the table you have provided. In this case, you have one input x and one output y (see figure). If you try to fit the data points with y=mx equation, you can not fit the data successfully. You need an equation like y=mx+c to have a good fit. y=mx will be a good fit only if the line goes through the origin.

Now you can look at

y=mx+c

as

y = m * x + c * 1

y = m * X1 + c * X0

y = W1 * X1 + W0 * X0

I hope the figures below will clarify why we need the intercept term X0 and its weight W0=c.  Adding extra column x0 is a design choice.
mathematically: if you multiply w by x you get a single value (simply dot product), thus you need to encode another learnable parameter independent of x like a prior (belief), you end up doing w.x + 1*(bias)

The column x0 is a constant that is used to fit the intercept. Excluding that will give you the coefficients but without an intercept.