Rewriting bionomial sum using partial derivative

Click For Summary

Homework Help Overview

The discussion revolves around the calculation of the expected number of steps to the right in a binomial probability scenario, where the probabilities of stepping right and left are defined as ##q## and ##p=1-q##, respectively. The original poster questions the validity of taking a partial derivative of the expression ##(q+p)^N##, which equals 1, in the context of finding the expected value ####.

Discussion Character

  • Conceptual clarification, Mathematical reasoning, Assumption checking

Approaches and Questions Raised

  • Participants explore the legitimacy of differentiating a constant and question the implications of treating ##p## and ##q## as independent variables during differentiation. There are discussions about the mathematical properties of the binomial expression and the expected value calculation.

Discussion Status

The conversation is ongoing, with participants providing insights into the differentiation process and its implications. Some suggest that the treatment of ##p## and ##q## as independent variables is a valid approach, while others express confusion about the mathematical legality of the operations performed.

Contextual Notes

There is a noted tension between the statistical interpretation of the problem and the mathematical manipulation of the expressions involved. Participants are grappling with the implications of the constraint ##p+q=1## while attempting to apply calculus techniques.

Nikitin
Messages
734
Reaction score
27
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:
Physics news on Phys.org
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?
 
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:
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.
 
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]
 
Nikitin said:
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?

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.
 
But how is this legal? You are differentiating something that is 1, yet you do not get 0? This seems very un-mathematical.
 
Nikitin said:
But how is this legal? You are differentiating something that is 1, yet you do not get 0? This seems very un-mathematical.

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.
 
  • Like
Likes   Reactions: 1 person
Nikitin said:
But how is this legal? You are differentiating something that is 1, yet you do not get 0? This seems very un-mathematical.

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}<br /> = \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##?
 
  • Like
Likes   Reactions: 1 person
  • #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:

Similar threads

Replies
5
Views
2K
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
797
  • · Replies 12 ·
Replies
12
Views
3K
Replies
2
Views
2K