[Date Index] [Thread Index] [Author Index]
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:= Assuming[q â?? Reals && q > 0 && q < 1, If[q > 3, 1, 0, -1]] Out= -1 Part of this statement is equivalent to the logical combination of the following two inequalities In:= 0 < q < 1 && q > 3 Out= 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:= Refine[If[q > 3, 1, 0, -1], 0 < q < 1] Hope this helps, /J.M.