My question for MATLAB is: A casino offers the following two similar games:
Game A:
You make your bet and start with one 1 point. The casino generates a random number between 0.527 and 1.527, and multiplies your points by that amount. The game ends after 10,000 rounds, after which, the casino pays you twice your bet if you have more than 1 point. Otherwise, you lose your bet.
Game B:
The same as game A except a random number is generated between 0.547 and 1.547.
You should adapt the previous examples of for-loops in order to code your own for-loop to answer the following question. Note that the rand function generates a random number between 0 and 1, hence
>> rand – 0.5
generates a random number between -0.5 and 0.5
What game(s) should you play to beat the casino?
I am confused because when I input rand – 0.527 it creates numbers less than .527. Would I need to input rand – 1.527?
Best Answer