# Plotting the PDF of a Binomial distribution [closed]

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]]

• That's (among other things) because giving ...2*BinomialDistribution[100, 1/2]-100... as the argument to PDF is nonsense. I suggest you avail yourself of the documentation to understand how to properly utilize the probability functions.
– ciao
Oct 9 '15 at 8:15

As commented, you're not using the functions properly. I think what you're after is:

DiscretePlot[PDF[TransformedDistribution[2*z - 100,
z \[Distributed] BinomialDistribution[100, 1/2]], x], {x, -10, 10}] Note the use of DiscretePlot - the binomial is a discrete distribution, so a discrete plot is appropriate. You can cajole things to use Plot, but that's goofy IMO...

• @ciao...the quick or the dead...just deleting my response :) Oct 9 '15 at 8:21
• @ubpdqn: Lol, once again, you cause me to spit-laugh my tea onto my netbook. Cleaning now....
– ciao
Oct 9 '15 at 8:23
• "…but that's goofy…" - Hyuck! :) Oct 9 '15 at 9:31