# Histograms and probability distributions

Consider $50$ random variables with probability distribution:

$X∼Bin(20,.1)$, where $n=20$ and $p=.1$.

Now take a random sample of size $i; \ i=1,5,12,30,40$ from the 50 random variables and plot the histogram of such sample. Compare each of the 5 histograms.

What I've done so far :

data = RandomVariate[BinomialDistribution[20, 0.1], 20^4];

Show[Histogram[data, {1}, "PDF"],
DiscretePlot[PDF[BinomialDistribution[20, 0.1], x], {x, 0, 20},
PlotStyle -> PointSize[Medium]]]


which gives a single histogram for different values of r.v. X

My question is how to generate 50 of them and then how to take a random sample of size $i$ from them ?

• When you post something simultaneously on two forums you should show the link to the other forum. If you haven't mentioned that, then If someone answers or provides an informative comment on one forum, then you're wasting others' time on the other forum. stats.stackexchange.com/questions/346673/… – JimB May 17 '18 at 3:04

Check out RandomSample and RandomChoice