When has and full row rank, has infinitely many solutions . Murphy's book picks the one of minimum norm,
Implement three ways to reach it. Do not call np.linalg.pinv or np.linalg.lstsq; np.linalg.solve is allowed.
min_norm_solution(A, b): the right pseudo-inverse solution , computed with a solve rather than an explicit inverse.
min_norm_via_kkt(A, b): form the Lagrangian , write its two stationarity conditions and as one linear system in , solve it, and return the tuple (x, lam) with x of length and lam of length .
min_norm_from_particular(A, x_p): given any solution of , return the minimum-norm solution of the same system by removing the component of that lies in the null space of (you are not given ).
All three return 1-D float arrays (the second returns a tuple of two).