Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: InequalityInstance bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg26574] Re: [mg26560] InequalityInstance bug?
  • From: BobHanlon at aol.com
  • Date: Tue, 9 Jan 2001 01:51:49 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

I get a correct solution on a Mac.

$Version

"4.1 for Power Macintosh (November 2, 2000)"

ineqs = {
r[1, 2] - r[2, 1] == 0, 
r[2, 1] == -r[1, 1] - r[3, 1], 
-r[1, 2] + r[2, 1] == 0, 
r[2, 2] == -r[1, 2] - r[3, 2], 
r[2, 3] == -r[1, 3] - r[3, 3], 
r[2, 4] == -r[1, 4] - r[3, 4], 
r[1, 3] - r[3, 1] == 0, 
-r[1, 3] + r[3, 1] == 0, 
r[2, 3] - r[3, 2] == 0, 
-r[2, 3] + r[3, 2] == 0, 
r[1, 4] - r[4, 1] == 0, 
r[4, 1] == r[1, 1], 
-r[1, 4] + r[4, 1] == 0, 
r[2, 4] - r[4, 2] == 0, 
r[4, 2] == r[1, 2], 
-r[2, 4] + r[4, 2] == 0, 
r[3, 4] - r[4, 3] == 0, 
r[4, 3] == r[1, 3], 
-r[3, 4] + r[4, 3] == 0, 
r[4, 4] == r[1, 4], 
(-(r[1, 2]*r[3, 1]) + r[1, 1]*r[3, 2])^2 + 
    (-(r[1, 3]*r[3, 1]) + r[1, 1]*r[3, 3])^2 + 
    (-(r[1, 3]*r[3, 2]) + r[1, 2]*r[3, 3])^2 + 
    (-(r[1, 4]*r[3, 1]) + r[1, 1]*r[3, 4])^2 + 
    (-(r[1, 4]*r[3, 2]) + r[1, 2]*r[3, 4])^2 + 
    (-(r[1, 4]*r[3, 3]) + r[1, 3]*r[3, 4])^2 > 0, 
r[1, 1] >= 0, 
-(r[1, 2]*r[2, 1]) + r[1, 1]*r[2, 2] >= 0, 
-(r[1, 3]*r[2, 2]*r[3, 1]) + r[1, 2]*r[2, 3]*r[3, 1] + 
    r[1, 3]*r[2, 1]*r[3, 2] - r[1, 1]*r[2, 3]*r[3, 2] - 
    r[1, 2]*r[2, 1]*r[3, 3] + r[1, 1]*r[2, 2]*r[3, 3] >= 0, 
r[1, 4]*r[2, 3]*r[3, 2]*r[4, 1] - 
    r[1, 3]*r[2, 4]*r[3, 2]*r[4, 1] - r[1, 4]*r[2, 2]*
    r[3, 3]*r[4, 1] + r[1, 2]*r[2, 4]*r[3, 3]*r[4, 1] + 
    r[1, 3]*r[2, 2]*r[3, 4]*r[4, 1] - r[1, 2]*r[2, 3]*
    r[3, 4]*r[4, 1] - r[1, 4]*r[2, 3]*r[3, 1]*r[4, 2] + 
    r[1, 3]*r[2, 4]*r[3, 1]*r[4, 2] + r[1, 4]*r[2, 1]*
    r[3, 3]*r[4, 2] - r[1, 1]*r[2, 4]*r[3, 3]*r[4, 2] - 
    r[1, 3]*r[2, 1]*r[3, 4]*r[4, 2] + r[1, 1]*r[2, 3]*
    r[3, 4]*r[4, 2] + r[1, 4]*r[2, 2]*r[3, 1]*r[4, 3] - 
    r[1, 2]*r[2, 4]*r[3, 1]*r[4, 3] - r[1, 4]*r[2, 1]*
    r[3, 2]*r[4, 3] + r[1, 1]*r[2, 4]*r[3, 2]*r[4, 3] + 
    r[1, 2]*r[2, 1]*r[3, 4]*r[4, 3] - r[1, 1]*r[2, 2]*
    r[3, 4]*r[4, 3] - r[1, 3]*r[2, 2]*r[3, 1]*r[4, 4] + 
    r[1, 2]*r[2, 3]*r[3, 1]*r[4, 4] + r[1, 3]*r[2, 1]*
    r[3, 2]*r[4, 4] - r[1, 1]*r[2, 3]*r[3, 2]*r[4, 4] - 
    r[1, 2]*r[2, 1]*r[3, 3]*r[4, 4] + r[1, 1]*r[2, 2]*
    r[3, 3]*r[4, 4] >= 0}; 

