Re: binomial distribution
- To: mathgroup at smc.vnet.net
- Subject: [mg28026] Re: binomial distribution
- From: "Ian McInnes" <ian at whisper-wood.demon.co.uk>
- Date: Wed, 28 Mar 2001 02:40:58 -0500 (EST)
- References: <99pc8t$lar@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
To plot the discrete points from the PDF of the Binomial distribution, a list must first be created. For example, to create a list of the points for the Binomial distribution with sample size 10 and probability of success per trial 0.7: binpts = Table[PDF[BinomialDistribution[10, 0.7], x], {x, 0, 10}] (the domain of the pdf is 0 to n). There are numerous options for plotting these points. To generate a basic line graph (appropriate when the sample size is large), ListPlot may be used to plot it against the corresponding x-axis value points (these are integers in the range 0 to n). Transpose is used to convert the two lists into x, y pairs as required by ListPlot: ListPlot[Transpose[{Range[0, 10], binpts}], PlotJoined->True]; This gives a plot with the individual points joined up - refer to the help for other display options. For fairly small sample sizes, a histogram would be better: <<Graphics`Graphics` Histogram[binpts, FrequencyData->True]; There are numerous graphics options and other possible graph types (e.g. BarChart) that may be worth looking at. Regards, Ian McInnes. "Kush Passi" <kpassi at mum.edu> wrote in message news:99pc8t$lar at smc.vnet.net... > hello, > > i have been using the binomial distribution function in the statistics > packages and I wonder if there is a way to graph the binomial distribution > when the same size and the probability of a success is known. > > *** Kush > >