Problem 133. Volume of this donut
Solution Stats
Problem Comments

9 Comments
I think the input are the radii, not the diameters, but I'm too lazy to check for sure.
not really, the test sequence is simply wrong.
I spend 20mn to understand that the data are inverted, thanks :
and also five minus it is not diameter but radii, a is outer radii and b the radii of the hole
It should be specified more clear what the input parameters mean exactly geometrically.
What a waste! Calling a radius a diameter. I got numbers that were off by a factor of 8, which turned out to be that I had used the information that a and b were diameters, whereas Bistwas used them as radii. Please correct the problem definition.
If a is the hole diameter and b is the outermost diameter, how can a>b in the test cases?
Problem is written incorrectly.
test suite'answer is wrong if a and b is diameter instead of radius.
Solution Comments

1 Comment
Very good.

1 Comment
Good question.

1 Comment
Volume should be y = pi^2/32*(a+b)i*(ba)^2

1 Comment
I wonder whether it it adequate to test correctness of double answers by equality. To do so discounts rounding errors and the fact that IEEE 754 does not guarantee the laws of arithmetic.

1 Comment
So, when you say "diameter" you mean "radius"? And when you say "outer" you mean "inner"?

1 Comment
If a is the hole diameter and b is the outermost diameter, how can a>b in the test cases?
Problem Recent Solvers170
Suggested Problems

155 Solvers

Cell Counting: How Many Draws?
918 Solvers

7617 Solvers

Vector of numbers divisible by 3
133 Solvers

678 Solvers
More from this Author100
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!