MathGroup Archive 2006

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

Search the Archive

Re: Simplify UnitStep expressions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69314] Re: [mg69195] Simplify UnitStep expressions
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Wed, 6 Sep 2006 04:28:50 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 5 Sep 2006, at 16:20, Adam Strzebonski wrote:

> Andrzej Kozlowski wrote:
>> On 1 Sep 2006, at 11:41, L. Dwynn Lafleur wrote:
>>> The following is transcribed from a Mathematica 5.2 notebook in   
>>> Windows XP:
>>>
>>> In[1]:= Simplify[UnitStep[a-x/b], a-x/b > 0]
>>> Out[1]= 1
>>>
>>> In[2]:= Simplify[UnitStep[a-Pi/b], a-Pi/b > 0]
>>> Out[2]= UnitStep[a-Pi/b]
>>>
>>> Why does the second output different from the first?  I know it has
>>> something to do with the fact that Pi is internally defined in   
>>> Mathematica
>>> because a similar result occurs Pi is replaced with E, but what   
>>> logic is
>>> being followed?
>>>
>>> -- 
>>> ======================================
>>>  L. Dwynn Lafleur
>>>  Professor of Physics
>>>  University of Louisiana at Lafayette
>>>  lafleur at louisiana.edu
>>> ======================================
>>>
>> Curiously, if you use FullSimplify rather then Simplify you will get:
>> FullSimplify[UnitStep[a-Pi/b], a-Pi/b > 0]
>> 1
>> The same holds if Pi is replaces by E, or indeed by explicit   
>> functions of E or Pi such as Pi^2, E^Pi etc. In all such cases   
>> FullSimplify works but Simplify does not work. Strange.
>> Andrzej Kozlowski
>
> The cylindrical algebraic decomposition (CAD) algorithm used by  
> Simplify
> to prove inference requires polynomial inequalities with rational  
> number
> coefficients. a-x/b > 0 is equivalent to a polynomial inequality
> -(a*b^2) + b*x < 0 which has rational number coefficients.
> a-Pi/b > 0 is equivalent to a polynomial inequality -(a*b^2) + b*Pi  
> < 0
> which has a numeric coefficient Pi which is not a rational number.
>
> Mathematica has two ways of dealing with nonrational numeric
> coefficients in CAD. One is to replace each nonrational coefficient
> with a new variable. This method always allows to decide inference
> (modulo the ability to zero-test the exact numeric constants), but
> it is potentially very expensive - CAD has a doubly exponential
> complexity in the number of variables and we add a new variable for
> each nonrational coefficient. The second method replaces nonrational
> numeric coefficients with their approximations. This is much less
> expensive, but in some cases it fails to decide inference.
> Simplify uses the second method which in this case is insufficient.
>
> FullSimplify uses more transformations, and one of the additional
> transformations succeeds.
>
> Best Regards,
>
> Adam Strzebonski
> Wolfram Research
>
>
>

Thanks for the explanation. I feel I should have guessed it, but  
there is one thing that still puzzles me. What exactly makes the  
rational approximation fail for Pi or E, since it seems to work fine  
for algebraic numbers such as Sqrt[2] or 3^(1/3)? It certainly can't  
be anything to do with Pi or E not being algebraic, so presumably it  
is something to do with the way the rational approximation is chosen?  
This sounds very interesting; could you explain the exact reason why  
the rational approximation in this case doe snot work and in what  
other cases will it not work in general? It sounds like the reason  
might be mathematically interesting (?).

Andrzej Kozlowski


  • Prev by Date: Re: Simplify UnitStep expressions
  • Next by Date: Re: Re: generalized foldlist problem - part 2
  • Previous by thread: Re: Simplify UnitStep expressions
  • Next by thread: Re: Simplify UnitStep expressions