vars = {r[1, 1], r[1, 2], r[1, 3], r[1, 4], 
    r[2, 1],  r[2, 2], r[2, 3], r[2, 4], 
    r[3, 1], r[3, 2], r[3, 3],  r[3, 4], 
    r[4, 1], r[4, 2], r[4, 3], r[4, 4]}; 

soln = Developer`InequalityInstance[ ineqs, vars ] // Sort

{r[1, 1] -> 1, r[1, 2] -> -1, r[1, 3] -> 0, r[1, 4] -> 1, r[2, 1] -> -1, r[2, 
2] -> 2, r[2, 3] -> -1, r[2, 4] -> -1, 
  r[3, 1] -> 0, r[3, 2] -> -1, r[3, 3] -> 1, r[3, 4] -> 0, r[4, 1] -> 1, r[4, 
2] -> -1, r[4, 3] -> 0, r[4, 4] -> 1}

And @@ (ineqs /. soln)

True

However, this solution is not the same as the one that you gave after 
substitution for the two True values.

Bob Hanlon

In a message dated 2001/1/5 11:02:56 PM, gorni at dimi.uniud.it writes:

>I am using Mathematica version 4.0. With ineqs and vars defined below
>I get the following unexpected output:
>
>In:  Developer`InequalityInstance[ ineqs, vars ]
>
>Out:{r[4, 4] -> 1, r[4, 3] -> -1, r[3, 3] -> 2, r[4, 2] -> 0,
>     r[4, 1] -> 1, r[3, 4] -> -1, r[3, 2] -> -1, r[3, 1] -> -1,
>     r[2, 4] -> 0, r[2, 3] -> True,
>     r[2, 2] -> 1, r[2, 1] -> 0, r[1, 4] -> True,
>     r[1, 3] -> -1, r[1, 2] -> 0,  r[1, 1] -> 1}
>
>Notice the values for r[2,3] and r[1,4]. I thought that perhaps
>True meant "arbitrary", but it is not so: the equations require
>that r[2,3] = -1, r[1,4] = 1.
>
>What happens with version 4.1?
>
>All best wishes for a new millennium with fewer bugs!
>
>              Gianluca Gorni
>
>ineqs = {r[1, 2] - r[2, 1] == 0, r[2, 1] ==
>  -r[1, 1] - r[3, 1], -r[1, 2] + r[2, 1] == 0,
> r[2, 2] == -r[1, 2] - r[3, 2],
> r[2, 3] == -r[1, 3] - r[3, 3],
> r[2, 4] == -r[1, 4] - r[3, 4],
> r[1, 3] - r[3, 1] == 0, -r[1, 3] + r[3, 1] == 0,
> r[2, 3] - r[3, 2] == 0, -r[2, 3] + r[3, 2] == 0,
> r[1, 4] - r[4, 1] == 0, r[4, 1] == r[1, 1],
> -r[1, 4] + r[4, 1] == 0, r[2, 4] - r[4, 2] == 0,
> r[4, 2] == r[1, 2], -r[2, 4] + r[4, 2] == 0,
> r[3, 4] - r[4, 3] == 0, r[4, 3] == r[1, 3],
> -r[3, 4] + r[4, 3] == 0, r[4, 4] == r[1, 4],
> (-(r[1, 2]*r[3, 1]) + r[1, 1]*r[3, 2])^2 +
>   (-(r[1, 3]*r[3, 1]) + r[1, 1]*r[3, 3])^2 +
>   (-(r[1, 3]*r[3, 2]) + r[1, 2]*r[3, 3])^2 +
>   (-(r[1, 4]*r[3, 1]) + r[1, 1]*r[3, 4])^2 +
>   (-(r[1, 4]*r[3, 2]) + r[1, 2]*r[3, 4])^2 +
>   (-(r[1, 4]*r[3, 3]) + r[1, 3]*r[3, 4])^2 > 0,
> r[1, 1] >= 0, -(r[1, 2]*r[2, 1]) +
>   r[1, 1]*r[2, 2] >= 0,
> -(r[1, 3]*r[2, 2]*r[3, 1]) + r[1, 2]*r[2, 3]*
>    r[3, 1] + r[1, 3]*r[2, 1]*r[3, 2] -
>   r[1, 1]*r[2, 3]*r[3, 2] - r[1, 2]*r[2, 1]*
>    r[3, 3] + r[1, 1]*r[2, 2]*r[3, 3] >= 0,
> r[1, 4]*r[2, 3]*r[3, 2]*r[4, 1] -
>   r[1, 3]*r[2, 4]*r[3, 2]*r[4, 1] -
>   r[1, 4]*r[2, 2]*r[3, 3]*r[4, 1] +
>   r[1, 2]*r[2, 4]*r[3, 3]*r[4, 1] +
>   r[1, 3]*r[2, 2]*r[3, 4]*r[4, 1] -
>   r[1, 2]*r[2, 3]*r[3, 4]*r[4, 1] -
>   r[1, 4]*r[2, 3]*r[3, 1]*r[4, 2] +
>   r[1, 3]*r[2, 4]*r[3, 1]*r[4, 2] +
>   r[1, 4]*r[2, 1]*r[3, 3]*r[4, 2] -
>   r[1, 1]*r[2, 4]*r[3, 3]*r[4, 2] -
>   r[1, 3]*r[2, 1]*r[3, 4]*r[4, 2] +
>   r[1, 1]*r[2, 3]*r[3, 4]*r[4, 2] +
>   r[1, 4]*r[2, 2]*r[3, 1]*r[4, 3] -
>   r[1, 2]*r[2, 4]*r[3, 1]*r[4, 3] -
>   r[1, 4]*r[2, 1]*r[3, 2]*r[4, 3] +
>   r[1, 1]*r[2, 4]*r[3, 2]*r[4, 3] +
>   r[1, 2]*r[2, 1]*r[3, 4]*r[4, 3] -
>   r[1, 1]*r[2, 2]*r[3, 4]*r[4, 3] -
>   r[1, 3]*r[2, 2]*r[3, 1]*r[4, 4] +
>   r[1, 2]*r[2, 3]*r[3, 1]*r[4, 4] +
>   r[1, 3]*r[2, 1]*r[3, 2]*r[4, 4] -
>   r[1, 1]*r[2, 3]*r[3, 2]*r[4, 4] -
>   r[1, 2]*r[2, 1]*r[3, 3]*r[4, 4] +
>   r[1, 1]*r[2, 2]*r[3, 3]*r[4, 4] >= 0};
>
>vars = {r[1, 1], r[1, 2], r[1, 3], r[1, 4], r[2, 1],
> r[2, 2], r[2, 3], r[2, 4],
>  r[3, 1], r[3, 2], r[3, 3], r[3, 4], r[4, 1],
> r[4, 2], r[4, 3], r[4, 4]}
>


  • Prev by Date: Expansion Coefficients in Multivariate Series Expansions?
  • Next by Date: DO if Loop
  • Previous by thread: InequalityInstance bug?
  • Next by thread: Random Sampling Without Replacement?