Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Sum of N geometric variables with changing probability

  1. Dec 1, 2012 #1
    1. The problem statement, all variables and given/known data


    sum of i=1 to N

    2. Relevant equations

    How do I solve this series for all 0<N<A cases.
    This series is the sum of N geometric variables of changing probability.

    I'd appreciate any help
  2. jcsd
  3. Dec 1, 2012 #2

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    You already have an expression that is just a finite sum involving A and N. Is there something more you want? Have you tried small values such as N = 2 or N = 3?
  4. Dec 1, 2012 #3
    Thank you for your reply.
    I need an expression that is not a summation.

    hmm... btw, where do you think we'd be if Johann Carl Friedrich Gauss had just said: "ohh it's a finite sum, I'll just add them all one by one" (or something like that in German)?
  5. Dec 1, 2012 #4

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    I was not criticizing; I was asking a question (which you answered, and then ruined by your snide comments about Gauss). Actually, the Forum rules require you to show your work, and to ask for help only when you are stuck, so I should not have replied at all. The summation is doable in terms of some non-elementary functions, and I would have been willing to help you before, but not now.
    Last edited: Dec 1, 2012
  6. Dec 1, 2012 #5
    I am sorry if I offended you in any way. It was not my intent. Generally, I like to write, and sometimes it gets me into trouble. Anyway, I did not think you were criticizing me, I appreciate any help, thank you.

    About showing my work, I'd be happy to. Actually I am the one writing the question, not solving it. If you wish to know, the question goes as follows:

    "CookieMonster has a jar filled with 10 cookies. N of these cookies are chocolate cookies, the other are healthy cookies.
    CookieMonster pulls a cookie from the jar, if it's chocolate he eats it. Otherwise he puts it back in the jar, shuffles and pulls again.
    How many cookies would he pull until he eats all the chocolate cookies".

    The number of cookies until each pull of chocolate cookie has a Geometric distribution:
    Xi~G(p). Where p is (N-i+1)/(11-i).
    For example: X1, the first pull has p=N/10. The second pull X2 has p=(N-1)/9... and so on. The total number of cookies pulled is the sum I gave above (where A is 11).

    I am able to solve this easily using a computer, but I want the students to be able to solve this in class using a clue.

    Thank you, and again sorry for the not-so-witty comment I made before. Didn't mean to offend anyone (not even Gauss, but I truly don't know much about him).

  7. Dec 1, 2012 #6

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    Sorry: I thought you were a student wanting help with homework, but since you seem to be an instructor, that's different.

    Here is what I get using Maple 11:

    > S:=sum((A-i)/(N+1-i),i=1..N) assuming N::posint; <--- input

    S:= (-gamma*N^2+N^2-N^2*Psi(N)+A*Psi(N)*N-gamma*N+gamma*A*N-N*Psi(N)-N+A-1)/N

    That is:
    [tex] S = \frac{U}{N}, \\
    U = -\gamma N^2 + N^2 - N^2 \Psi(N) + A N \Psi(N) - \gamma N + \gamma A N
    - N \Psi(N) - N + A-1,[/tex]
    where γ is Euler's constant and Psi(N) is the "digamma" function:
    [tex] \Psi(x) = \frac{d \ln \Gamma (x) }{dx}.[/tex]

    Note added in editing: in fact, it is even simpler if we look at the two parts separately. Maple gives the following:
    [tex] S_0 = \sum_{i=1}^N \frac{1}{N+1-i} = \Psi(N+1) + \gamma\\
    S_1 = \sum_{i=1}^N \frac{i}{N+1-i} = (N+1) \left( \; \Psi(N+2) - 1 + \gamma \; \right) [/tex]
    In order to check we can compare the summed results with these formulas for a number of N values; perfect agreement (within roundoff errors) are obtained for N = 1,2,..., 10.

    So, the final result is S = A*S0 - S1.
    Last edited: Dec 2, 2012
  8. Dec 2, 2012 #7
    Thank you.
    These functions are too complex for the course I am giving. I will have to suffice with the sum...
    But you reminded me to use Maple more often. So cheers!

  9. Dec 2, 2012 #8


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    It's the expectation that's wanted, yes? Whether the answer is complicated depends on what form of answer you'll accept.
    N cookies altogether, C chocolate.
    Expected number of tries for first chocolate = N/C.
    Expected number of tries for second chocolate = (N-1)/(C-1).
    Expected number of tries in total =[itex]\sum_{i=0}^{C-1}\frac{N-i}{C-i} = C+\sum_{i=0}^{C-1}\frac{N-C}{C-i} = C+(N-C)\sum_{i=0}^{C-1}\frac{1}{C-i} = C+(N-C)\sum_{i=1}^{C}\frac{1}{i} [/itex]
    So it's easy to arrive at a form that relates it to the harmonic series. Maybe you could supply a definition of the harmonic series partial sums, Hn, and ask for the answer in terms of it.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook