Cody

Solution 2258631

Submitted on 6 May 2020
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)

ans = 0

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

ans = 0.5000

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

ans = 50.0000

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

ans = 40.0000

Assertion failed.

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

ans = 162.4596

Assertion failed.

Suggested Problems

More from this Author9