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

Rewrite of function into closed-form

  1. May 26, 2013 #1
    Attached is a document with a function P(a) which contains several "if" sections, i.e. a different function applies depending on which value the dummy variables take.

    Can anyone help me by rewriting this is as a straight, closed-form (sigma operators are fine) function in a? Or explaining why in this particular case it is impossible, if it is? I'd like something I can use to compute values of P(a) from a. In the current form, it cannot be used to compute values directly as far as I know.

    My instinct is that you'd just need to separate out the operators for each different section. But really I have no idea. If you could help that would be great.
     

    Attached Files:

  2. jcsd
  3. May 26, 2013 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    This is a very unusual way to use the "forall" operator.

    You can split the second sum in a sum from i2=1 to ii-1 and consider i2=i1 as separate sum (with just 1 entry, so you can drop the sum sign and set i2=i1). This allows to get rid of the cases in the first bracket. The same can be done for the second part.

    As all the sum indices do not depend on free parameters, you could just feed it to a computer algebra system and look at the result.
     
  4. May 26, 2013 #3
    Apologies for that, I wrote the function and so far I don't have too much experience with mathematical notation. What would be a better operator to use? (Not that it matters much - this thread is about removing the need!)

    Could you demonstrate, for the cases in the first bracket? I'll try and apply the same to the second bracket without asking back.
     
  5. May 26, 2013 #4

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    With my own example, as I don't want to open Word again (pdf or LaTeX would be better):
    $$\sum_{i_1=1}^{6} \sum_{i_2=1}^{i_1} \begin{cases} 1\, \mathrm{for}\, i_1=i_2 \\ 2\, \mathrm{for}\, i_1>i_2 \end{cases}\\
    = \sum_{i_1=1}^{6} \sum_{i_2=1}^{i_1-1} 2
    + \sum_{i_1=1}^{6} \sum_{i_2=i_1}^{i_1} 1
    = \sum_{i_1=1}^{6} \sum_{i_2=1}^{i_1-1} 2
    + \sum_{i_1=1}^{6} 1$$
    As the first summand is pointless for i1=1, this case can be dropped
    $$= \sum_{i_1=2}{6} \sum_{i_2=1}^{i_1-1} 2
    + \sum_{i_1=1}^{6} 1$$
     
  6. May 26, 2013 #5
    Thanks. I think I can see how to split one sigma function, but here we've got both cases and one multiplying the other, all within the summation operators. What's the rewriting then?

    I've reattached as a PDF. The "forall" operator is still there as I'm not sure what to replace it with, but that is a secondary discussion.
     

    Attached Files:

  7. May 26, 2013 #6

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    I would replace it with "for" or |. You can do the same splitting in both separate sums again.
     
  8. May 26, 2013 #7
    Please check my solution (attached) to tell me if anything is wrong.

    If there are any obvious simplifications that always hold, I'd love to hear, but I don't mind it being this long. Main thing is accuracy and functionality.
     

    Attached Files:

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Rewrite of function into closed-form
Loading...