[ RV ] 02. Random Variables

38A·2023년 9월 20일
1

확률변수론

목록 보기
2/2
post-thumbnail

Def: A "random variable" X(u)X(u) is a mapping from the sample space to the real line;
In other words, an assignment of a number to every possible outcome.
XX → real #
uu → sample point

  • Mathematically, a random variable is a function from the sample space UU to real numbers RR
    X(u)X(u) : uuRR
  • We can have several random variables defined on the same sample space
  • discrete RV / continuous RV
  • Ex_ XX (fif_i) = 10ii, in die experiment
    X \in { 10, 20, 30, 40, 50, 60 } ~ discrete RV
  • Ex_ UU=(0, 12], X(u)X(u)=u2u^2, XX \in (0, 144] ~ continuous RV

Probability mass function ( PMF )

PX(x)=P[X=x]P_X(x) = P[X = x]
XX → RV
xx → integer

Ex_ X(u)X(u) = { 10, 20, 30, 40, 50, 60 }
PX(10)P_X(10) = PX(20)P_X(20) = ... = PX(60)P_X(60) = 1/6

  • used for discrete RVs
  • PX(x)P_X(x) \ge 0, ΣxPX(x)\Sigma_xP_X(x) = 1

Ex_ Binomial random variable
X ~ number of heads in n independent coin tosses
PX(x)P_X(x) = (xn)px(1p)nx(^n_x)p^x(1-p)^{n-x} ~ " Binomial PMF "

Ex_ Geometric random variable
X ~ number of coin tosses until the first head
PX(x)P_X(x) = (1p)x1p(1-p)^{x-1}p

Probability density function ( PDF )

A continuous RV XX is described by a probability density function fX(x)f_X(x).
XX → RV
xx → Real #

  • fX(x)dx\int^{\infin}_{-\infin}f_X(x)dx = 1
  • abfX(x)dx\int^b_af_X(x)dx = P[a ≤ X ≤ b]
  • P(XB)P(X \in B) = BfX(x)dx\int_B f_X(x)dx
  • P(xxXXδ\delta) = xx+δfX(x)dx\int_x^{x+\delta}f_X(x)dx
    δ\delta is too small
    P(X=x)\approx P(X=x) fX(x)δ\approx f_X(x)*\delta = 0

Probability distribution function (Cumulative Distribution Function, CDF)

Def: FX(x)=P[Xx]=xfX(ζ)dζF_X(x) = P[X≤x] = \int^x_{-\infin}f_X(\zeta)d\zeta
ζ\zeta → dummy variable

fX(x)=ddxFX(x)f_X(x) = \frac{d}{dx}F_X(x)

Ex_ coin tossing
X(h)=1,X(t)=0X(h) = 1, X(t) = 0
PX(1)=PX(0)=1/2P_X(1) = P_X(0) = 1/2

Ex_ A bus arrives at random between (0, T)
X ~ time of arrival of the bus

Properties of probability distribution function (CDF)

  1. FX()=P[X]F_X(\infin) = P[X \le \infin] = 1
    FX()=P[X]F_X(-\infin) = P[X \le -\infin] = 0
  2. FX(x)F_X(x) is a non-decreasing(increasing) function of xx
    In other words, if x1<x2x_1 < x_2, then FX(x1)FX(x2)F_X(x_1) \le F_X(x_2)
  3. P[X>x]P[X>x] = 1FX(x)1-F_X(x)
  4. FX(x)F_X(x) is right-continuous
  5. P[x1<Xx2]P[x_1<X\le x_2] = FX(x2)FX(x1)F_X(x_2)-F_X(x_1),     x2>x1x_2>x_1
    proof.
    { Xx2X \le x_2 } = { x1<Xx2x_1 < X \le x_2 } \cup { Xx1X \le x_1 }
    P[Xx2]P[X \le x_2] = P[x1<Xx2]P[x_1 < X \le x_2] + P[Xx1]P[X \le x_1]
    FX(x2)F_X(x_2) = P[x1<Xx2]P[x_1 < X \le x_2] + FX(x1)F_X(x_1)
    P[x1<Xx2]=FX(x2)FX(x1)P[x_1 < X \le x_2] = F_X(x_2)-F_X(x_1)
  6. P[X=x]=P[x<Xx]P[X=x] = P[x^-<X\le x]
                         =FX(x)FX(x)= F_X(x)-F_X(x^-)

