1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Rewriting bionomial sum using partial derivative

  1. Aug 25, 2014 #1
    Hi. Assume there's a probability ##q## for a guy to take a step to the right, and ##p=1-q## to take one to the left. Then the probability to take ##n## steps to the right out of ##N## trials is ##P(n) = {{N}\choose{n} }q^n p^{N-n}##.

    Now, what is ##<n>##? My textbook in statistical physics says ##<n> = \sum_{n=0}^N n{{N}\choose{n}} q^n p^{N-n} = q \frac{\partial}{\partial q} \sum_{n=0}^N {{N}\choose{n} }q^n p^{N-n} = q \frac{\partial}{\partial q} (q+p)^N = qN##

    OK, fair enough.. But what about the fact that ##(q+p)^N=1## ? Shouldn't this mean you're taking the partial derivative of a constant, and thus it equals 0? What am I missing here?
     
    Last edited: Aug 25, 2014
  2. jcsd
  3. Aug 25, 2014 #2

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    I can see no place where the "partial derivative" comes into this. Since p+ q= 1, your equation [itex](q+ p)^N= 1[/itex] is simply [itex]1^N= 1[/itex]. What variable are you taking the partial derivative with respect to?
     
  4. Aug 25, 2014 #3
    I'm taking it with respect to ##q##.. Or, rather, my textbook is. I'm kind of confused as well.

    The author wants to find ##<n>##, the expected amount of steps to the right, by doing a "trick":

    First he rewrites ##<n>## from ##<n> = \sum_{n=0}^N n{{N}\choose{n}} q^n p^{N-n}## into ##<n> = q \frac{\partial}{\partial q} \sum_{n=0}^N {{N}\choose{n} }q^n p^{N-n}##

    Then, since

    ##\sum_{n=0}^N {{N}\choose{n}} q^n p^{N-n} = (q+p)^N##

    This must be true:

    ##<n> = \sum_{n=0}^N n{{N}\choose{n}} q^n p^{N-n} = q \frac{\partial}{\partial q} \sum_{n=0}^N {{N}\choose{n} }q^n p^{N-n} = q \frac{\partial}{\partial q} (q+p)^N =qN (q+p)^{N-1} = qN##

    What I don't understand is how it's legal to take the partial derivative of something (in this case, ##(q+p)^N##) that's equal to 1, and not get 0.

    EDIT: I also fixed a type in OP: the ##<n>## was misplaced outside the summation sign.
     
    Last edited: Aug 25, 2014
  5. Aug 25, 2014 #4

    disregardthat

    User Avatar
    Science Advisor

    Here you are treating q as a real variable, and p, n and N as constants. So basically you are defining a function f(q), and taking its derivative.
     
  6. Aug 25, 2014 #5

    Stephen Tashi

    User Avatar
    Science Advisor

    The textbook didn't have to enforce the condition p+q = 1 in order to do the trick.

    For a function F(x,y) of two variables , there is a difference between [itex]{ \frac{\partial F(x,y)}{\partial x}} _{|_{ x=q,\ y=1-q}}[/itex] and [itex]{ \frac{\partial F(x,1-x)}{\partial{x}}}_{|_{x=q}} [/itex]
     
  7. Aug 25, 2014 #6

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    First, regard p and q as two separate variables when differentiating ##P(n)## wrt ##q## and summing over n. Then, after finishing you can finally put ##q = 1-p##. This is not really any different from evaluating ##\sum_{n=1}^N n 2^n## by first differentiating ##\sum_{n=1}^N n x^n## wrt ##x##, then putting in ##x=2## later.
     
  8. Aug 26, 2014 #7
    But how is this legal? You are differentiating something that is 1, yet you do not get 0? This seems very un-mathematical.
     
  9. Aug 26, 2014 #8

    disregardthat

    User Avatar
    Science Advisor

    The expression represents something, an expectancy value for a certain binomial situation where the probability is p.

    But, the expression can also be treated differently. Assuming q is a real variable, it is no longer the expectancy value of anything, just a function. But, after plugging in q = 1-p, we find that we have the same thing.

    Finding that the function is the derivative of a certain other function is just calculus. And this other function is easier to deal with, and we know its value at q = 1-p. By plugging, we see that we end up with the value we wanted to find. This is an example of using calculus just to calculate a certain value, and the calculation does not need any statistical interpretation. We just wanted to find the value.
     
  10. Aug 26, 2014 #9

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    Which message are you responding to? Please use the Quote button---which is put there for a good reason.

    Have you looked at my response (post #6)? That says it all, but since you seem to be missing something, here goes again. We certainly have
    [tex] (x+y)^n = \sum_{k=0}^n {n \choose k} x^k y^{n-k} [/tex]
    for ANY ##x## and ##y##. Do you accept that
    [tex] x \frac{\partial}{\partial x} (x+y)^n = n x (x+y)^{n-1}?[/tex]
    Do you accept that
    [tex] x \frac{\partial}{\partial x} \sum_{k=0}^n {n \choose k} x^k y^{n-k}
    = \sum_{k=0}^n k {n \choose k} x^k y^{n-k}? [/tex]
    If you accept these equations then you are forced---no choice--- to accept the equation
    [tex] x n (x+y)^{n-1} = \sum_{k=0}^n k {n \choose k} x^k y^{n-k} [/tex]
    for ANY ##x## and ##y##. What is now preventing you from putting ##x=q, y = 1-q##?
     
  11. Aug 26, 2014 #10
    Ray: The calculus in itself was never the issue.

    Guys, what confused me was that it's OK to define away the fact that p+q = 1 in the first moment, and then apply it in the next for convenience. But fair enough, I see things from a different perspective now. At the end of the day there's no mathematical reason you can't do it.
     
    Last edited: Aug 26, 2014
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Rewriting bionomial sum using partial derivative
Loading...