# Which Solution Does \`\\\` Return?

**URL:** <https://discourse.julialang.org/t/which-solution-does-return/61902>\
**Category:** General Usage\
**Created:** [May 27, 2021, 6:40am UTC](https://discourse.julialang.org/t/which-solution-does-return/61902 "2021-05-27T06:40:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [May 27, 2021, 6:40am UTC](https://discourse.julialang.org/t/which-solution-does-return/61902/1 "2021-05-27T06:40:02Z")

</div>

I saw this insightful discussion on Slack (Made some editing for clarity):

@baggepinnen :

> The `\` (Operator) should produce the minimum norm solution if many exist, and that’s what it does.

@RoyiAvital :

> I am not sure `\` will always yield the minimum norm vector. At least it doesn’t on MATLAB. Which uses `QR` for basic solution for non square matrices.

@ Andreas Noack:

> [In Julia] `/` will give a minimum norm solution for rectangular problems but not square problems (which is indeed a bit odd).  
> When the problem is underdetermined, MATLAB produces a basic solution (i.e. with zeros) whereas Julia chooses the minimum norm solution. The latter but not the former is built into some LAPACK routines. However, it’s quite easy to build a basic solution from a pivoted QR.

@ Dominique:

> Also, `\` only returns the min-norm solution if A is dense. If A is sparse (and rectangular), `\` returns a **basic** solution, i.e., one with many zeros.

If anyone else had more info to add, please do.

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [June 10, 2021, 1:30am UTC](https://discourse.julialang.org/t/which-solution-does-return/61902/2 "2021-06-10T01:30:02Z")

</div>

I think the important thing to emphasize is that it returns

1. a minimum error solution for over-determined systems
2. the solution for fully determined systems
3. a solution for under-determined systems

What specific solution we return for under-determined systems is an implementation detail, and if you really care about which solution you get, you probably shouldn’t use `\`.
