MathGroup Archive 1997

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

Search the Archive

Re: Fwd: Permutation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9321] Re: Fwd: [mg9161] Permutation
  • From: Paul Abbott <paul at physics.uwa.edu.au>
  • Date: Mon, 27 Oct 1997 02:47:38 -0500
  • Organization: University of Western Australia
  • Sender: owner-wri-mathgroup at wolfram.com

David Djajaputra wrote:

> Is it possible to ask Mathematica to expand an abstract algebraic
> formula? I mean, to do
> something like
> 
> (1+x)^n = Sum[Binomial[n,m] x^m, {m,0,n}]
> 
> I have in mind problems like determining, in closed form, the
> coefficient of (x^m y^n) in
> 
> ((a+y) + (b+cx+dx^2))^k

One way is to omit the Sum and use the Einstein summation convention
which sums over repeated indicies.  (This is, implicitly, what a human
really does).  For your example (the following can be improved):

In[1]:= (d*x^2 + c*x + b + (a + y))^k /. 
  (a + y + (b_))^k -> Binomial[k, m]*(a + y)^m*b^(k - m)

Out[1]=
    2           k - m        m
(d x  + c x + b)      (a + y)  Binomial[k, m]

In[2]:= % /. ((a_) + (b_))^m -> Binomial[m, p]*b^p*a^(m - p)

Out[2]=
 m - p     2           k - m  p
a      (d x  + c x + b)      y  Binomial[k, m] Binomial[m, p]

In[3]:= PowerExpand[Simplify[% /. 
    ((a_) + b)^(q_) -> Binomial[q, r]*b^r*a^(q - r)]]

Out[3]=
 m - p  r  k - m - r          k - m - r  p a      b  x          (c + d
x)          y  Binomial[k, m] 
 
  Binomial[k - m, r] Binomial[m, p]

In[4]:= PowerExpand[% /. ((a_) + (b_))^(q_) -> Binomial[s, t]*b^s*a^(t -
s)]

Out[4]=
 m - p  r  t - s  s  k - m - r + s  p a      b  c      d  x             
y  Binomial[k, m] 
 
  Binomial[k - m, r] Binomial[m, p] Binomial[s, t]

Cheers,
	Paul 

____________________________________________________________________ 
Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia            Nedlands WA  6907       
mailto:paul at physics.uwa.edu.au  AUSTRALIA                            
http://www.pd.uwa.edu.au/~paul

            God IS a weakly left-handed dice player
____________________________________________________________________


  • Prev by Date: WriteList function?
  • Next by Date: Q: Abs[1+f*I] assuming f>0 and real
  • Previous by thread: Fwd: Permutation
  • Next by thread: Needs[]