Cody

Problem 44286. Compute average gain for some bets.

Solution 1284107

Submitted on 10 Oct 2017 by Daniel Pereira
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
odds = [1.1] ; bets= [100] ; avg_correct = -45.00; assert(isequal(avg_gain(odds,bets),avg_correct))

2   Pass
odds = [1.1 1.3 2.5] ; bets= [100 200 300] ; avg_correct = -40.00; assert(isequal(avg_gain(odds,bets),avg_correct))

3   Pass
odds = [1.33 1.3 2.5 5.13] ; bets= [100 200 300 10] ; avg_correct = -12.85; assert(isequal(avg_gain(odds,bets),avg_correct))

Suggested Problems

Community Treasure Hunt

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

Start Hunting!