Re: logic challenge for Mathematica (and others?)
- From: Jean-Marc Gulliet <jeanmarc.gulliet@xxxxxxxxx>
- Date: Wed, 16 Aug 2006 15:30:18 +0200
G. A. Edgar wrote:
In[1] := 3+Infinity == 4+Infinity
Out[1] = True
Limit[3 + x, x -> Infinity] == Limit[4 + x, x -> Infinity]
--> True
In[2] := 3+{} == 4+{}
Out[2] = True
{1, 2, 3} is a list of three elements. Say we want to add 3 to each element of the list: 3 + {1, 2, 3} yields {4, 5, 6}. Now, {} is an empty list. Mathematica cannot add up a scalar to the empty list, so it returns an empty list. I do not know whether this answer is really intended by WRI -- usually Mathematica returns an expression unevaluated when it do not know what to do with it (that is it does not have any replacement rules or error/warning messages) -- or just some side effect of the overloaded addition operator.
Trace[3 + {} == 4 + {}]
--> {{3 + {}, {}}, {4 + {}, {}}, {} == {}, True}
.
- Follow-Ups:
- References:
- logic challenge for Mathematica (and others?)
- From: rjf
- Re: logic challenge for Mathematica (and others?)
- From: G. A. Edgar
- logic challenge for Mathematica (and others?)
- Prev by Date: Re: logic challenge for Mathematica (and others?)
- Next by Date: Re: logic challenge for Mathematica (and others?)
- Previous by thread: Re: logic challenge for Mathematica (and others?)
- Next by thread: Re: logic challenge for Mathematica (and others?)
- Index(es):