Rewrite of function into closed-form

  • Thread starter Thread starter Big-Daddy
  • Start date Start date
  • Tags Tags
    Function
AI Thread Summary
The discussion focuses on rewriting a function P(a) with conditional sections into a closed-form expression suitable for direct computation. Participants suggest splitting sums to eliminate case distinctions and recommend using a computer algebra system for simplification. There is a specific emphasis on handling the "forall" operator, with suggestions to replace it with more appropriate notation. The conversation includes examples of sum manipulation to clarify the rewriting process. Overall, the goal is to achieve an accurate and functional representation of P(a) without conditional complexity.
Big-Daddy
Messages
333
Reaction score
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.
 

Attachments

Mathematics news on Phys.org
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.
 
mfb said:
This is a very unusual way to use the "forall" operator.

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!)

mfb said:
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.

Could you demonstrate, for the cases in the first bracket? I'll try and apply the same to the second bracket without asking back.
 
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$$
 
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.
 

Attachments

I would replace it with "for" or |. You can do the same splitting in both separate sums again.
 
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.
 

Attachments

Similar threads

Back
Top