Re: summing a series in mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg64052] Re: summing a series in mathematica
- From: Peter Pein <petsie at dordos.net>
- Date: Sun, 29 Jan 2006 05:57:29 -0500 (EST)
- References: <drf72r$ekh$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Patrik schrieb: > I am trying to sum a function f(R) but want to specify an assumption for values one of the parameters can take. Specifically : > > f = Q!/(R! (Q - R)!) (g ^ R) ((1 - g)^(Q - R)) (P(1 + 2 R d - P)/(1 + R d)) > > where g is a CDF and thus lies between 0 and 1. I wanted to get a simplified expression for Sum(f) where R goes from 1 to Q but want the system to account for the constraint on g. I tried: > > FullSimplify[Sum[f,{R,Q}], {R, Q}], {g < 1, g > 0}] > > But the simplification that mathematica gives has the following term in it: > > Beta[g/g-1, 1/d + 1, Q] > > Note that g/(g-1) is actually a negative number & the incomplete beta function is not defined for negative parameter. Is there a way to get Mathematica to realize that g<1 while making the simplification? Alternatively, is there a better way to simplify? > > I tried replacing g/(1-g) by a new term 'x'. However, the resulting simplification had Beta[-x, 1+1/d, Q]. So, that didn't help. My ultimate goal is to take the derivative of the final expression (output of fullsimplify), so I don't mind an approximation if it makes the derivative look simple. > > Your comments would be sincerely appreciated. > Hi Patrik, what are the domains of P, Q and d? I've got no problem, evaluating your sum at e.g. g=1/2: In[1]:= $Assumptions={Element[{P,Q,R}, Integers],P>0<R,Q>0<g<1}; In[2]:= f=Q!/(R! (Q-R)!) (g^R) ((1-g)^(Q-R)) (P(1+2 R d-P)/(1+R d)); In[3]:= fsum=Sum[f//Evaluate,{R,1,Q}]//FunctionExpand//FullSimplify Out[3]= (-1 + (1 - g)^Q)*(-1 + P)*P - ((1 - g)^(1/d + Q)*P*(1 + P)*Q*Beta[g/(-1 + g), 1 + 1/d, Q])/(-g)^d^(-1) In[4]:= fsum/.{g->1/2,d->3,Q->17,P->12}//FullSimplify Out[4]= 12265917559597029/692132625121280 In[5]:= N[%] Out[5]= 17.72191790185835 confused greetings, Peter