Solve[{3x+2y==1,4x-y==5,2x+2y==-3},{x,y}]

A = {{3,2},{4,-1},{2,2}};

b ={{1},{5},{-3}};

X = {{x},{y}};

(A.X == b)//MatrixForm

RowReduce[Join[A,b,2]]//MatrixForm

PA = Transpose[A].A;

PA//MatrixForm

PA.X == Transpose[A].b

Xsoln = Inverse[PA].Transpose[A].b

ThreeLines = ContourPlot[{3x+2y==1,4x-y==5,2x+2y==-3},{x,-3,7},{y,-7,3}];

MyPoint = ListPlot[{{(23/25),-(121/75)}}];

Show[ThreeLines,MyPoint, AspectRatio->1]

A.Xsoln

b

Norm[A.Xsoln-b]

DVect = A.X-b

NormError = Sqrt[DVect[[1,1]]^2+DVect[[2,1]]^2+DVect[[3,1]]^2]

NormError/.{x->(23/25), y-> -(121/75)}

NormErrorPlot = Plot3D[NormError,{x,-3,7},{y,-7,3}];

ApproxPlot = ListPointPlot3D[{{(23/25),-(121/75),(11/5)}},PlotStyle->PointSize[0.025]];

Show[NormErrorPlot,ApproxPlot]

Solve[{3x+2y==1,4x-y==5,2x+2y==0},{x,y}]

ThreeLines2 = ContourPlot[{3x+2y==1,4x-y==5,2x+2y==0},{x,-3,7},{y,-7,3}]

b2 ={{1},{5},{0}};

Inverse[PA].Transpose[A].b2