Message Boards Message Boards

0
|
2873 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:
GROUPS:

Comparing result sets from Reduce in Mathematica

Posted 10 years ago

Hi,

Is there a simple way to check whether two result sets are equivalent/the same?

Here's a toy example:

A = x>0; B = -x<0;

I'd like to test if A==B. For example, this command outputs

(x > 0) == (-x < 0).

I've also tried using Complement, with no success.

Thank you! Pedro

POSTED BY: Pedro Gardete
2 Replies

The best way to handle inequalities is to treat them as logic statements and use Resolve:

A = x > 0; B = -x < 0;

Resolve[ForAll[x, Equivalent[A, B]], Reals]

True

Strictly speaking, depending on what you mean by "Set", it might be impossible to write an algorithm in any programming language that guarantee whether two sets are the same or not.

POSTED BY: Sean Clarke
Posted 10 years ago

Sean,

This is exactly what I was looking for; it does work for "simple" cases.

Thanks! P

POSTED BY: Pedro Gardete
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract