Ok if I take your approach, randomly generate 1 and 0, and would like to plot the histogram, what is the x-axis? y-axis should be the probability,right?
I use Matlab and run the following
clear;
x1=1:102;
y1 = binopdf(x1,102,0.2);
x2=1:102;
y2 = binopdf(x2,102,0.8)...