function [] = chap_4_prob_33() % % 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. % %----- close all; b = 1:15; lb = length(b); % calculate the pdf we are integrating against: nRange = 0:10; px = binopdf( nRange, 10, 1/3 ); Ep = zeros(1,lb); for bi=1:lb, % calculate the function "min(n,b)": fb = min( nRange, b(bi) ); % compute the expected profit: Ep(bi) = -10*b(bi) + 15*dot( fb, px ); end figure; plot( b, Ep, '-o' ); %axis( [ 0 1 0 1.25 ] ); xlabel( 'b' ); ylabel( 'expected profit' ); grid on; %saveas( gcf, '../WriteUp/Graphics/chap_4_prob_33.eps', 'epsc' ); [epMax,epIndx] = max( Ep ); fprintf('The max expected profit is %f; by ordering b=%d papers\n',epMax,epIndx);