Ask Your Question
0

Will "solve_right" return integer solutions if one exists?

asked 2016-02-03 13:08:49 -0500

done_with_fish gravatar image

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-02-03 15:09:04 -0500

The 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)
edit flag offensive delete link more

Comments

There 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?

kcrisman gravatar imagekcrisman ( 2016-02-04 07:50:07 -0500 )edit

It is not so hard either ;-) Just some arithmetic with Z-modules.

vdelecroix gravatar imagevdelecroix ( 2016-02-04 09:28:39 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-02-03 13:08:49 -0500

Seen: 133 times

Last updated: Feb 03 '16