I want to plot the histogram and pdf of 2 X - 100
with X
a binomial distribution, but I'm having trouble with the pdf -- I just get a line y = 0
. I tried ploting a simple binomial distribution, but I don't get anything with that either and it takes so much time.
Li[n_] := 2*RandomVariate[BinomialDistribution[n, 1/2], n] - n;
Tb[n_, m_] := Table[Li[n], {i, 1, m}];
y = Tb[100, 1000];
Show[
Histogram[y, 40, "PDF"],
Plot[PDF[2*BinomialDistribution[100, 1/2] - 100, x], {x, -10, 10},
PlotStyle -> Thick]]
...2*BinomialDistribution[100, 1/2]-100...
as the argument toPDF
is nonsense. I suggest you avail yourself of the documentation to understand how to properly utilize the probability functions. $\endgroup$