So what would the Cody size of a brute-force algorithm be for this problem?
I got the correct answers within 50*eps for all answers except x=0.001 for c. Is c_correct value correct for x=0.001? I put in a small correction factor 1.5e-14 to get your c_correct value.
It is possible to obtain the results for this series using Wolfram Alpha or Symbolic Math Toolbox. It is not a pretty result, but the series converges. Unless you are up to hard work, there is no point in finding this simplification manually. And the Taylor Series does not help.
Interesting, getting rough estimate is easy, but without further derivations, being close is hard.
Could this oscillatory behavior be dampened by filtering it for example?
this one is truely a wonderfun code! make my eyes open.
Mr Castanon is a true god. I preferred asking wolfram solver.
Wish I studied infinite series properly at school
Yes, you are right S L, a direct brute force summation is surely not the most efficient method of determining the sums of these series. You are the only one so far with a valid solution that met the 50*eps tests. In fact your answers are very much closer than that to mine, within a few eps. However, there is another single analytic function that can be used which is much simpler and would undoubtedly give you a lower "size" than 92 if you or others can find it. R. Stafford
thanks for the hint
Find state names that end with the letter A
Number of 1s in a binary string
middleAsColumn: Return all but first and last element as a column vector
Binary code (array)
Subdivide the Segment
Sum the Infinite Series II
Compute Area from Fixed Sum Cumulative Probability
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office