Generate Random Numbers for X and Y axis and plot Scatter diagram Using y=mx +c , predict values for X and store in Yhat and draw straight line Check if this line hits how many points in Y Check different between actual and predicted values Iterate 10 times above steps from 4 to 7 For better results keep changing m and c and plot