Question
From MATLAB to Maple . You are offered the following game. A fair coin will be tossed until the first time it comes up heads.
From MATLAB to Maple. You are offered the following game. A fair coin will be tossed until the first time it comes up heads. If this occurs on the jth toss you are paid 2j dollars. You are sure to win at least 2 dollars so you should be willing to pay to play this game, but how much? Few people would pay as much as 10 dollars to play this game. See if you can decide, by simulation, a reasonable amount that you would be willing to pay, per game, if you will be allowed to make a large number of plays of the game. Does the amount that you would be willing to pay per game depend upon the number of plays that you will be allowed? I allready have this solution, but is written in MATLAB. Any help to write that in Maple? Thanks!
clc;clear all;close all; games=1000; pay=3;%payment per game for i=1:games j=1;%toss count while rand>0.5 %a tail turns up j=j+1; end win(i)=2^j-10; end plot(1:games,cumsum(win));grid; xlabel('games');ylabel('Cumulative winnings, 3 dollars paid for each game'); disp('very unpredictable game. pure chance');
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started