Problem 42820. jumping astronauts

Solution 1539104

Submitted on 24 May 2018 by J. S. Kowontan
  • Size: 27
  • This is the leading solution.
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
alpha=0; n=1; p=1; D_correct=0; assert(abs(jumping_astronauts(alpha,p,n)-D_correct)<0.01)

2   Pass
alpha=45; n=1; p=1; D_correct=0.5; assert(abs(jumping_astronauts(alpha,p,n)-D_correct)<0.01)

3   Pass
alpha=45; n=100; p=1; D_correct=50; assert(abs(jumping_astronauts(alpha,p,n)-D_correct)<0.01)

4   Pass
alpha=45; n=100; p=0.8; D_correct=3.32; assert(abs(jumping_astronauts(alpha,p,n)-D_correct)<0.01)

5   Pass
alpha=80; n=1000; p=0.95; D_correct=17.93; assert(abs(jumping_astronauts(alpha,p,n)-D_correct)<0.01)

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!