% code to plot the continus pdf shown in lec 5 on September 9 2009
%  bar graphs
a = 6; b = 9;
ps = 0:.025:1;
ds = ps.^(a-1) .* (1-ps).^(b-1);
ds = ds / sum(ds);
bar(ps, ds, 'LineWidth', 2);
set(gca, 'FontSize', 18);
axis([-.03 1.03 0 0.4])

%  continuous density plot
[gxs, gys] = meshgrid(0:.05:1);
zs = exp(-5*(gxs-gys).^2);
zs = zs./sum(zs(:));
surfl(gxs, gys, zs*length(zs(:)));
set(gca, 'FontSize', 18);