For this case, you can reformulate the system in matrix-vector format and then use LeastSquares[]
:
mat = {{2, 3}, {1, 1}, {1, 1}, {2, 3}}; vec = {5, 4, 39/10, 51/10};
LeastSquares[mat, vec]
{34/5, -57/20}
N[%]
{6.8, -2.85}
which is of interest if one wants a solution that is optimal in the $2$-norm sense.
Sometimes, however, one might want to find solutions that are optimal in other norms, e.g. the $1$-norm or $\infty$-norm. One can of course use NMinimize[]
for that:
NMinimize[Norm[mat.{x, y} - vec, 1], {x, y}]
{0.19999999999999973, {x -> 6.690832044871543, y -> -2.77644284441384}}
NMinimize[Norm[mat.{x, y} - vec, ∞], {x, y}]
{0.05000000029087026, {x -> 6.800000000759247, y -> -2.8500000004683765}}
but it is better to use specialized methods in these cases, which rely on their equivalence to a linear programming problem (see e.g. this paper):
L1Solve[A_?MatrixQ, b_?VectorQ, opts___] := Module[{m, n, id},
{m, n} = Dimensions[A]; id = IdentityMatrix[m, Head[A]];
Take[LinearProgramming[PadLeft[ConstantArray[1, 2 m], 2 m + n],
Join[A, -id, id, 2], PadRight[List /@ b, {Automatic, 2}],
PadRight[ConstantArray[-∞, n], 2 m + n], opts], n]]
LInfinitySolve[A_?MatrixQ, b_?VectorQ, opts___] := Module[{n = Last[Dimensions[A]]},
Rest[LinearProgramming[UnitVector[n + 1, 1],
PadLeft[Join[-A, A], {Automatic, n + 1}, 1], Join[-b, b],
ConstantArray[-∞, n + 1], opts]]]
L1Solve[mat, vec]
{33/5, -27/10}
N[%]
{6.6, -2.7}
LInfinitySolve[mat, vec]
{34/5, -57/20}
N[%]
{6.8, -2.85}
Somewhat coincidentally, the $\infty$-norm solution coincides with the $2$-norm solution in this case.
(On another note, the documentation used to have notes on finding $1$-norm and $\infty$-norm solutions.)
Solve[{2 a + 3 b == Mean[{5, 5.1}], a + b == Mean[{4, 3.9}]}, {a, b}]
might be what you want. $\endgroup$