Note_
1. If FX(x)F_X(x) is continuous at x=x0x=x_0, then P[X=x0]=0P[X=x_0]=02. If FX(x)F_X(x) is descontinuous at x=x0x=x_0, then P[X=x0]=FX(x0)FX(x0)P[X=x_0]=F_X(x_0)-F_X(x_0^-)

Comment_
Probability distribution function provides a " complete Statistical description " of a RV.

Typical density functions

Uniform

Gaussian ( normal )

  • XX ~ NN(mm , σ2\sigma^2)

  • G(x)G(x) = x12πeζ2/2dζ\int^x_{-\infin}\frac{1}{\sqrt {2\pi}}e^{\zeta^2/2}d\zeta

  • Q(x)=1G(x)Q(x) = 1-G(x)
    Q(x)=1Q(x)=G(x)Q(-x) = 1-Q(x)=G(x)
    Ex_ fX(x)=18πe(x+3)2/8f_X(x)=\frac{1}{\sqrt {8\pi}}e^{-(x+3)^2/8}
    XX ~ (-3, 4)

  • P[X+3<2]=P[5<X<1]P[|X+3|<2] = P[-5<X<-1]
    = FX(1)FX(5)F_X(-1)-F_X(-5)
    = G(1+32)G(5+32)G(\frac{-1+3}{2})-G(\frac{-5+3}{2})
    = G(1)G(1)G(1)-G(-1)
    = G(1)1+G(1)G(1)-1+G(1)
    = 2G(1)12G(1)-1
    = 12Q(1)1-2Q(1)

Exponential

fX(x)=λeλx,x0f_X(x)=\lambda e^{-\lambda x},x\ge0
             =0=0, otherwise

FX(x)=0xλeλζdζF_X(x) = \int^x_0\lambda e^{-\lambda \zeta}d\zeta
              =[eλζ]0x= [-e^{-\lambda \zeta}]^x_0
              =1eλx,x0= 1-e^{-\lambda x}, x\ge0

Rayleigh

fX(x)=xσ2ex2/2σ2,x0f_X(x) = \frac{x}{\sigma^2}e^{-x^2/2\sigma^2}, x\ge0

Poisson

단위 시간 안에 어떤 사건이 몇 번 발생할 것인지를 표현

  • Discrete RV
  • Consider a random point experiment
  • PX(k)=(nk)pkqnkP_X(k) = (^k_n)p^kq^{n-k},         p=τTp=\frac{\tau}{T},         q=1τTq=1-\frac{\tau}{T}
  • Assume T → \infin, n → \infin, while n/T → λ\lambda

PX(k)eλτ(λτ)kk!P_X(k) \cong e^{-\lambda\tau}\frac{(\lambda\tau)^k}{k!}

  • Q: What is the density of distance between adjacent points?FY(y)=P[Yy]F_Y(y)=P[Y\le y]
    P[Y>y]=P[P[Y>y]=P[ no point in interval w / length y ]]
    1FY(y)=eλy,y01-F_Y(y)=e^{-\lambda y},y\ge0
    FY(y)=1eλy,y0\therefore F_Y(y) = 1-e^{-\lambda y}, y\ge0
        fY(y)=λeλy,y0f_Y(y) = \lambda e^{-\lambda y}, y\ge0

Expectation

Definition

  • For a discrete RV, E[X]=xxPX(x)E[X] = \sum_x xP_X(x)
    • Indicates the center of gravity of PMF
    • e.g. uniform RV
  • For a continuous. RV, E[X]=xfX(x)dxE[X]=\int^\infin_{-\infin}xf_X(x)dx
    • e.g. exponential RV

