Ask Your Question
0

Compare symbolic expressions

asked 2013-06-03 04:51:40 -0500

KurtM gravatar image

updated 2014-03-30 09:14:05 -0500

tmonteil gravatar image

Following is the problem I am trying to solve:

I have multiple complex symbolic expressions f1(x1,x2,...,xn),f2(x1,x2,...,xn),...,fn(x1,x2,...,xn) which are functions of symbolic variables x1,x2,...,xn. I also have some constraints for the symbolic variables, e.g. 0 is smaller than x1, 2 is smaller than x2, x2 is integer, etc. How can I find out for two selected symbolic expressions which one is larger for given constraints?

I've tried something like:

assume(0<x1,2<x2)< p="">

assume(x2,'integer')

bool(f1>f2)

It seems to work for more simple symbolic expressions. For more complex symbolic expressions (where a solution definitely exists) SAGE seems not to be able to compare the expressions. Is there a way to overcome this?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2013-06-03 05:04:10 -0500

tmonteil gravatar image

updated 2013-06-03 05:14:30 -0500

There is no general algorithm able to decide whether a symbolically defined function is positive even in a single variable, and using only log2, exp(x), pi, sin(x), x, +, - , *, o, see for example this paper.

Note that, when Sage is able to prove (f1>f2), it outputs True, otherwise, it will output False. This means that when Sage outputs "False", it means "False or Unknown".

Now, if you have a concrete example, someone may help you to decide in that particular case.

edit flag offensive delete link more

Comments

1

I'm sorry, but this design is a failure - to return False when the result is Unknown. This should definitely be fixed.

jack77 gravatar imagejack77 ( 2013-07-31 13:31:00 -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

Stats

Asked: 2013-06-03 04:51:40 -0500

Seen: 434 times

Last updated: Jun 03 '13