# Rewrite of function into closed-form

1. May 26, 2013

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:

• ###### PhysicsForum-Post1.docx
File size:
13.5 KB
Views:
68
2. May 26, 2013

### 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.

3. May 26, 2013

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.

4. May 26, 2013

### 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$$

5. May 26, 2013

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:

• ###### PhysicsForum-Post1,PDF.pdf
File size:
188.8 KB
Views:
59
6. May 26, 2013

### Staff: Mentor

I would replace it with "for" or |. You can do the same splitting in both separate sums again.

7. May 26, 2013

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.

File size:
191 KB
Views:
61