Expectation of a function of a RV

  • Let Y=g(X)Y=g(X), then then YY is also RV.
  • For a discrete RV, E[Y]=yyPY(y)=xg(x)PX(x)E[Y]=\sum_yyP_Y(y) = \sum_xg(x)P_X(x)
  • Similary, for a continuous RV, E[Y]=g(x)fX(x)dxE[Y]=\int^\infin_{-\infin}g(x)f_X(x)dx

Properties

  • E[]E[-] a is linear operator
  • E[aX]=aE[X]E[aX]=aE[X]
  • E[aX+b]=aE[X]+bE[aX+b]=aE[X]+b
  • In general, E[g(X)]g(E[X])E[g(X)]\neq g(E[X])
    • e.g. g(X)=x2g(X) = x^2, E[X2]E2[X]E[X^2]\neq E^2[X]

Variance

  • Var[X]=E[(Xmx)2]Var[X] = E[(X-m_x)^2]
                     =(xmx)2fX(x)dx= \int^\infin_{-\infin}(x-m_x)^2f_X(x)dx
  • σX2=E[X2]mx2\sigma^2_X = E[X^2]-m_x^2
  • σX=Var[X] \sigma_X = \sqrt {Var[X]} ~ ~ Standard deviation

Properties

  • Variance measures the deviation of X from its mean
  • Var[]Var[-] is NOT a linear operator
  • Var[aX+b]=Var[Y]Var[aX+b] = Var[Y]
                                =E[(Ymy)2]= E[(Y-m_y)^2]
                                =E[(aX+bamxb)2]= E[(aX+b-am_x-b)^2]
                                =E[a2(Xmx)2]= E[a^2(X-m_x)^2]
                                =a2Var[X]=a^2*Var[X]

Moments

The nthn^{th} moment of a RV XX : mn=E[Xn]=xnfX(x)dxm_n=E[X^n]=\int^\infin_{-\infin}x^nf_X(x)dx
     → e.g. m1=mxm_1=m_x
The nthn^{th} central moment of a RV XX : μn=E[(XmX)n]=(xmx)nfX(x)dx\mu_n=E[(X-m_X)^n]=\int^\infin_{-\infin}(x-m_x)^nf_X(x)dx
     → e.g. μ2=σx2\mu_2=\sigma_x^2

Ex_


Conditional PMF

PXA(xA)=P[X=xA]P_{X|A}(x|A)=P[X=x|A]

E[XA]=xxPXA(xA)E[X|A]=\sum_xx*P_{X|A}(x|A)

Conditional PDF & CDF

Conditional distribution FXA(xA)=P[XxA]F_{X|A}(x|A)=P[X\le x|A]
Conditional density fXA(xA)=ddxFXA(xA)f_{X|A}(x|A)=\frac{d}{dx}F_{X|A}(x|A)
E[XA]=xfXA(xA)dxE[X|A]=\int^\infin_{-\infin}x*f_{X|A}(x|A)dx


