Jump to content

Summation notation


DarkWater

Recommended Posts

Well yeah... What I wrote is just oversimplified example. I have a feeling there might much more to it than just simple for() loop.

 

For example, what would be the format of $nExpression ?

 

Would it be like

 

$nExpression = "(1+(1/%N%))";

 

and then replace "%N%" with $i, parse and iterate?

Link to comment
https://forums.phpfreaks.com/topic/123856-summation-notation/#findComment-644133
Share on other sites

See, that's the problem.  It would use eval() like 4327908432190 times, lol.  That was an exaggeration.  Like, there are certain rules with summation notation to "simplify" things, like if you had:

 

sigma1ov9.png

 

You could really simplify it to:

 

sigma2jx0.png

 

And stuff like that makes it hard to get this to work. xD

 

Link to comment
https://forums.phpfreaks.com/topic/123856-summation-notation/#findComment-644155
Share on other sites

It really depends on the scope of the problems you're trying to solve. Obviously the advantage of a computer is that it is often acceptable to repeat the calculation many times, negating the need to find a way of simplifying the expression. On the other hand, it shouldn't be too hard to come up with something to simplify an expression given a relatively small size of potential expressions to solve.

Link to comment
https://forums.phpfreaks.com/topic/123856-summation-notation/#findComment-644585
Share on other sites

I am just developing a text based game for the learning experience during my free time. But I gave up on that piece of math and just created a table with all the number input>>outputs. made things so much more simple. This was only an option because they can't use a number higher than 100.

Link to comment
https://forums.phpfreaks.com/topic/123856-summation-notation/#findComment-644760
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.