조조하사의 Gaming Nexus☆

[170202 Probability Theory] 2-1. Discrete Probability Distribution - Bernoulli Distribution / Binomial Distribution


<이산확률분포의 첫 번째, 베르누이 분포와 이항분포에 대한 설명과 정의>

The First of Discrete Probability Distribution, Explanation and Definition of Bernoulli/Binomial Distribution


베르누이 분포는 이항분포를 설명하고 나면 자동으로 설명된다. 이항분포는 고등학교에서도 배울 수 있는 간단한 분포로서, 성공확률 p인 시행을 독립적으로 n번 반복시행했을 때, 이 시행이 성공할 횟수(X)를 확률변수로 하는 이산확률분포.

확률질량함수는 위에 나와있는 바와 같다. 참고로 이산확률변수는 확률질량함수를, 연속확률변수는 확률밀도함수를 가짐을 참고하자.

그리고 베르누이 분포는 이항분포 중에서도, 1회만 시행하는 경우의 확률분포이다.

Bernoulli Distribution is specialization of Binomial Distribution. Binomial Distribution is what we study in high school mathematics. If we do a same, independent trial for n-times, with success probability p, then we can calculate the probability when x-times success(so ) with this discrete probability distribution.

is the probability mass function. I'll notice that every Discrete random variable has its probability mass function, and every Continuous random variable has its probability density function.

And, Bernoulli Distribution is, only one trial version of Binomial Distribution

<이항분포의 기댓값 계산. 으으...이 방법 찾느라 1시간을 고생했지>
Expectation of Binomial distribution. I burned an hour out for this proof

필기 시작한지 얼마 안되서 더러워 보일 듯. 아래 사진을 보면!

<눈치 빠른 사람은 보일듯. 이거 확률론 로드맵 적었던 종이...>
You got it? it's the paper you saw in 'Probability Theory Roadmap' posting lol


우선 설명에 앞서 모든 확률분포의 총합(이산:시그마, 연속:(-∞, ∞)구간 적분)은 1이라는 걸 알고 들어가자. 적률생성함수를 쓰지 않고 기댓값을 구하기 위해서는 이 내용을 꼭 알아야만 한다.

확률질량함수에 x를 곱하여 합을 구하면 기댓값(평균)을 구할 수 있다. 시그마는 곱을 보존하지 않기 때문에 시그마가 앞에 붙어있으면 이런 류의 계산은 난처해진다. 천천히 보자. 

nCx는 분모에 1부터 x개의 자연수를 곱하고, 분자에 n부터 역순으로 x개의 자연수를 곱하여 계산하는 방식이다. 이렇게 전개해놓으면 앞에 곱해진 x가 분모의 x와 사라져서 식이 깔끔해지긴 하는데...
분모의 숫자가 (x-1)개이고 분자의 숫자가 x개임을 발견하고 멍하게 한 20분 앉아있다가 끄적끄적하면서 발견한 풀이가 저거다.

n을 분자에서 하나 빼면 깔끔하게 을 만들 수 있고, 이제 p의 지수만 (x-1)로 맞춰주면 (1-p)의 지수는 n-x=(n-1)-(x-1)이므로 따로 맞춰줄 필요가 없어진다. 이제 빼냈던 상수들을 시그마 밖으로 빼내주면...

시그마 값은 시행횟수 n-1, 성공확률 p인 이항분포의 총합이 되므로 그 값은 1이다.(아니면 이항정리에 의해로 계산해도 무방하다.)
깔끔하게 np로 정리되어 나오는 결과.

대학과정에서 적분을 계산하다보면 심심하면 이런식으로 확률분포의 총합이 1임을 이용하더라는걸 떠올렸고, 확률함수를 익혀놓는게 해석학적으로도 중요한 것임을 통감하고 있음.

아, 참고로 베르누이 분포의 기댓값은 여기서 n=1 대입하면 끝.

All probability distribution's summation is 1(Discrete : ∑, Continuous : ∫). Without moment generating function, we should know that for the expectation of binomial distribution.

We can calculate the expectation with ∑xf(x). Because ∑ doesn't preserve multiplication, we should be careful during the calculation. Take it slow.

