Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
0

How to do operations that change a relation?

asked 10 years ago

ensaba gravatar image

updated 10 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 10 years ago

rws gravatar image

updated 10 years ago

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

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

Seen: 235 times

Last updated: Dec 11 '14