Problem 197. Recurrence relation
Solution Stats
Problem Comments
-
2 Comments
Maybe you should specify the required precision in the problem description.
OK, I added a sentence, thanks.
Solution Comments
-
1 Comment
different matlab fnction used to solve this problem
-
1 Comment
lol ! need a translator for this solution!
-
2 Comments
This solution should provide minimal rounding error since it's done in an essentially symbolic domain and then evaluated at the very end, but it doesn't satisfy the test cases. *sigh*
The sequence is strictly positive. (Not easy to see, but true). If your pn's get negative at some higher n, you still have the roundoff problem. It would be indeed avoided if the integer calculation within the loop was exact, but the numbers quickly become larger than the 48bit mantissa of a double.
Problem Recent Solvers26
Suggested Problems
-
Sort a list of complex numbers based on far they are from the origin.
5080 Solvers
-
Replace NaNs with the number that appears to its left in the row.
2586 Solvers
-
1165 Solvers
-
Back to basics 21 - Matrix replicating
1248 Solvers
-
Return unique values without sorting
822 Solvers
More from this Author7
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!