### Random Variable

- 整體狀況/母體 (population)
- 通常以pmf (probability mass function，離散型隨機變數); pdf (probability density function，連續型隨機變數) 來刻畫一個可以無限取樣的母體
- pmf/pdf 可理解為一個經標準化（面積為1）樣本無限大的長條圖（histogram）

### Demo

### Exercises/Play

- Find out the binomial random number related R commands.
- Prepare a 2×2 window for the following graphs of X, a Binomial(n,p) random variable . For a given (n, p),
- Plot pmf. Recall E(X)=np, Var(X)=npq
- Plot a histogram of 10 sample from X. Compute the sample mean () and sample variance
- Plot a histogram of 100 sample. Compute the sample mean and sample variance.
- Plot a histogram of 1000 sample. Compute the sample mean and sample variance.

- Keep the plotted window, open another window and redo the steps in 2. Compare the results.
**What do you observe? Does this make sense to you?**

Hint codes: g4hint.r

Advertisements