Cody

Problem 44288. Throwing Dice - Will You Be Eaten By The Dragon?

Solution 2792458

Submitted on 5 Aug 2020 by Dennis Gimlin
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
x = 6; y = 3; p_correct = 2/3; assert(isequal(survival(x,y),p_correct))

p = 0.6667

2   Pass
x = 15; y = 5; p_correct = 3/5; assert(isequal(survival(x,y),p_correct))

p = 0.6000

3   Pass
x = 30; y = 6; p_correct = 35/60; assert(isequal(survival(x,y),p_correct))

p = 0.5833

4   Pass
x = 4; y = 4; p_correct = 5/8; assert(isequal(survival(x,y),p_correct))

p = 0.6250

Suggested Problems

Community Treasure Hunt

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

Start Hunting!