Ask Your Question
0

How to do operations that change a relation?

asked 2014-12-11 14:34:45 +0100

ensaba gravatar image

updated 2014-12-11 14:37:53 +0100

For example, given a < b, we know that if we multiply both sides with -1, we will get -a > -b.

But in sage, if I try this:

var('a b')
exp=a>b
exp*-1

I get:

  −a>−b

The > did not get flip (the same also happens if we take the reciprocal).

Are the functions in Sage that can perform the multiplication with properly handle the inequality as well? Otherwise, what is the recommended way to do this manually?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2014-12-11 15:42:44 +0100

rws gravatar image

updated 2014-12-11 15:57:42 +0100

This is being discussed and worked on by developers in trac ticket #7660 .

If you have a complicated relation r=...<... you can say

sage: new_r = -r.lhs() > -r.rhs()
edit flag offensive delete link more

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: 2014-12-11 14:34:45 +0100

Seen: 167 times

Last updated: Dec 11 '14