nCx is a combination. As you know, we calculate it with . multiplication of x numbers from 1 on denominator, and multiplication of x numbers from n by decreasing on numerator. Now we can deleting x on left side and denominator.
Now (x-1) numbers on denominator, x numbers on numerator. For about 20 mins, I couldn't anything. And finally I found it!

By taking n, it became . Now we made a formula before the last np.
The summation is 1, because it is a summation of the Binomial Dist. of n-times trial with success probability p.(or calculate 
 by Binomial Theorem)

I found that some integrals in college sometimes use these probability summations(1) and so I need memorize these probability mass/density functions.

And we can get the expectation of Bernoulli Dist. by substitute n=1 at this formula.


<마찬가지로 이항분포의 분산도 구해보았다. 더 복잡하다.>

By same method, I could calculate the Variance of Binomial Distribution. It's more complex.


이항분포의 기댓값을 구하고 나면 마찬가지 방법으로 간단히 분산을 구할 수 있을거라 생각했지만, 아이디어의 비약이 한 번 더 필요했다.(위에서 2번째 식.) x를 한 번 약분하고도 x가 하나 더 남았기 때문이다.
그렇지만 다행히도 이번엔 
충분히 워밍업이 되어 있어 비교적 단시간에 아이디어를 이끌어낼 수 있었다. x=n-(n-x)이므로 이걸 대입하면 왼쪽은 상수곱이므로 계산가능하고, 오른쪽은 n-x를 분자에 넣고 분자에 있던 n-1을 빼내는 것으로 형태를 맞춰줄 수 있었기 때문.

After calculate the expectation of Binomial Distribution, I thought I can also calculate the variance simply. But it was false.(2nd line formula) The reason is, after delete one x from left side and denominator, one more x remained.
Thanks for warming up, I found the idea for calculating after short time. Since x=n-(n-x), I substituted it and calculated left as expectation. On right side, I changed (n-x) and (n-1) in numerator.


<이제 마지막으로 적률생성함수를 구하면!>
Now finally we calculate Moment Generating Function.

적률 생성 함수는 로 표현되는 t에 대한 함수이다. 이름과 구조를 가만 바라봤을 때, 점 t을 기준(중심)으로 잡았을 때 좌우로 확률함수가 어떻게 분포해 있는가에 관한 값을 생성하는 함수인 것으로 생각했는데 맞는지는 모르겠고(170221, 지금에 와서는, 분명히 틀린 내용이라고 말할 수 있다.), 평균, 분산, 왜도, 첨도 등을 계산하기 위한 도구로 유용하게 쓰인다.(학부 과정에서 듣기로는.)

실제로 나는 편차의 거듭제곱의 평균, 변량의 거듭제곱의 평균을 구하는 데 이것만큼 좋은 게 없다고 생각한다. 각설하고,

이항분포의 적률생성함수는 사진에서 보는 바와 같이 간단하게 x를 지수로 하는 덩어리와 n-x를 지수로 하는 덩어리로 묶어 이항정리를 써주면 쉽게 구할 수 있다.

위의 두 식은 각각 적률생성함수를 이용하여 평균과 분산을 구하는 방법이다.
참고로 나는 위의 두 식을 처음 봤을 때 = (변량의 n제곱의 평균)이라는 생각을 했었는데, 맞는지는 모르겠고 틀린적은 없어서 계속 쓰고는 있다. ㅋㅋㅋㅋ 여튼 둘을 계산한 식으로 이번 포스팅을 마친다.

Moment Generating Function() is a function with respect to t. By staring its name and formula, I made an assumption that it is a function generating a value which shows how probability function is distributed with center x=t. For test it, enormous number of examples will necessary for me.(170221, It is false.)
After all, it is quite useful for calculating expectation, variance, skewness, kurtosis of probability functions.

I guess it is the best tool for calculating expectations of power of deviation and power of variable quantities.

Moment generating function of Binomial Dist. can be calculated easily. A team with their exponent x, other team with their exponent (n-x) and Binomial theorem are all tool for it.

Now these are the formula for Expectation and Variance with Moment generating function.
I thought that 
is the expectation of n-powers of variable quantities. But I don't know it perfectly. Just using lol

It's the end of this posting.