% % Written by: % -- % John L. Weatherwax 2006-12-31 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- clc; close all; clear; V_0 = 1000; % probabilities and amount won in each case vs = [ -1, 0, +1, 1.5 ]; ps = [ 0.5 , 0.04, 0.45, 0.01 ]; % more likely that you will loose or draw on a given play ps = [ 0.45, 0.04, 0.5, 0.01 ]; % more likely that you will win on a given play Nts = 40; % a "large" fraction of our initial wealth to bet at the table each time: % sp_f_large = blackjack_winnings_sample_path(0.8, V_0,vs,ps, Nts); % a "small" fraction of our initial wealth to bet at the table each time: % sp_f_small = blackjack_winnings_sample_path(0.1, V_0,vs,ps, Nts); lb = plot( sp_f_large, '-r' ); hold on; sb = plot( sp_f_small, '-g' ); xlabel('timestep index'); ylabel('portfolio value'); legend( [lb,sb], {'larger bets','small bets'}, 'location', 'best' ); title('sample path of total portfolio value for different bet sizes'); %saveas(gcf,'../../WriteUp/Graphics/Chapter17/big_and_small_bets.eps', 'epsc');