A Bernoulli trial is one which has two possible outcomes, conventionally labeled "success" and "failure". If the probability of the outcome being a "success" is p then the probability of "failure" is 1 - p. A random variable is Bernoulli distributed, if it has possible values 0 and 1, where:
~X ( &Omega. ) _ = _ \{ 0 , 1 \} , _ P ( ~X = 1 ) _ = _ ~p , _ P ( ~X = 0 ) _ = _ 1 - ~p , _ [ 0 < ~p < 1 ]
P ( ~X = ~x ) _ = _ array{ _ ~p,if _ ~x = 1,"success"/ _ 1 - ~p,if _ ~x = 0,"failure"/ _ 0,otherwise}
E ~X _ = _ 1 ~p _ + _ 0 ( 1 - ~p ) _ = _ ~p
E ~X ^2 _ = _ 1^2 ~p _ + _ 0^2 ( 1 - ~p ) _ = _ ~p
var ~X _ = _ ~p - ~p^2 _ = _ ~p ( 1 - ~p )
Conduct ~n independent Bernoulli trials and count the number of successes. If we represent the result of one such sequence by a series of ~n zeroes and ones, zero for failure and one for success, then the probability of getting, say, the sequence _ 0, 1, 1, 0, ... 1, 0 _ will be _ (1-~p) # ~p # ~p # (1-~p) # ... # ~p # (1-~p).
If there are exactly ~x successes (i.e. ~n - ~x failures) this probability is _ ~p^~x (1 - ~p)^{~n - ~x} , _ irrespective of the exact position of the successes. _ How many sequences with exactly ~x successes are there? _ This is the same as the number of ways of choosing ~x objects out of ~n, i.e. _ ( ^~n_~x ) ways. _ So the probability of exactly ~x successes is
P ( ~X = ~x ) _ = _ comb{~n,~x} ~p^~x ( 1 - ~p )^{~n - ~x}
where
comb{~n,~x} _ = _ fract{~n#!,~x#! (~n - ~x)#!} _ = _ fract{~n (~n - 1) ... (~n - ~x + 1),~x (~x - 1) ... 1}
Note that there are ~x terms top and bottom.
[ Recall Binomial Theorem: _ ( ~a + ~b ) ^~n _ = _ &sum._0^~n ( ^~n_~i ) ~a^~i ~b^{~n - ~i} .]
The p.g.f. of the Binomial Distribution is given by
&Phi.( ~t ) _ = _ sum{comb{~n,~x} ~p ^~x ( 1 - ~p )^{~n - ~x} ~t ^~x,~x = 0,~n} _ = _ ( ~p~t + ( 1 - ~p ) ) ^~n
&Phi.'( ~t ) _ = _ ~n~p ( ~p~t + ( 1 - ~p ) ) ^{~n - 1}
&Phi.''( ~t ) _ = _ ~n(~n - 1)~p^2 ( ~p~t + ( 1 - ~p ) ) ^{~n - 2}
&Phi.'( 1 ) _ = _ ~n~p , _ _ _ _ &Phi.''( 1 ) _ = _ ~n(~n - 1)~p^2
E( ~X ) _ = _ ~n~p
var( ~X ) _ = _ ( ~n~p )^2 - ~n~p^2 + ~n~p - ( ~n~p )^2 _ = _ ~n~p( 1 - ~p )
E( ~X ) _ = _ ~n~p var( ~X ) _ = _ ~n~p( 1 - ~p ) |