Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: Re: Log[4]==2*Log[2]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50610] Re: [mg50557] Re: [mg50520] Log[4]==2*Log[2]
  • From: Andrzej Kozlowski <andrzej at akikoz.net>
  • Date: Sun, 12 Sep 2004 04:42:26 -0400 (EDT)
  • References: <200409090917.FAA19334@smc.vnet.net> <200409100805.EAA04777@smc.vnet.net> <opsd4ehiyriz9bcq@monster.cox-internet.com> <2E4E6EFA-03F0-11D9-99E9-000A95B4967A@akikoz.net> <opsd59t8ufiz9bcq@monster.cox-internet.com> <598B2886-043B-11D9-99E9-000A95B4967A@akikoz.net>
  • Sender: owner-wri-mathgroup at wolfram.com

More fully and correctly (taking the rist of sounding very  pedantic): 
in the case when the quantities compared are not equal, even if they 
are exact, Mathematica can "settle" the question only if the difference 
is "large enough".
In the case of exact input, as in the posted example, he important 
thing is, that for equality the "required precision" is Infinity. So, 
an equality between exact numbers, when it holds, will be settled 
without applying Simplify or FullSimplify only if it can be settled by 
using exact numbers and a few very simple transformation rules used by 
the Evaluator. When equality does not hold it will be settled in cases 
when the difference between the two quantities is large enough, and in 
the remaining cases it will require increasing $MaxExtraPrecision.

In general with exact input it seems preferable to apply Simplify or 
FullSimplify without prior numerical evaluation, although of course 
there are many cases when simplification will not succeed while 
numerical comparison will, and cases when neither simplification nor 
numerical check can settle the question of equality.


Andrzej



On 12 Sep 2004, at 06:41, Andrzej Kozlowski wrote:

> Yes, I agree. Indeed, what it does it tries to settle "exact equality" 
> using inexact numbers, and it of course it can't be done. However,  as 
> you correctly point out, had the quantities entered not been equal 
> Mathematica would have settled the question. This is of course the 
> reason why it does anything at all except just simply returning the 
> input.
>
> Andrzej
>
>
> On 12 Sep 2004, at 02:07, DrBob wrote:
>
>> *This message was transferred with a trial version of CommuniGate(tm) 
>> Pro*
>>>> Mathematica could not determine anything because it tries to
>>>> compare the numbers "numerically" without using approximate 
>>>> numerical
>>>> values, which can't be done.
>>
>> I agree it can't be done; so why is Mathematica trying to do that? 
>> Documentation says:
>>
>>>> For exact numeric quantities, Equal internally uses numerical 
>>>> approximations to establish inequality.
>>
>> Inequality usually can be established this way, but equality never 
>> can be. I suppose that's what the error message "intends to mean". 
>> Equal tried to establish INEQUALITY and failed, yet is unwilling to 
>> declare EQUALITY.
>>
>> Hence the test could never be True for exact quantities. But...
>>
>> Log[2]==Log[2]
>>
>> True
>>
>> Sigh....
>>
>> Bobby
>>
>> On Sat, 11 Sep 2004 21:43:28 +0900, Andrzej Kozlowski 
>> <andrzej at akikoz.net> wrote:
>>
>>> *This message was transferred with a trial version of 
>>> CommuniGate(tm) Pro*
>>> Actually, I don't think Mathematica does any real "determining" since
>>> it does not replace the exact values given in the input by
>>> numerical approximations. The message issued is, I think, purely
>>> formal. Mathematica could not determine anything because it tries to
>>> compare the numbers "numerically" without using approximate numerical
>>> values, which can't be done. (You have to apply N for it to use
>>> numerical values). That't what I meant by "not surprisingly". I don't
>>> think I  really understand your point?
>>>
>>> ANdrzej
>>>
>>>
>>> On 11 Sep 2004, at 01:52, DrBob wrote:
>>>
>>>> *This message was transferred with a trial version of 
>>>> CommuniGate(tm)
>>>> Pro*
>>>>>> Mathematica does not apply any simplification rules but justtries 
>>>>>> to
>>>>>> evaluate the expression numerically and, not
>>>>>> surprisingly, it can't determine if the LHS is zero or not
>>>>>> up to the required precision.
>>>>
>>>> On the contrary, I think the error message itself clearly indicates
>>>> the difference IS zero to "the required precision". If 50 digits 
>>>> extra
>>>> precision isn't enough to determine that the difference ISN'T zero,
>>>> why doesn't Equal return True?
>>>>
>>>> Bobby
>>>>
>>>> On Fri, 10 Sep 2004 04:05:56 -0400 (EDT), Andrzej Kozlowski
>>>> <andrzej at akikoz.net> wrote:
>>>>
>>>>> On 9 Sep 2004, at 18:17, Andreas Stahel wrote:
>>>>>
>>>>>>
>>>>>> To whom it may concern
>>>>>>
>>>>>> the following answer of Mathematica 5.0 puzzeled me
>>>>>>
>>>>>> Log[4]==2*Log[2]
>>>>>> leads to
>>>>>>
>>>>>> N::meprec: Internal precision limit $MaxExtraPrecision = 50.` 
>>>>>> reached
>>>>>> while \
>>>>>> evaluating -2\Log[2]+Log[4]
>>>>>>
>>>>>> with the inputs given as answer. But the input
>>>>>>
>>>>>> Log[4.0]==2*Log[2]
>>>>>>
>>>>>> leads to a sound "True"
>>>>>>
>>>>>> Simplify[Log[4]-2*Log[2]]
>>>>>> leads to the correct 0, but
>>>>>> Simplify[Log[4]-2*Log[2]==0]
>>>>>> yields no result
>>>>>>
>>>>>> There must be some systematic behind thid surprising behaviour.
>>>>>> Could somebody give me a hint please
>>>>>>
>>>>>> With best regards
>>>>>>
>>>>>> Andreas
>>>>>> --
>>>>>> Andreas Stahel       E-Mail: Andreas.Stahel at [ANTI-SPAM]hti.bfh.ch
>>>>>> Mathematics, HTI     Phone: ++41 +32 32 16 258
>>>>>> Quellgasse 21        Fax:   ++41 +32 321 500
>>>>>> CH-2501 Biel         WWW:   www.hta-bi.bfh.ch/~sha
>>>>>> Switzerland
>>>>>>
>>>>>>
>>>>>
>>>>> When you enter
>>>>>
>>>>> Log[4] - 2*Log[2] == 0
>>>>>
>>>>> Mathematica does not apply any simplification rules but just tries 
>>>>> to
>>>>> evaluate the expression numerically and, not surprisingly, it can't
>>>>> determine if the LHS is zero or not up to the required precision.
>>>>>
>>>>> If you use
>>>>>
>>>>> Simplify[Log[4] - 2*Log[2] == 0]
>>>>>
>>>>> Mathematica first tries to evaluate the argument of Simplify and 
>>>>> the
>>>>> same thig happens as above, but then it actually applies Simplify 
>>>>> to
>>>>> the output and gets the right answer True.
>>>>>
>>>>> The best thing to do is:
>>>>>
>>>>>
>>>>> Simplify[Unevaluated[Log[4]-2*Log[2]==0]]
>>>>>
>>>>>
>>>>> True
>>>>>
>>>>> which avoids evaluation of the argument and instead uses Simplify 
>>>>> on
>>>>> the unevaluated input.
>>>>>
>>>>>
>>>>>
>>>>> Andrzej Kozlowski
>>>>> Chiba, Japan
>>>>> http://www.akikoz.net/~andrzej/
>>>>> http://www.mimuw.edu.pl/~akoz/
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> DrBob at bigfoot.com
>>>> www.eclecticdreams.net
>>>>
>>>
>>>
>>>
>>
>>
>>
>> -- 
>> DrBob at bigfoot.com
>> www.eclecticdreams.net
>>
>


  • Prev by Date: Re: Re: Log[4]==2*Log[2]
  • Next by Date: Re: Re: Log[4]==2*Log[2]
  • Previous by thread: Re: Re: Log[4]==2*Log[2]
  • Next by thread: Re: Re: Log[4]==2*Log[2]