Cody

Solution 545599

Submitted on 13 Dec 2014 by daniel lamont
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% r1 = 2; b1 = 7; r2 = 5; b2 = 5; prob_correct = 0.2500; assert(isequal(probRedBall(r1,b1,r2,b2),prob_correct))

ans = 0.5000 10.0000 ans = 0.2500

2   Pass
%% r1 = 0; b1 = 5; r2 = 0; b2 = 5; prob_correct = 0.0000; assert(isequal(probRedBall(r1,b1,r2,b2),prob_correct))

ans = 0 6 ans = 0

3   Pass
%% r1 = 0; b1 = 3; r2 = 1; b2 = 3; prob_correct = 0.0625; assert(isequal(probRedBall(r1,b1,r2,b2),prob_correct))

ans = 0.2500 4.0000 ans = 0.0625

Suggested Problems