Cody

Problem 2591. Does the coin touch the line?

Solution 510408

Submitted on 8 Oct 2014 by Alexandr Ozerov
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
%% d = 1; n=2; m=2; y_correct = 0.25; assert(isequal(your_fcn_name(d,n,m),y_correct))

y = 0.2500 y = 0.2500

2   Pass
%% d = 1; n=1; m=1; y_correct = 0; assert(isequal(your_fcn_name(d,n,m),y_correct))

y = 0 y = 0

3   Pass
%% d = 1; n=3; m=4; y_correct = 0.5; assert(isequal(your_fcn_name(d,n,m),y_correct))

y = 0.5000 y = 0.5000

4   Pass
%% d = 2; n=1; m=1; y_correct = 0; assert(isequal(your_fcn_name(d,n,m),y_correct))

y = 1 y = 0

5   Pass
%% d = 0.5; n=2; m=3; y_correct = 0.625; assert(isequal(your_fcn_name(d,n,m),y_correct))

y = 0.6250 y = 0.6250

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!