MathGroup Archive 2007

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

Search the Archive

Re: Re: Simplify (-1)^((-1)^n)


On 5/22/07, Bob Hanlon <hanlonr at cox.net> wrote:
> Applying brute force:
>
> integerSimplify[expr_, n_Symbol]:=Module[{ev,od},
>     Off[Simplify::fas];
>     ev=Simplify[expr,EvenQ[n]];
>     od=Simplify[expr,OddQ[n]];
>     On[Simplify::fas];
>     If[ev==od,ev,expr]]
>
> integerSimplify[(-1)^((-1)^n),n]
>
> -1

No! That gives wrong answers.
In[65]:= integerSimplify[(-1)^n,n]
Out[65]= 1

You should *never* ignore Simplify::fas or you can prove anything you like:
Eg, pi==3...
In[86]:= Simplify[x==3&&x==\[Pi],False]
During evaluation of In[86]:= Simplify::fas: Warning: One or more
assumptions evaluated to False. >>
Out[86]= True


  • Prev by Date: Re: Dialogs and inheritance
  • Next by Date: Re: Evaluation Question
  • Previous by thread: Re: Simplify (-1)^((-1)^n)
  • Next by thread: little help needed