function [tE] = chap_7_prob_48() % % Written by: % -- % John L. Weatherwax 2007-04-02 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- %-- % this is for part (c) only %-- % the "finite" expectation at the beginning % -- from the first four rolls where we DON'T roll a five: % fe = 1*(1/5) + 2*( 4/5 )*(1/5) + 3*( (4/5)^2 )*(1/5) + 4*( (4/5)^3 )*(1/5); % the probability of not rolling a six in the first four rolls: % pA = (4/5)^4; % the "infinite" expectation in the tail: % tailE = 0; for kk=6:1000 tailE = tailE + kk*( (5/6)^(kk-6) )*( 1/6 ); end tailE = pA*tailE; % the total expectation: % tE = fe + tailE;