Prev: combining ArrayPlot with ListLinePlot
Next: Numerical solution of differential equation with boundary values
From: telefunkenvf14 on 19 May 2010 07:03 Can someone offer an explanation for the following output?---I'm trying to understand why it makes sense for Mathematica to be set up to respond like this. (Of course, feel free to point out any glaringly obvious math examples.) In[1]:= {a == a, a <= a, a >= a, a < a, a > a} Out[1]= {True, a <= a, a >= a, a < a, a > a} I would have thought that a <= a and a >= a would both evaluate to True, given that a == a does. Also, can something really be greater than itself? Hmmm... maybe there's hope for me after all. :) -RG
From: Simon on 19 May 2010 20:11 Hi RG, The default assumption mathematica makes is that an unknown symbol represents a complex number, which are not ordered. Thus, while a==a is automatically evaluated, to quote the help files: "Symbolic inequalities remain unevaluated, since x may not be a real number:" Interestingly a Simplify does not evaluate the inequalities but a FullSimplify is smart enough to return True/False answers. Simon On May 19, 7:03 pm, telefunkenvf14 <rgo...(a)gmail.com> wrote: > Can someone offer an explanation for the following output?---I'm > trying to understand why it makes sense for Mathematica to be set up > to respond like this. (Of course, feel free to point out any glaringly > obvious math examples.) > > In[1]:= {a == a, a <= a, a >= a, a < a, a > a} > > Out[1]= {True, a <= a, a >= a, a < a, a > a} > > I would have thought that a <= a and a >= a would both evaluate to > True, given that a == a does. Also, can something really be greater > than itself? Hmmm... maybe there's hope for me after all. :) > > -RG
From: Raffy on 19 May 2010 20:13 On May 19, 4:03 am, telefunkenvf14 <rgo...(a)gmail.com> wrote: > Can someone offer an explanation for the following output?---I'm > trying to understand why it makes sense for Mathematica to be set up > to respond like this. (Of course, feel free to point out any glaringly > obvious math examples.) > > In[1]:= {a == a, a <= a, a >= a, a < a, a > a} > > Out[1]= {True, a <= a, a >= a, a < a, a > a} > > I would have thought that a <= a and a >= a would both evaluate to > True, given that a == a does. Also, can something really be greater > than itself? Hmmm... maybe there's hope for me after all. :) > > -RG Equal will return true if the sides are identical (and not Indeterminate or Overflow). GreaterEqual, Greater, LessEqual, Less will only return true/false if its arguments are reals. To produce the desired result: Block[{a}, FullSimplify[{a == a, a <= a, a >= a, a < a, a > a}]]
From: Alexey Popkov on 19 May 2010 20:14 Hello, The reason is that for complex numbers comparison operation is undefined: In[1]:= a >= a // Reduce Out[1]= a \[Element] Reals But I do not understand the reason for different outputs from Simplify and FullSimplify in such a simple case: In[1]:= Simplify[a >= a] Simplify[a >= a, a \[Element] Reals] Simplify[a >= a, a \[NotElement] Reals] FullSimplify[a >= a] Assuming[a \[Element] Reals, a >= a] Refine[a >= a] Refine[a >= a, a \[Element] Reals] Refine[a >= a, a \[NotElement] Reals] Out[1]= a >= a Out[2]= True Out[3]= True Out[4]= True Out[5]= a >= a Out[6]= a >= a Out[7]= True Out[8]= a >= a "telefunkenvf14" <rgorka(a)gmail.com> �������/�������� � �������� ���������: news:ht0gho$bn$1(a)smc.vnet.net... > Can someone offer an explanation for the following output?---I'm > trying to understand why it makes sense for Mathematica to be set up > to respond like this. (Of course, feel free to point out any glaringly > obvious math examples.) > > In[1]:= {a == a, a <= a, a >= a, a < a, a > a} > > Out[1]= {True, a <= a, a >= a, a < a, a > a} > > I would have thought that a <= a and a >= a would both evaluate to > True, given that a == a does. Also, can something really be greater > than itself? Hmmm... maybe there's hope for me after all. :) > > -RG >
From: ingolf.dahl on 19 May 2010 20:14 Try with these, and you will see that there is some sense in the Mathematica output: With[{a = "a little string"}, {a == a, a <= a, a >= a, a < a, a > a}] With[{a = 1 + I}, {a == a, a <= a, a >= a, a < a, a > a}] With[{a = {5, 2}}, {a == a, a <= a, a >= a, a < a, a > a}] With[{a = (# &)}, {a == a, a <= a, a >= a, a < a, a > a}] Best regards Ingolf Dahl ingolf.dahl(a)telia.com -----Original Message----- From: telefunkenvf14 [mailto:rgorka(a)gmail.com] Sent: den 19 maj 2010 13:03 Subject: Equals, Less, Greater, etc; Confused by this simple output. Can someone offer an explanation for the following output?---I'm trying to understand why it makes sense for Mathematica to be set up to respond like this. (Of course, feel free to point out any glaringly obvious math examples.) In[1]:= {a == a, a <= a, a >= a, a < a, a > a} Out[1]= {True, a <= a, a >= a, a < a, a > a} I would have thought that a <= a and a >= a would both evaluate to True, given that a == a does. Also, can something really be greater than itself? Hmmm... maybe there's hope for me after all. :) -RG
|
Next
|
Last
Pages: 1 2 Prev: combining ArrayPlot with ListLinePlot Next: Numerical solution of differential equation with boundary values |