Re: Problem with using /.

*To*: mathgroup at smc.vnet.net*Subject*: [mg69229] Re: Problem with using /.*From*: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>*Date*: Sun, 3 Sep 2006 01:39:22 -0400 (EDT)*Organization*: The Open University, Milton Keynes, UK*References*: <edadil$pd0$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Nag wrote: > Hello: > > I am trying to compute the moments of a distribution using the moment > generating function, MGF[t,k]. Here is the relevant function for > computing the j'th moment. > > M[j_, t_, k_] := D[MGF[t, k], {t, j}] /. {u -> 0, Sum[Subscript[p, > i],{i, 0, k}] = 1}; > > After taking the j'th derivative, need to set u to 0 and the sum of > p(i)'s to 1. Why have you replaced the rule sign -> sign by the = sign? M[j_, t_, k_] := D[MGF[t, k], {t, j}] /. {u -> 0, Sum[Subscript[p, i], {i, 0, k}] -> 1}; HTH, Jean-Marc