This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: end %% histograms: part d - dependence total1 = zeros(1,10000); total2 = zeros(1,10000); T = 10; for i = 1:10000; clk = 0; count1 = 0; count2 = 0; r= 2; p = .5; while clk < T; interarrivals = -1/r*log(1-rand); type = rand; if type<p; r = .95*r; p = 1.02*p; count1 = count1 + 1; elseif type>p; r = 1.02*r; p = .98*p; count2 = count2 + 1; end clk = clk + interarrivals; end total1(i) = count1; total2(i) = count2; end figure(5) hist(total1,100); figure(6) hist(total2,100); mean_N1 = mean(total1); mean_N2 = mean(total2); sd_N1 = std(total1); sd_N2 = std(total2); fprintf( 'Stats for N1:\n mean: %f \n sd: %f \n\n' ,mean_N1,sd_N1) fprintf( 'Stats for N2:\n mean: %f \n sd: %f \n' ,mean_N2, sd_N2) end...
View Full Document
This note was uploaded on 03/17/2011 for the course IEOR 161 taught by Professor Lim during the Spring '08 term at University of California, Berkeley.
- Spring '08
- Operations Research