Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: question related to (-1)^(1/3)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96858] Re: question related to (-1)^(1/3)
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Thu, 26 Feb 2009 07:56:06 -0500 (EST)
  • References: <gnqo3c$c95$1@smc.vnet.net>

"�»�¶�ª�ï" wrote:

> I have tried expression:
> RecurrenceTable[{x[n + 1] == -x[n]^(1/3), x[0] == 1},
>   x, {n, 1, 200}] // N
>
> Mathematica produce
>  {-1., -0.5 - 0.866025 I, -0.766044 + 0.642788 I, -0.686242 -
>   0.727374 I, -0.71393 + 0.700217 I, -0.704818 - 0.709389 I,
> ...
>
> But it should be {1, -1, 1, -1, ... }
>
> If you try  (-1)^(1/3)
>
> In[10]:= (-1)^(1/3)
>
> Out[10]= (-1)^(1/3)
>
> In[11]:= % // N
>
> Out[11]= 0.5 + 0.866025 I 
>
As stated by others Mathematica always uses the principal branch for
roots. To give me the real branch I use the following function:


rprule=(b_?Negative)^Rational[m_,n_?OddQ]:>(-(-b)^(1/n))^m;
Attributes[ReellePotenz]={Listable,NumericFunction,OneIdentity};
ReellePotenz[b_?Negative, Rational[m_, n_?OddQ]] := (-(-b)^(1/n))^m;
ReellePotenz[x_,y_]:=Power[x,y];
ReellePotenz[x_]:=x//.rprule;

Then you get:

RecurrenceTable[{x[n + 1] == -x[n]^(1/3), x[0] == 1}, x, {n, 1, 10}] //
  ReellePotenz

Out={-1, 1, -1, 1, -1, 1, -1, 1, -1, 1}

Beware, that you can't apply this function to Reals, because they are
evaluated immediately by Mathematica:

In= (-1.)^(1/3)
Out=0.5+0.866025I


-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Map and functional constructs to replace iterative statements
  • Next by Date: Re: Series of Percentage Changes
  • Previous by thread: Re: Re: Re: question related to (-1)^(1/3)
  • Next by thread: Symbolic matrix operations