# 概率论04 随机变量 – Vamei

（数学家）感到害怕做一名创造者很难。

### 团圆随机变量

$$\Omega = \{ HH, HT, TH, TT \}$$

$$P(X=2) = 5$$

$$P(X=1) =$$

$$P(X=0) = 5$$

[$P(X=x)$]表现了随机变量在形形色色的取值下的概率，称为概率品质行使职责（PMF, probability mass 功用）。笔者将牧座代表概率散布的剩余部分办法。。

### 积聚散布行使职责

$$F(x) = P(X \le x), ∞ < x < ∞$$

# By Vamei
# Plot the CDF of total number of heads in two flipsimport matplotlib.pyplot as plt
x = [-1, 0, 0, 1, 1, 2, 2, 3]
y = [0, 0, 5, 5, 0.75, 0.75, 1.0, 1.0]

fig = ()
ax  = (111)

(x, y)
([-0.1, ])
()

### 陆续随机变量

$$F(x) = P(X \le x), – ∞ < x < ∞$$

$$F(x) = 0, x < 0$$

$$F(x) = x, 0 \le x \le 1$$

$$F(x) = 1, x > 1$$

$$f(x) = \frac{dF(x)}{dx}$$

$$F(x) = \int_{∞}^x f(u)du$$

$$\int_{∞}^{+∞} f(u)du = 1$$

$$f(x) = \left\{ \begin{array}{l} 1, 0 \leq x \leq 1 \\ 0, x<0 \, or \, x>1 \end{array}\right.$$

# By Vamei# Density function for uniform distribution

import matplotlib.pyplot as plt
x = [-1, 0, 0, 1, 1, 2]
y = [0, 0, 1, 1, 0, 0]

fig = ()
ax = (111)

(x, y)
([-1, 2])
([-0.1, ])
("density function for uniform distribution")
()