MathGroup Archive 2006

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

Search the Archive

Re: Getting the small parts right or wrong. Order and Collect

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63631] Re: Getting the small parts right or wrong. Order and Collect
  • From: "Richard Fateman" <fateman at cs.berkeley.edu>
  • Date: Sun, 8 Jan 2006 03:32:52 -0500 (EST)
  • References: <dpg11e$pm4$1@smc.vnet.net> <dplhq9$em8$1@smc.vnet.net> <200601070729.CAA06924@smc.vnet.net> <6FCF3227-C4E1-418A-BAC1-F3981F969878@mimuw.edu.pl> <dpo3gp$gaq$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"Andrzej Kozlowski" <akoz at mimuw.edu.pl> wrote in message 
news:dpo3gp$gaq$1 at smc.vnet.net...
> On 7 Jan 2006, at 18:04, Andrzej Kozlowski wrote:
>
>>
>>
>> There is one very simple thing you can do, which I think completely
>> deals with your problem.
>> You can convert the output to TraditionalForm.
>>

No,  because TraditionalForm is only a hack on the display.  If you pick
out the parts of the expression in sequence by  using %[[1]]   etc, you find
that the coefficients of the different powers of x  are picked out in the
StandardForm order, not the TraditionalForm order.

Putting the coefficients in an array is plausible, but Andrzej other 
solution, which
is 1 + Plus @@ Table[Coefficient[(1 + x + y)^3, x^i]*x^i, {i, 1, 3}]

is wrong because it results in answers in the order 1, x^3, x^2, x.
And of course picking out the coefficient of "1".

Along those lines it is
better to do ... Table[Coefficient[(1+x+y)^3,x,i] ,{i,0,3}] where i can also 
be 0.
And the table keeps the coefficients from being randomly sorted.

"Of course there is no way to make the powers of x ascend as you
originally seems to have wanted but then we can't have everything
even where Mathematica is concerned."    Eh, this one can be solved
with Table and Coefficient.  It is just that the EXAMPLE IN THE BOOK
is the mistake.

RJF






  • Prev by Date: Re: Odd answer from Mathematica
  • Next by Date: Re: Getting the small parts right or wrong. Order and Collect
  • Previous by thread: Re: Getting the small parts right or wrong. Order and Collect
  • Next by thread: Re: Re: Getting the small parts right or wrong. Order and Collect