#!/usr/bin/octave -q function h = hyst (bin) h = zeros (1, bin + 1); for x = 2:498 for y = x+1:500 r = floor (x * bin / y) + 1; h (r) = h (r) + 1; end end endfunction function h = hyst_r (bin) h = zeros (1, bin + 1); for x = 2:498 for y = x+1:500 xx = (x + (unidrnd (5) - 3) / 2); r = floor (xx * bin / y) + 1; h (r) = h (r) + 1; end end endfunction h1 = hyst (50); h2 = hyst (500); h3 = hyst (5000); h1_r = hyst_r (50); h2_r = hyst_r (500); h3_r = hyst_r (5000); hold on; subplot (3, 2, 1); plot (h1); subplot (3, 2, 3); plot (h2); subplot (3, 2, 5); plot (h3); subplot (3, 2, 2); plot (h1_r); subplot (3, 2, 4); plot (h2_r); subplot (3, 2, 6); plot (h3_r); drawnow; input ("...");