Area Under Curves and Volume of Revolving a Curve Discussions | Functional Programming | HackerRank
We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Wolfram Alpha probably calcuates the exact value because this is a polynomial. It might use analytical methods or even numerical methods which are exact for polynomials (up to a certain degree). What we're asked to do here is specifically using the limit definition of integral.
The precision also matters, here we have to sum slices between 1.0 and 4.0 excluding the first slice (as in the link, i.e. summation from 1 to n), then we get 2435300.3.
By the way there seems to be a problem with the relative error. My Scala code passed all the tests but I couldn't make my Erlang code work after spending 1h, the results are definitely within the 0.01 relative margin but tests are failing.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Area Under Curves and Volume of Revolving a Curve
You are viewing a single comment's thread. Return to all comments →
Wolfram Alpha probably calcuates the exact value because this is a polynomial. It might use analytical methods or even numerical methods which are exact for polynomials (up to a certain degree). What we're asked to do here is specifically using the limit definition of integral.
The precision also matters, here we have to sum slices between 1.0 and 4.0 excluding the first slice (as in the link, i.e. summation from
1
ton
), then we get2435300.3
.By the way there seems to be a problem with the relative error. My Scala code passed all the tests but I couldn't make my Erlang code work after spending 1h, the results are definitely within the
0.01
relative margin but tests are failing.