Ask Your Question
0

Will "solve_right" return integer solutions if one exists?

asked 9 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 9 years ago

vdelecroix gravatar image

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)
Preview: (hide)
link

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 ( 9 years ago )

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

vdelecroix gravatar imagevdelecroix ( 9 years ago )

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: 9 years ago

Seen: 938 times

Last updated: Feb 03 '16