Re: Re: Re: question related to (-1)^(1/3)
- To: mathgroup at smc.vnet.net
- Subject: [mg96787] Re: [mg96766] Re: [mg96749] Re: question related to (-1)^(1/3)
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Wed, 25 Feb 2009 04:01:33 -0500 (EST)
- Organization: Mathematics & Statistics, Univ. of Mass./Amherst
- References: <gnqo3c$c95$1@smc.vnet.net> <200902231004.FAA28251@smc.vnet.net> <200902241046.FAA23618@smc.vnet.net>
- Reply-to: murray at math.umass.edu
You COULD use the legacy RealOnly package: <<Miscellaneous`RealOnly` RecurrenceTable[{x[n+1]==-x[n]^(1/3), x[0]==1},x, {n,0,200}]//N You'll get what you wanted. Note that you have to start the iterator n at 0, though, not 1; otherwise, you'll have as output {-1.,1.,-1.,...}. The Mathematica paradigm is different from another system. There's no direct analog of "domain". patapon wrote: > I just want to get the real solution of (-1)^(1/3). > BTW, I have read the tutorial but I am still confused with its explanation. > But that is not important, I just feel it is inconvenient for the following > problem: > > RecurrenceTable[{x[n + 1] == -x[n]^(1/3), x[0] == 1}, x, {n, 1, 200}] // N > > I consider there should be a way to limit the output in the domain real. > for example, in MAXIMA > > (%i1) domain; > (%o1) real > (%i2) (-1)^(1/3); > (%o2) -1 > (%i3) domain:complex; > (%o3) complex > (%i4) (-1)^(1/3),numer; > (%o4) 0.86602540378444*%i+0.5 > > On Mon, Feb 23, 2009 at 6:04 PM, Sjoerd C. de Vries < > sjoerd.c.devries at gmail.com> wrote: > >> This misunderstanding pops up over and over again in this group. >> Please type tutorial/FunctionsThatDoNotHaveUniqueValues in the search >> bar of the mathematica doc centre. >> >> Cheers -- Sjoerd >> >> On Feb 22, 7:33 am, "=D2=BB=D2=B6=D6=AA=C7=EF" <lxguard... at yahoo.com.cn> = >> 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 >> >> > -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
- References:
- Re: question related to (-1)^(1/3)
- From: "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com>
- Re: Re: question related to (-1)^(1/3)
- From: patapon <lxguard-hw@yahoo.com.cn>
- Re: question related to (-1)^(1/3)