# strictly positive solution to $Ax=b$

How to find in mathematica one real strictly positive solution, if any, of $Ax=b$. A is rectangular matrix.

Thanks

• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! Dec 7 '14 at 0:47
• See LinearSolve[] and then FindInstance[] Dec 7 '14 at 0:50

a = {{1, 1, 1}, {1, 0, 1}};
b = {6, 4};

Reduce[{a.{x, y, z} == b, x > 0, y > 0, z > 0}, {x, y, z}, Reals]
(* 0<x<4 && y == 2 && z == 4-x *)


Find one instance:

FindInstance[{a.{x, y, z} == {6, 4}, x > 0, y > 0, z > 0}, {x, y, z}, Reals]
(* {{x -> 2,y -> 2,z -> 2}} *)


Find three instances:

FindInstance[{a.{x, y, z} == {6, 4}, x > 0, y > 0, z > 0}, {x, y, z}, Reals, 3]
(*  {{x -> 31/76, y -> 2, z -> 273/76},
{x -> 33/76, y -> 2, z -> 271/76},
{x -> 267/76, y -> 2, z -> 37/76}} *)