1. Limited time only! Sign up for a free 30min personal 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!

Homework Help: Summation for a Python function

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

    For formatting sake Ive copied a picture of the problem and attached it here: http://i.imgur.com/kOjTy.png

    Im not worried about the coding part right now I feel I can handle that, my main issue is trying to understand how the values in the summation are derived. It seems simple enough, but I cant seem to grasp how they got the 10 values in the example there. Once I understand the summation, the coding should be easy. I just need a bit of guidance in how it all's working.

    2. Relevant equations

    Cn+1 = Ʃ Ck Cn-k from k = 0 to n

    3. The attempt at a solution
    C0 = 1

    Beyond that, here's what my understanding of it seems to be:
    For C1
    k starts at 0
    C1 = C0 * C1-0 + C1 * C1-1

    but this is where I get confused.

    Attached Files:

  2. jcsd
  3. Apr 14, 2012 #2


    User Avatar
    Science Advisor
    Gold Member

    I suspect one defines the process recursively. How many ways can you draw a line segment between vertices? Each way divides the polygon into two smaller polygons.

    You may then have to be careful iterating cases in a way that avoids double counting.
  4. Apr 14, 2012 #3
    hmm, i think you are reading the summation notation wrong, Cn+1 doesn't come into the equation, only Cn, the previous term.
    C1 = C0*C0 = 1
    C2 = C0*C1 + C1*C0 = 2
    C3 = C0*C2 + C1*C1 + C2*C0 = 5
    C4 = C0*C3 + C1*C2 + C2*C1 + C3*C0 = 14
    and so on...
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook