ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 04 Feb 2016 09:28:39 -0600Will "solve_right" return integer solutions if one exists?http://ask.sagemath.org/question/32430/will-solve_right-return-integer-solutions-if-one-exists/ If A is an integer matrix and b is an integer vector, then will the command `A.solve_right(b)` return an integer vector if the equation Ax=b is solvable over the integers?
Wed, 03 Feb 2016 13:08:49 -0600http://ask.sagemath.org/question/32430/will-solve_right-return-integer-solutions-if-one-exists/Answer by vdelecroix for <p>If A is an integer matrix and b is an integer vector, then will the command <code>A.solve_right(b)</code> return an integer vector if the equation Ax=b is solvable over the integers?</p>
http://ask.sagemath.org/question/32430/will-solve_right-return-integer-solutions-if-one-exists/?answer=32432#post-id-32432The answer is no
sage: A = matrix(2,3, [3,4,1,5,9,2])
sage: A.solve_right(vector((1,2)))
(1/7, 1/7, 0)
sage: A * vector((0,0,1))
(1, 2)Wed, 03 Feb 2016 15:09:04 -0600http://ask.sagemath.org/question/32430/will-solve_right-return-integer-solutions-if-one-exists/?answer=32432#post-id-32432Comment by vdelecroix for <p>The answer is no</p>
<pre><code>sage: A = matrix(2,3, [3,4,1,5,9,2])
sage: A.solve_right(vector((1,2)))
(1/7, 1/7, 0)
sage: A * vector((0,0,1))
(1, 2)
</code></pre>
http://ask.sagemath.org/question/32430/will-solve_right-return-integer-solutions-if-one-exists/?comment=32449#post-id-32449It is not so hard either ;-) Just some arithmetic with Z-modules.Thu, 04 Feb 2016 09:28:39 -0600http://ask.sagemath.org/question/32430/will-solve_right-return-integer-solutions-if-one-exists/?comment=32449#post-id-32449Comment by kcrisman for <p>The answer is no</p>
<pre><code>sage: A = matrix(2,3, [3,4,1,5,9,2])
sage: A.solve_right(vector((1,2)))
(1/7, 1/7, 0)
sage: A * vector((0,0,1))
(1, 2)
</code></pre>
http://ask.sagemath.org/question/32430/will-solve_right-return-integer-solutions-if-one-exists/?comment=32446#post-id-32446There is the natural question of how to *get* integer solutions in an efficient manner... but presumably one could create arbitrarily annoying matrices where that would not be so easy to do programmatically?Thu, 04 Feb 2016 07:50:07 -0600http://ask.sagemath.org/question/32430/will-solve_right-return-integer-solutions-if-one-exists/?comment=32446#post-id-32446