Skip to main content

Bernoulli Distribution

Where do you meet this distribution?

  • Coin toss
  • 1-dim. random walk

Shape of Distribution

Basic Properties

  • A parameter pp is required.

    0<p<1 0<p<1
  • Discrete distribution defined at x=0,1x={0,1}

Probability

F(x)={0(x<0)1p(0<x<1)1(x1) F(x)=\begin{cases}0&(x<0)\\1-p&(0< x< 1)\\1&(x\geq 1)\end{cases}
  • Probability mass function

    f(x)={1p(x=0)p(x=1)f(x)=\begin{cases} 1-p&(x=0)\\p&(x=1)\end{cases}
  • How to compute these on Excel.

AB
1DataDescription
20Value for which you want the distribution
30.3Value of parameter p
4FormulaDescription (Result)
5=IF(A2<0,0,IF(A2<1, 1-A3, 1))Cumulative distribution function for the terms above
6=IF(A2=0,1-A3,A3)Probability mass function for the terms above

Characteristics

Mean -- Where is the "center" of the distribution? (Definition)

  • Mean of the distribution is given as pp

Standard Deviation -- How wide does the distribution spread? (Definition)

AB
1DataDescription
20.6Value of parameter p
3FormulaDescription (Result)
4=SQRT(A2*(1-A2))Variance of the distribution for the terms above

Skewness -- Which side is the distribution distorted into? (Definition)

  • Skewness

    12pp(1p)\frac{1-2p}{\sqrt{p(1-p)}}
  • How to compute this on Excel.

AB
1DataDescription
20.6Value of parameter p
3FormulaDescription (Result)
4=(1-2*A2)/(SQRT(A2*(1-A2))Skewness of the distribution for the terms above

Kurtosis -- Sharp or Dull, consequently Fat Tail or Thin Tail (Definition)

  • Kurtosis

    6p26p+1p(1p)\frac{6p^2-6p+1}{p(1-p)}
  • How to compute this on Excel

AB
1DataDescription
20.6Value of parameter p
3FormulaDescription (Result)
4=(6*A2^2-6*A2+1)/(A2*(1-A2))Kurtosis of the distribution for the terms above

Random Numbers

  • How to generate random numbers on Excel.
AB
1DataDescription
20.3Value of parameter p
3FormulaDescription (Result)
4=IF(NTRAND(100)<A2,0,1)100 Bernoulli deviates based on Mersenne-Twister algorithm for which the parameters above

Note The formula in the example must be entered as an array formula. After copying the example to a blank worksheet, select the range A4:A103 starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER.

NtRand Functions

Not supported yet

Reference