Problem 1909. Two fractions, one sum
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
Nick
on 3 Oct 2013
Although people have solved this already. I'm sure that there's an error in the 7th test suite.
two_fractions(10^7) = 113;
two_fractions(10^8) = 165;
two_fractions(two_fractions(10^7) + two_fractions(10^8)) ==> two_fractions(278) = 5 ==> not 14
James
on 3 Oct 2013
Nick, I see where your problem is: two_fractions(10^8) is not 165. You are running into rounding errors on some of your larger fractions.
Nick
on 3 Oct 2013
Ok Thanks. I'll have a look.
J.R.! Menzinger
on 21 Oct 2013
http://www.wolframalpha.com/input/?i=%28x%2By%29*5+%3D+x*y
Ramon Villamangca
on 12 Oct 2021
Nice problem!
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
-
3916 Solvers
-
Replace NaNs with the number that appears to its left in the row.
2770 Solvers
-
536 Solvers
-
675 Solvers
-
Create an index-powered vector
605 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!