Total expectation theorem

  • Recall that P[B]=i=1nP[BAi]P[Ai]P[B] = \sum_{i=1}^nP[B|A_i]P[A_i]

    E[X]=i=1nEXAi(xAi)P[Ai]E[X]= \sum_{i=1}^n E_{X|A_i}(x|A_i)*P[A_i]

  • For a discrete RV X,
    • PX(x)=P[X=x]=i=1nPXAi(xAi)P[Ai]P_X(x) = P[X=x]=\sum_{i=1}^nP_{X|A_i}(x|A_i)P[A_i]
    • E[X]=xxPX(x)E[X]=\sum_xxP_X(x)
                  =i=1nxxPXAi(xAi)P[Ai]= \sum_{i=1}^n \sum_xxP_{X|A_i}(x|A_i)P[A_i]
                  =i=1nEXAi(xAi)P[Ai]= \sum_{i=1}^nE_{X|A_i}(x|A_i)*P[A_i]
  • Similary, for a continuous RV X,
    • fX(x)=i=1nfXAi(xAi)P[Ai]f_X(x)=\sum_{i=1}^nf_{X|A_i}(x|A_i)P[A_i]
    • E[X]=xfX(x)dxE[X]=\int^\infin_{-\infin}xf_X(x)dx
      =i=1nxfXAi(xAi)P[Ai]dx= \sum_{i=1}^n \int^\infin_{-\infin}xf_{X|A_i}(x|A_i)P[A_i]dx
      =i=1nEXAi(xAi)P[Ai]= \sum_{i=1}^n E_{X|A_i}(x|A_i)*P[A_i]
      ~ Total expectation
      ~ Expacted value of EXAi(xAi)E_{X|A_i}(x|A_i)

Memorylessness

Geometric RV

  • X ~ # of independent coin tosses until first head
  • PX(x)=(1p)x1pP_X(x) = (1-p)^{x-1}*p
  • A={X>2}A=\{X>2\}
  • PXA(xA)=P_{X|A}(x|A)= ?
  • Let Y=X2(Y>0)Y=X-2 (Y>0), then PY(y)=PX(y)P_Y(y)=P_X(y)
    • e.g. P[X=5X>2]=P[Y=3X>2]=P[X=3]P[X=5|X>2]=P[Y=3|X>2]=P[X=3]
    • Given that X>2X > 2, random variable Y=X2Y = X − 2 has the same geometric PMF as XX.
    • Hence, the geometric random variable is said to be memoryless, because the past has no bearing on its future behavior.

Exponential RV

  • X ~ exponential RV
  • fX(x)=λeλx,x>0f_X(x)=\lambda e^{-\lambda x}, x>0
  • A={X>2}A=\{X>2\}
  • fXA(xA)=λeλx/e2λ=λeλ(x2),x>2f_{X|A}(x|A)=\lambda e^{-\lambda x}/e^{-2\lambda}=\lambda e^{-\lambda(x-2)},x>2
  • Let Y=X2(Y>0)Y=X-2 (Y>0), then fY(y)=fX(y),y>0f_Y(y)=f_X(y), y>0
    • e.g. P[X5X>2]=P[Y3X>2]=P[X3]P[X\le5|X>2]=P[Y\le3|X>2]=P[X\le3]
    • Given that X>2X > 2, random variable Y=X2Y = X − 2 has the same exponential PDF as XX.
    • Hence, the exponential random variable is also memoryless.

Ex_


Total probability / Bayes' theorem (continuous ver.)

P[A]=P[AX=x]fX(x)P[A] = \int^\infin_{-\infin}P[A|X=x]f_X(x) ~ Total prob. theorem
fX(x)=P[AX=x]fX(x)P[A]=P[AX=x]fX(x)P[AX=x]fX(x)f_X(x)=\frac{P[A|X=x]f_X(x)}{P[A]}=\frac{P[A|X=x]f_X(x)}{\int^\infin_{-\infin}P[A|X=x]f_X(x)} ~ Bayes' theorem

Coin tossing example

P(head)=PP(head)=P, with fP(p)f_P(p), p[0,1]p\in[0,1]
Find P(head).

P(headP=x)=xP(head|P=x)=x
P(head)=01P(headP=x)fP(x)dxP(head)=\int^1_0P(head|P=x)f_P(x)dx
If PP is uniform on [0,1][0,1]
P(head)=01x1dx=1/2P(head)=\int^1_0x*1dx=1/2

HGU 전산전자공학부 이준용 교수님의 23-2 확률변수론 수업을 듣고 작성한 포스트이며, 첨부한 모든 사진은 교수님 수업 PPT의 사진 원본에 필기를 한 수정본입니다.

profile
HGU - 개인 공부 기록용 블로그

0개의 댓글