Re: Re: recognizing integer numbers
- To: mathgroup at smc.vnet.net
- Subject: [mg34050] Re: [mg33984] Re: [mg33924] recognizing integer numbers
- From: Andrzej Kozlowski <andrzej at bekkoame.ne.jp>
- Date: Sun, 28 Apr 2002 03:46:47 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I was of course at least partially wrong wrong in what I wrote below (I
realized this after seeing Bob Hanlon's posting) since Mathematica knows
the following:
In[1]:=
Sum[Binomial[n,i] a^i b^(n-i),{i,0,n}]
Out[1]=
b^n*((a + b)/b)^n
This only partly contradicts what I wrote, since basically Mathematica
can't simplify of manipulate expressions of this type (with a variable
number of terms) unless they are "manually" reduced to the form it can
recognize. So in the case of the sum Manuel's example one can either use
Bob's trick, or "manually" recognize that
Sum[Binomial[2*m + 1, k]*(b^k*a^(-k + 2*m + 1) +
b^(-k + 2*m + 1)*a^k), {k, 0, m}]
is obviously the same thing as
In[2]:=
Sum[Binomial[2*m + 1, k]*(b^(-k + 2*m + 1)*a^k),
{k, 0, 2*m + 1}]
Out[2]=
b^(2*m)*(a + b)*((a + b)/b)^(2*m)
In[3]:=
Simplify[%,b>0]
Out[3]=
(a + b)^(1 + 2*m)
Still, I have to say both Bob's and this approach are just playing with
Mathematica and are basically useless for anything that is too
complicated to do "by hand" . So I stand by my assertion that
Mathematica "really" can't do this sort of thing , and in fact I believe
that there are not enough general algorithms for doing this sort of
thing for any implementation to be useful.
Andrzej
On Thursday, April 25, 2002, at 04:00 PM, Andrzej Kozlowski wrote:
> Mathematica cannot expand expressions like (a+b)^m or conversely, factor
> expand expressions into this form, even if you "tell it" that m is an
> integer. You can only do this sort of thing for a fixed non-negative
> integer m, like, say. m=20.
>
> In[1]:=
> m=20;
>
> In[2]:=
> Simplify[Sum[Binomial[2*m + 1, k]*(a^k*b^(2*m + 1 - k) + b^k*a^(2*m +
> 1 - k)), {k, 0, m}]]
>
> Out[2]=
> (a + b)^41
>
>
Andrzej Kozlowski
Toyama International University
JAPAN
http://platon.c.u-tokyo.ac.jp/andrzej/
>
>
> On Tuesday, April 23, 2002, at 08:13 PM, manuel ballester wrote:
>
>> Dear All:
>>
>> I need some help with the following. I am trying mathematica to solve
>> some sums for me. The thing is that I don't know how to tell
>> mathematica that certain numbers are non-negative integers and some
>> answers that I would expect as (for example) n! are given as
>> Gamma[n-1] and so on, sometimes Hypergeometric functions are also
>> involved. Example:
>>
>> Sum[Binomial[2*m+1,k]*( a^k*b^(2*m+1-k)+ b^k*a^(2*m+1-k) ),{k,0,m}]
>>
>> if m is a natural number then the answer to this is simply
>> (a+b)^(2*m+1)
>>
>> but since I don't know how to say this to mathematica it gives me an
>> answer with gamma and hypergeometric functions. I already tried
>> Simplify and FullSimplify.
>>
>> Thanks for your help
>>
>> manuel
>>
>>
>>
>
>
>