正式定义
直观上,随机变量为一种特殊的实函数,其值不大于某数的状况都是事件 。所以一个函数是不是随机变量也跟“怎样的子集合 算事件”有密不可分的关系。
如果随机变量
X
{\displaystyle X}
的取值是有限的或者是可数 无穷尽的值:
X
(
S
)
=
{
x
1
,
x
2
,
x
3
,
…
,
}
≅
N
{\displaystyle X(S)=\{x_{1},x_{2},x_{3},\ldots ,\}\cong \mathbb {N} }
则称
X
{\displaystyle X}
为离散 随机变量。如果
X
{\displaystyle X}
的取值遍布一区间甚至是整个数线:(
a
,
b
∈
R
{\displaystyle a,\,b\in \mathbb {R} }
)
X
(
S
)
=
[
a
,
b
]
{\displaystyle X(S)=[a,\,b]}
则称
X
{\displaystyle X}
为连续 随机变量。
与可测函数的关系
如果取
I
{\displaystyle {\mathcal {I))}
为所有实开区间 所构成的集合:
I
=
{
A
∈
P
(
R
)
|
(
∃
a
)
(
∃
b
)
[
(
a
,
b
∈
R
)
∧
(
A
=
(
a
,
b
)
)
]
}
{\displaystyle {\mathcal {I))={\bigg \{}A\in {\mathcal {P))(\mathbb {R} )\,{\bigg |}\,(\exists a)(\exists b)\left[\,(a,\,b\in \mathbb {R} )\wedge (A=(a,\,b))\,\right]{\bigg \))}
则可以把博雷尔代数
B
{\displaystyle {\mathcal {B))}
定义为包含
I
{\displaystyle {\mathcal {I))}
的最小Σ-代数 :
B
:=
σ
(
I
)
=
⋂
{
Σ
|
(
Σ
is a sigma algebra.
)
∧
(
I
⊆
Σ
)
}
{\displaystyle {\mathcal {B)):=\sigma ({\mathcal {I)))=\bigcap {\bigg \{}\Sigma \,{\bigg |}\,(\Sigma {\text{ is a sigma algebra.)))\wedge ({\mathcal {I))\subseteq \Sigma ){\bigg \))}
则根据阿基米德性质 ,对任意实数
r
∈
R
{\displaystyle r\in \mathbb {R} }
,
(
−
∞
,
r
]
∈
B
{\displaystyle (-\infty ,\,r]\in {\mathcal {B))}
,有以下的关系:
(
r
,
∞
)
=
⋃
{
A
∈
I
|
(
∃
n
∈
N
)
[
A
=
(
r
,
n
)
]
}
{\displaystyle (r,\,\infty )=\bigcup \left\{A\in {\mathcal {I))\,{\bigg |}\,(\exists n\in \mathbb {N} )\left[A=(r,\,n)\right]\right\))
(
−
∞
,
r
]
=
R
−
(
r
,
∞
)
{\displaystyle (-\infty ,\,r]=\mathbb {R} -(r,\,\infty )}
反之,也可以用类似的方法,由任意的
(
−
∞
,
r
]
{\displaystyle (-\infty ,\,r]}
,透过并集 和补集 组合出
(
a
,
b
)
{\displaystyle (a,\,b)}
:
(
−
∞
,
b
)
=
⋃
{
A
∈
P
(
R
)
|
(
∃
n
∈
N
)
[
A
=
(
−
∞
,
b
−
1
n
]
]
}
{\displaystyle (-\infty ,\,b)=\bigcup \left\{A\in {\mathcal {P))(\mathbb {R} )\,{\bigg |}\,(\exists n\in \mathbb {N} )\left[A=(-\infty ,\,b-{\frac {1}{n))]\right]\right\))
(
a
,
b
)
=
(
R
−
(
−
∞
,
a
]
)
∪
(
−
∞
,
b
)
{\displaystyle (a,\,b)=\left(\mathbb {R} -(-\infty ,\,a]\right)\cup (-\infty ,b)}
这样的话,任意的
r
∈
R
{\displaystyle r\in \mathbb {R} }
都有
{
s
∈
S
|
X
(
s
)
≤
r
}
∈
E
{\displaystyle \{s\in S\,|\,X(s)\leq r\}\in {\mathcal {E))}
,等价于对任意的
a
,
b
∈
R
{\displaystyle a,\,b\in \mathbb {R} }
都有
{
s
∈
S
|
a
<
X
(
s
)
<
b
}
∈
E
{\displaystyle \{s\in S\,|\,a<X(s)<b\}\in {\mathcal {E))}
,这样根据可测函数性质 的定理(2),上小节定义的
X
{\displaystyle X}
,就是一个
E
{\displaystyle {\mathcal {E))}
-
B
{\displaystyle {\mathcal {B))}
可测函数 ,换句话说,随机变量是可测函数的一种特例 。
示例
实数坐标轴上的随机变量示意图 随机掷两个骰子,整个样本空间 由36个元素组成:
S
=
{
(
i
,
j
)
∈
N
2
|
(
i
≤
6
)
∧
(
j
≤
6
)
}
{\displaystyle S=\left\{(i,j)\in \mathbb {N} ^{2}|(i\leq 6)\wedge (j\leq 6)\right\))
然后可以简单地把
S
{\displaystyle S}
的任意子集合 都视为事件,换句话说,把事件族
E
{\displaystyle {\mathcal {E))}
取成
S
{\displaystyle S}
的幂集 :
E
=
P
(
S
)
{\displaystyle {\mathcal {E))={\mathcal {P))(S)}
这样的话,可以构造出许多定义在
S
{\displaystyle S}
上的随机变量,比如
X
{\displaystyle X}
可以定义为“两个骰子的点数和”;者
Y
{\displaystyle Y}
可以定义为“两个骰子的点数差”:
X
(
i
,
j
)
:=
i
+
j
{\displaystyle X(i,j):=i+j}
Y
(
i
,
j
)
:=
|
i
−
j
|
{\displaystyle Y(i,j):=|i-j|}
因为“两个骰子的点数和不大于
r
{\displaystyle r}
”和“两个骰子的点数差不大于
r
{\displaystyle r}
”的样本点所构成的集合,都是
S
{\displaystyle S}
的子集合 ,所以
X
{\displaystyle X}
和
Y
{\displaystyle Y}
都是(在
E
=
P
(
S
)
{\displaystyle {\mathcal {E))={\mathcal {P))(S)}
的意义下)定义在
S
{\displaystyle S}
上的随机变量,而且它们都是离散随机变量。
详细分析
表示方法
随机试验结果的量的表示。例如掷一颗骰子出现的点数,电话交换台在一定时间内收到的调用次数,随机抽查的一个人的身高,悬浮在液体中的微粒沿某一方向的位移,等等,都是随机变量的实例 。
一个随机试验的可能结果(称为基本事件)的全体组成一个基本空间
Ω
{\displaystyle \Omega }
(见概率)。随机变量
X
{\displaystyle X}
是定义于
Ω
{\displaystyle \Omega }
上的函数,即对每一基本事件
ω
∈
Ω
{\displaystyle \omega \in \Omega }
,有一数值
X
(
ω
)
{\displaystyle X(\omega )}
与之对应。以掷一颗骰子的随机试验为例,它的所有可能结果,共6个,分别记作
ω
1
{\displaystyle \omega _{1))
,
ω
2
{\displaystyle \omega _{2))
,
ω
3
{\displaystyle \omega _{3))
,
ω
4
{\displaystyle \omega _{4))
,
ω
5
{\displaystyle \omega _{5))
,
ω
6
{\displaystyle \omega _{6))
,这时,
Ω
=
{
ω
1
,
ω
2
,
ω
3
,
ω
4
,
ω
5
,
ω
6
}
{\displaystyle \Omega =\{\omega _{1},\omega _{2},\omega _{3},\omega _{4},\omega _{5},\omega _{6}\))
,而出现的点数这个随机变量
X
{\displaystyle X}
,就是
Ω
{\displaystyle \Omega }
上的函数
X
(
ω
k
)
=
k
{\displaystyle X(\omega k)=k}
,
k
=
1
,
2
,
…
,
6
{\displaystyle k=1,2,\ldots ,6}
。又如设
Ω
=
{
ω
1
,
ω
2
,
…
,
ω
n
}
{\displaystyle \Omega =\{\omega _{1},\omega _{2},\ldots ,\omega _{n}\))
是要进行抽查的
n
{\displaystyle n}
个人的全体,那么随意抽查其中一人的身高和体重,就构成两个随机变量
X
{\displaystyle X}
和
Y
{\displaystyle Y}
,它们分别是
Ω
{\displaystyle \Omega }
上的函数:
X
(
ω
k
)
=
{\displaystyle X(\omega k)=}
“
ω
k
{\displaystyle \omega k}
的身高”,
Y
(
ω
k
)
=
{\displaystyle Y(\omega k)=}
“
ω
k
{\displaystyle \omega k}
的体重”,
k
=
1
,
2
,
…
,
n
{\displaystyle k=1,2,\ldots ,n}
。一般说来,一个随机变量所取的值可以是离散的(如掷一颗骰子的点数只取1到6的整数,电话台收到的调用次数只取非负整数),也可以充满一个数值区间,或整个实数轴(如液体中悬浮的微粒沿某一方向的位移)。
研究方法
在研究随机变量的性质时,确定和计算它取某个数值或落入某个数值区间内的概率是特别重要的。因此,随机变量取某个数值或落入某个数值区间这样的基本事件的集合,应当属于所考虑的事件域。根据这样的直观想法,利用概率论公理化的语言,取实数值的随机变量的数学定义可确切地表述如下:概率空间
(
Ω
,
F
,
p
)
{\displaystyle (\Omega ,F,p)}
上的随机变量
X
{\displaystyle X}
是定义于
Ω
{\displaystyle \Omega }
上的实值可测函数,即对任意
ω
∈
Ω
{\displaystyle \omega \in \Omega }
,
X
(
ω
)
{\displaystyle X(\omega )}
为实数,且对任意实数
x
{\displaystyle x}
,使
X
(
ω
)
≤
x
{\displaystyle X(\omega )\leq x}
的一切
ω
{\displaystyle \omega }
组成的
Ω
{\displaystyle \Omega }
的子集
{
ω
:
X
(
ω
)
≤
x
}
{\displaystyle \{\omega :X(\omega )\leq x\))
是事件,也即是
F
{\displaystyle F}
中的元素。事件
{
ω
:
X
(
ω
)
≤
x
}
{\displaystyle \{\omega :X(\omega )\leq x\))
常简记作
{
X
≤
x
}
{\displaystyle \{X\leq x\))
,并称函数
F
(
x
)
=
p
(
X
≤
x
)
{\displaystyle F(x)=p(X\leq x)}
,
−
∞
<
x
<
∞
{\displaystyle -\infty <x<\infty }
,为
X
{\displaystyle X}
的分布函数。
设
X
{\displaystyle X}
,
Y
{\displaystyle Y}
是概率空间
(
Ω
,
F
,
p
)
{\displaystyle (\Omega ,F,p)}
上的两个随机变量,如果除去一个零概率事件外,
X
(
ω
)
{\displaystyle X(\omega )}
与
Y
(
ω
)
{\displaystyle Y(\omega )}
相同,则称
X
=
Y
{\displaystyle X=Y}
以概率1成立,也记作
p
(
X
=
Y
)
=
1
{\displaystyle p(X=Y)=1}
或
X
=
Y
{\displaystyle X=Y}
,α.s.(α.s.意即几乎必然)。
有些随机现象需要同时用多个随机变量来描述。例如对地面目标射击,弹着点的位置需要两个坐标 才能确定,因此研究它要同时考虑两个随机变量,一般称同一概率空间
(
Ω
,
F
,
p
)
{\displaystyle (\Omega ,F,p)}
上的
n
{\displaystyle n}
个随机变量构成的
n
{\displaystyle n}
维向量
X
=
(
x
1
,
x
2
,
…
,
x
n
)
{\displaystyle X=(x_{1},x_{2},\ldots ,x_{n})}
为
n
{\displaystyle n}
维随机向量。随机变量可以看作一维 随机向量。称
n
{\displaystyle n}
元
x
1
,
x
2
,
…
,
x
n
{\displaystyle x_{1},x_{2},\ldots ,x_{n))
的函数为
X
{\displaystyle X}
的(联合)分布函数。又如果
(
x
1
,
x
2
)
{\displaystyle (x_{1},x_{2})}
为二维随机向量,则称
x
1
+
i
x
2
(
i
2
=
−
1
)
{\displaystyle x_{1}+ix_{2}(i^{2}=-1)}
为复随机变量。
随机变量的独立性 独立性是概率论所独有的一个重要概念。设
x
1
,
x
2
,
…
,
x
n
{\displaystyle x_{1},x_{2},\ldots ,x_{n))
是
n
{\displaystyle n}
个随机变量,如果对任何
n
{\displaystyle n}
个实数
x
1
,
x
2
,
…
,
x
n
{\displaystyle x_{1},x_{2},\ldots ,x_{n))
都有 即它们的联合分布函数
F
(
x
1
,
x
2
,
…
,
x
n
)
{\displaystyle F(x_{1},x_{2},\ldots ,x_{n})}
等于它们各自的分布函数
F
1
(
x
1
)
,
F
2
(
x
2
)
,
…
,
F
n
(
x
n
)
{\displaystyle F1(x_{1}),F2(x_{2}),\ldots ,Fn(x_{n})}
的乘积。则称
x
1
,
x
2
,
…
,
x
n
{\displaystyle x_{1},x_{2},\ldots ,x_{n))
是独立的。这一定义可以直接推广到每一
x
k
{\displaystyle xk}
(
k
=
1
,
2
,
…
,
n
{\displaystyle k=1,2,\ldots ,n}
)是随机向量的情形。独立性的直观意义是:
x
1
,
x
2
,
…
,
x
n
{\displaystyle x_{1},x_{2},\ldots ,x_{n))
中的任何一个取值的概率规律,并不随其中的其他随机变量取什么值而改变。在实际问题中通常用它来表征多个独立操作的随机试验结果或多种有独立来源的随机因素的概率特性,因此它对于概率统计的应用是十分重要的。
从随机变量(或向量)
x
1
,
x
2
,
…
,
x
n
{\displaystyle x_{1},x_{2},\ldots ,x_{n))
的独立性还可以推出:设
B
k
{\displaystyle Bk}
是
x
k
{\displaystyle xk}
取值的空间中的任意波莱尔集 ,
k
=
1
,
2
,
…
,
n
{\displaystyle k=1,2,\ldots ,n}
。设
x
1
,
x
2
,
…
,
x
n
{\displaystyle x_{1},x_{2},\ldots ,x_{n))
是独立的,则它们中的任意个都是独立的。但逆之即使其中任何
n
−
1
{\displaystyle n-1}
个是独立的,也不保证
x
1
,
x
2
,
…
,
x
n
{\displaystyle x_{1},x_{2},\ldots ,x_{n))
是独立的。又如果
f
j
(
x
)
,
i
=
1
,
2
,
…
,
n
{\displaystyle fj(x),i=1,2,\ldots ,n}
,是
n
{\displaystyle n}
个连续函数 或初等函数 (或更一般的波莱尔可测函数 ),则从
x
1
,
x
2
,
…
,
x
n
{\displaystyle x_{1},x_{2},\ldots ,x_{n))
的独立性可推出
f
1
(
x
1
)
,
f
2
(
x
2
)
,
…
,
f
n
(
x
n
)
{\displaystyle f1(x_{1}),f2(x_{2}),\ldots ,fn(x_{n})}
也独立。如果随机变量(随机向量)序列
x
1
,
x
2
,
…
,
x
n
,
…
{\displaystyle x_{1},x_{2},\ldots ,x_{n},\ldots }
中任何有限个都独立,则称之为独立随机变量(随机向量)序列。
关于随机变量的矩、特征函数 、母函数 及半不变量,分别见数学期望 、方差 、矩 及概率分布 。