Bernoulli Distribution

Author

Eric W. Weisstein
May 6, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Statistics/BernoulliDistribution.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/BernoulliDistribution.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Stats`

Usage

?BernoulliDistribution

Stats

Stats[BernoulliDistribution[p],n]//StatsForm//TraditionalForm

CDF

Plot[CDF[BernoulliDistribution[.4],n],{n,-1,2},PlotStyle->Red]

CDF[BernoulliDistribution[p],1]

CDF[BernoulliDistribution[p],n]

PDF

PDF[BernoulliDistribution[p],n]

Mean

Sum[n PDF[BernoulliDistribution[p],n],{n,0,1}]

Variance

Simplify[Sum[(n-p)^2 PDF[BernoulliDistribution[p],n],{n,0,1}]]

Characteristic Function

<<Typesetting`

Simplify[CharacteristicFunction[BernoulliDistribution[p],t]]//TraditionalForm

Plot

<<Graphics`Graphics`;

BarChart[Table[PDF[BernoulliDistribution[.6],i],{i,0,1}],BarGroupSpacing->0,PlotRange->All,
AxesLabel->TraditionalForm/@{n,"\!\(\*
StyleBox[\"P\",\nFontSlant->\"Italic\"]\)(\!\(\*
StyleBox[\"n\",\nFontSlant->\"Italic\"]\)) for \!\(\*
StyleBox[\"p\",\nFontSlant->\"Italic\"]\)\!\(\*
StyleBox[\" \",\nFontSlant->\"Italic\"]\)= 0.6"},BarLabels->{0,1}]