Info

This question is closed. Reopen it to edit or answer.

Please help in this question : How to change this sentence into mathematical terms.

1 view (last 30 days)
Suppose you are at a casino playing roulette and that you are betting on black to turn up. You start by betting $1. If you win you bet another $1 in the next game. If you lose you double your previous bet. You will stop playing once you have either lost more than $100 or won at least $10. Play the game 5000 times and record your performance.
Till now I've only got this, but i doubt its correct since i've only managed to identify the cases. :
x=ceil(37*rand); switch x case {15,4,2,17,6,13,11,8,10,24,33,20,31,22,29,28,35,26} disp('x is black') otherwise disp('x is red or green') end if y = strcat 'x is black'; y(1)=1; k=1:1:5000; y(2)=y(1)+1; end if 'x is black'; y(2)=2.*y(1); end

Answers (0)

Community Treasure Hunt

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

Start Hunting!