// Home / Documentation / Gallery of Distributions / Bernoulli Distribution

Bernoulli Distribution

Where do you meet this distribution?

  • Coin toss
  • 1-dim. random walk

Shape of Distribution

Basic Properties

  • A parameter p is required.
    0<p<1
  • Discrete distribution defined at x=\{0,1\}

Probability

  • Cumulative distribution function
    F(x)=\begin{cases}1-p\;&(x=0)\\1\;&(x=1)\end{cases}
  • Probability mass function
    f(x)=\begin{cases}1-p\;&(x=0)\\p\;&(x=1)\end{cases}
  • How to compute these on Excel.
     
    1
    2
    3
    4
    5
    6
    A B
    Data Description
    1 Value for which you want the distribution
    0.6 Value of parameter p
    Formula Description (Result)
    =IF(A2=0,1-A3,1) Cumulative distribution function for the terms above
    =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 p

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

  • Variance of the distribution
    p(1-p)

    Standard Deviation is a positive square root of Variance

  • How to compute this on Excel
     
    1
    2
    3
    4
    A B
    Data Description
    0.6 Value of parameter p
    Formula Description (Result)
    =SQRT(A2*(1-A2)) Variance of the distribution for the terms above

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

  • Skewness
    \frac{1-2p}{\sqrt{p(1-p)}}
  • How to compute this on Excel.
     
    1
    2
    3
    4
    A B
    Data Description
    0.6 Value of parameter p
    Formula Description (Result)
    =(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
    \frac{6p^2-6p+1}{p(1-p)}
  • How to compute this on Excel
     
    1
    2
    3
    4
    A B
    Data Description
    0.6 Value of parameter p
    Formula Description (Result)
    =(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.
     
    1
    2
    3
    4
       
    A B
    Data Description
    0.6 Value of parameter p
    Formula Description (Result)
    =IF(NTRAND(100)<1-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

 

Comments are closed.