function [ sample_path ] = blackjack_winnings_sample_path(f, V_0,vs,ps, Nts) % % 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. % %----- sample_path = zeros(1,Nts+1); sample_path(1) = V_0; for ii=2:Nts+1, random_index = find( mnrnd( 1, ps, 1 ) ); random_draw = vs( random_index ); pct_win = (1+f*random_draw); sample_path(ii) = sample_path(ii-1) * pct_win; end