# Can the solution of a linear program be irrational?

Let's consider a generic linear programming problem. Is it possible that the decision variables of the objective function assume (at the optimal solution) irrational values?

Also, is it possible that some entries of the $A$ matrix are irrational?

• When you are working with numerical algorithms the goal is to attain your goals within a prescribed precision/accuracy. So the rationals suffice. Jul 13 '18 at 8:36
• How do i assure that the objective function will have only rational variables in its solutions ? Jul 13 '18 at 8:56
• This is a totally different question. If you only have rational inputs, you will have rational outputs (as rational are a field and the linear programming only uses additions multiplications and their reciprocal). If you have irrational inputs, well maybe it balances, maybe not. However, what good will it do to know that the result is rational? 1/3 is rational but is not exactly modeled in a computer representation... Jul 13 '18 at 9:07
• My prof told us that a difference beetween Linear Programming and Integer linear Programming is that in Linear Programming variables has fractional values while in Integer linear Programming certain variables can have only integer values... Jul 13 '18 at 9:20

Edit: I see my answer was a bit unclear. If the solution to the rational LP is unique, it is rational. If it is non-unique, you can always generate an irrational solution by taking a linear combination of two rational solutions $\alpha x_1 + (1-\alpha)x_2$ where $\alpha$ is an irrational number between $0$ and $1$.
$$\min x$$ subject to $$\sqrt{2}x=1$$ is a valid linear programming instance.