Introduction of some distribution
random variable
probability density function
For continous variable x:
E(x)=∫xf(x)dx=∫xdF(x)
For discrete variable x:
E(x)=∑xipi
Variance:
Var(x)=E(x2)−(E(x))2
Binomial distribution
For example, flip a coin for 5 times, define random variable X as number of heads after 5 flips. The probability is defined as:
p(X=n)=n!(5−n)!5!=C5n
The general probability is
p(X=k)=k!(n−k)!n!=Cnk
And the
E(X)=np=k=0∑nkCnkpk(1−p)n−k
The term for k=0 is 0, hence it can be rewrite as
E(X)=k=1∑nkCnkpk(1−p)n−k
Then
E(x)=k=1∑nkk!(n−k)!n!pk(1−p)(n−k)=k=1∑nkk(k−1)!(n−k)!n(n−1)!ppk−1(1−p)(n−k)=npk=1∑n(k−1)!(n−k)!(n−1)!pk−1(1−p)(n−k)
Let a=k−1, b=n−1 ⇒k=a+1,n=b+1
E(x)=npk=1∑n(k−1)!(n−k)!(n−1)!pk−1(1−p)(n−k)=npa=0∑ba!(b−n)!b!pa(1−p)(b−a)
Where ∑a=0ba!(b−n)!b!pa(1−p)(b−a) is the sum of all the probabilities which equals to 1.
Hence the E(x) is np
Poisson distribution
For example, we want to know X = how many car pass in an hour. Assume the car is randomly pass on the road.
Say E(X)=λ=np, where λ has unit cars/hour ⇒60min/hour60λcars/min
Hence the probability can be written as whether there is a car pass in that minute which follows binomial distribution
p(X=k)=C60k(60λ)k(1−60λ)60−k
But the question is if there are more than 1 car pass in a minute, how do we deal with it? The most straight way is to set minutes into second
p(X=k)=C3600k(3600λ)k(1−3600λ)3600−k
As we know
x→inflim(1+xa)x=ea
The proof is let 1/n=a/x,x=na . Then rewrite as:
n→∞lim(1+n1)na=n→∞lim((1+n1)n)a=ea
Then as we increased n . The probability can be written as
p(X=k)=n→∞limCnk(nλ)k(1−nλ)n−k=n→∞lim(n−k)!k!n!nkλk(1−nλ)n(1−nλ)−k=n→∞lim(n−k)(n−k−1)...1n(n−1)...1k!λkn→∞lim(1−nλ)n(1−nλ)−k=n→∞lim(nk...)nk...k!λkn→∞lim(1−nλ)n(1−nλ)−k=1⋅k!λke−λ⋅1
Gamma Function
gamma function is to find the common function for factorial. 当x不为整数时,阶乘就只能靠gamma function.
Γ(x)=∫0+∞e−ttx−1dt(x>0)
For example
Γ(1)=∫0+∞e−tdt=−e−t∣0+∞=1
Also the Γ(1/2)=π
Beta Distribution
beta distribution 是定义在区间(0,1)的连续概率分布,with two parameter α and β, α,β>0
f(x;α,β)=∫01uα−1(1−u)β−1duxα−1(1−x)β−1=Γ(α)Γ(β)Γ(α+β)xα−1(1−x)β−1=B(α,β)1xα−1(1−x)β−1
Proof that
paper
B(a,b)=Γ(a+b)Γ(a)Γ(b)=∫01μa−1(1−μ)b−1dμ
approach 1:
Beta(μ∣a,b)=Γ(a)Γ(b)Γ(a+b)μa−1(1−μ)b−1
Γ(a)Γ(b)=∫0∞e−xxa−1dx∫0∞yb−1e−ydy
Let t=x+y, then dy=d(t−x)=dt
…
Approach 2:
…