MathGroup Archive 2005

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

Search the Archive

Re: Problem defining assumptions on a set of variables


Koffijberg, H. wrote:
> Hi all,
> 
> I have encountered two problems using Mathematica v5.0 with parameters
> for which no value is defined but for which some assumptions are defined.
> I do not understand why each of the following statements return -1.
> 
> Assuming[q\[Element]Reals&&q>0&&q<1, If[q > 3, 1, 0, -1]]
> Refine[If[q > 3, 1, 0, -1],q\[Element]Reals&&q>0&&q<1]
> 
Hi Erik,

No problem here; Mathematica behaves has expected. As an example, let 
examine your first statement:

In[1]:=
Assuming[q â?? Reals && q > 0 && q < 1,
   If[q > 3, 1, 0, -1]]

Out[1]=
-1

Part of this statement is equivalent to the logical combination of the 
following two inequalities

In[2]:=
0 < q < 1 && q > 3

Out[2]=
0 < q < 1 && q > 3

In this case, Mathematica returns the expression itself since it cannot 
decide whether it is right or wrong: each inequality is true by itself 
but when combined they become a contradictory or undecidable proposition 
about q.

Your original statement does not assign any value or range of values to 
q, so the test is inconclusive and the *If* statement returns -1.

A similar reasoning apply to the next statement

In[3]:=
Refine[If[q > 3, 1, 0, -1], 0 < q < 1]

Hope this helps,
/J.M.


  • Prev by Date: Problems with my first package: Statistics`Common`RegressionCommon`BestFitParameters instead of BestFitParameters
  • Next by Date: Re: Problem defining assumptions on a set of variables
  • Previous by thread: Problem defining assumptions on a set of variables
  • Next by thread: Re: Problem defining assumptions on a set of variables