112k views
4 votes
Suppose a casino invents a new game that you must pay $250 to play. The game works like this: The casino drawsrandom numbers between 0 and 1from a uniform distribution. It adds them together until their sum is greater than 1, at which time it stops drawing new numbers. You get a payout of $100 each time a new number is drawn.For example, suppose the casino draws 0.4 and then 0.7. Since the sum is greater than 1, it will stop after these two draws, and you receive $200. If instead it draws 0.2, 0.3, 0.3, and then 0.6, it will stop after the fourth draw and you will receive $400. Given the $250 entrance fee, should you play the game?

User Radoulov
by
4.5k points

1 Answer

2 votes

Answer:

clc%clears screen

clear all%clears history

close all%closes all files

p=250;

M=[];

for i=1:100000

re=0;

S=0;

while(S<=1)

S=S+rand;

re=re+100;

end

M(i)=re;

end

disp('Expected received money is');

mean(M)

disp('Since expcted is greater than what we pay. So, we will play')

Explanation:

Suppose a casino invents a new game that you must pay $250 to play. The game works-example-1
User Mohamed Mansour
by
4.1k points