---
# System prepended metadata

title: Order Statstic專題
tags: [統研所考試, 機率數統]

---

# Order Statstic專題
###### tags: `統研所考試`、`機率數統`
所有Order Statstic的問題跟東西都放這。
-![](https://hackmd.io/_uploads/ByOJjzPvh.png)
--

## 定義
denoted by $X_{(1)},...,X_{(n)}$，其中$X_{(1)}$最小；$X_{(n)}$最大。

有些課本會寫成$Y_1...Y_n$表示有transfor過。

## $X_{(1)}～X_{(n)}$之joint pdf
$f(x_{(1)}...x_{(n)})=n!\prod \limits_{i=1}^nf(x_{(i)}) ,-\infty<x_{(1)}<x_{(2)}<....<x_{(n)}<\infty$

如果題目要求$X_{(i)}$的pdf，或是$X_{(i)}$與$X_{(j)}$的 Joint pdf，可以直接用求Maginal pdf的方式，直接把不要的東西通通積掉。但是題目的樣本數如果太大，就需要用底下的公式解。

## kth order statistics($X_{(k)}$)的pdf
$g_k(x_{(k)})= \frac {n!}{(k-1)!(n-k)!}[F(x_{(k)}]^{k-1}[1-F(x_{(k)}]^{n-k}f(x_{(k)}),　a<x_{(k)}<b$ and 0 otherwise.

**Example.**
$X_{(1)}$之pdf為：
$g_1(x_{(1)})=n[1-F(x_{(1)})]^{n-1}f(x_{(1)}),　a<x_{(1)}<b$
$X_{(n)}$之pdf為：
$g_n(x_{(n)})=n[F(x_{(n)})]^{n-1}f(x_{(n)}),　a<x_{(n)}<b$

## joint pdf的公式解
$f(x_{i},x_{j})=\frac{n!}{(i-1)!(j-i-1)!(n-j)!}[F(x_{(i)})]^{i-1}[F(x_{(j)})-F(x_{(i)})]^{j-i-1}[1-F(x_{(j)})]^{n-j}$

### 三個變數的joini pdf
![](https://hackmd.io/_uploads/rkT7Q6nbp.jpg)
 
 

## cdf
以$x_{(1)}$為例，$x_{(1)}$之CDF記為$G_1(x_{(1)})$
$G_1(x_{(1)})=P[X_{(1)\le x_{(1)}}]$
$=1-P[X_{(1)}>x_{(1)}]$
$=1-P[ all　X_{i}>x_{(1)}]$
$=1-[1-F(x_{(1)})]^n$

如果是最大的$x_{(n)}$，其CDF $G_n(x_{(n)})$為：
$G_n(x_{(n)})=P[X_{(n)\le x_{(n)}}]$
$=1-P[ all　X_{i}\le x_{(n)}]$
$=[F(x_{(n)})]^n$

隨便一個CDF則是：
$G_k(x_{(k)})=\sum\limits_{j=k}^{n}\binom {n}{j}[F(x_{(k)})]^j[1-F(x_{(k)})]^{n-j}$

另一本課本的寫法
![](https://hackmd.io/_uploads/Bk12dd5t3.jpg)


## Uniform order statistic pdf
>Uniform Order Statistic可以變成Beta分布

Let $X_1...X_n \overset {i.i.d} ～ U(0,1)$，排序後的PDF為
$f{(X_{(j)})} = \frac {n!}{(j-1)!(n-j)!} x^{j-1}(1-x)^{n-j}　for　x \in (0,1)$
$= \frac {Γ(n+1)}{Γ(j)Γ(n-j-1)}x^{(j-1)}(1-x)^{(n-j+1)-1}　～　Beta(j, n-j+1)$

神奇，太神奇惹。這個性質可以讓我們快速求出$E(X_{(j)})=\frac{j}{n+1},　VAR(X_{(j)})=\frac{j(n-j+1)}{(n+1)^2(n+2)}$ 在要求converge in probability的題目裡有用。

不過這裡只有Uniform Order Statistic會這樣，一般的在下面。

## uniform order statistics 的其他特性
1. $X_{(1)}~Beta(1,n)$
2. $X_{(n)}~Beta(n,1)$
covariance
https://math.stackexchange.com/questions/400677/covariance-of-order-statistics-uniform-case

## order statistics的$X_{(i)},X_{(n)}$之joint pdf


$g_{ij}(x_{(i)},x_{(j)})=\frac {n!}{(i-1)!(j-i-1)!(n-j)!}[F(x_{(i)})]^{i-1}f(x_{(i)})\times [F(x_{(i)})-F(x_{(j)})]^{j-i-1}[1-F(x_{(j)})]^{n-j}f(x_{(j)})$

可以用圖示法記：
![](https://hackmd.io/_uploads/SyNOSEQ02.png)



$X_{(1)},X_{(n)}$也可以特別記:
$f(x_{(1)},x_{(n)})=n(n-1)f(x_{(1)}f(x_{(n)})[\int _{x_{(1)}}^{x_{(n)}}f(x)dx]^{n-1-1}$
$f(x)$為order前的機率分配。

### 把一般的Uniform變成standend Uniform
if $X~U(a,b)$
Then $U=\frac{x-a}{b-a}~U(a,b)$

$pf.$ transfer 即可。

## conditional pdf
三個變數比較常出現在這裡
![](https://hackmd.io/_uploads/H1aKmTnW6.jpg)

## 求百分位數位於order statistic的公式解
$P(X_{(k)}<Q_p<X_{(s)})=\sum \limits_{x=k}^{s-1} \binom{n}{x}p^x(1-p)^{n-x}$, $s>k$


<u>**pf:**</u>
$P(X_{(k)}<Q_p<X_{(s)})=\sum \limits_{x=k}^{s-1} \binom{n}{x}p^x(1-p)^{n-x}$
$=1-P((X_{(k)}\ge X_{(s)} )\cup (X_{(s)}\le Q_p))$
$=1-\sum \limits_{x=0}^{k-1} \binom{n}{x}p^x(1-p)^{n-x}-\sum \limits_{x=s}^{n} \binom{n}{x}p^x(1-p)^{n-x}+P(X_{(s)}<Q_p<X_{(k)})$
$=1-\sum \limits_{x=0}^{k-1} \binom{n}{x}p^x(1-p)^{n-x}-\sum \limits_{x=s}^{n} \binom{n}{x}p^x(1-p)^{n-x}$
$=\sum \limits_{x=k}^{s-1} \binom{n}{x}p^x(1-p)^{n-x}$

## 題目
### source: 數統_Ross DP280 4.51
Let X, Y, and Z be independent uniform(0,1) ramdom variable
(a)find $P(X/Y \le t)$ and P$(XY\le t)$

$sol.$
https://math.stackexchange.com/questions/1493277/find-px-y-leq-t-pxy-leq-t-and-use-it-to-find-pxy-z-leq-t

![](https://hackmd.io/_uploads/B15xPDi23.png)



(b)find $P(XY/Z \le t)$


:::info
這題是經典題，務必要會!!!
:::

### source: 機率論_Ross DP280 EX.6a
Along a raod 1 mile long are 3 people "distributed at random."Find the probability that no 2 people are less than a  istance of d miles apart when d $\le\frac {1}{2}$.

$sol.$
$f_{X_{(1)}, X_{(2)},X_{(3)}}(x_1,x_2,x_3)=3!$
$P(X_{(i)}>X_{(i-1)}+d,i=2.3)=\int \int \int_{x_i>x_{i-1}+d}f_{X_{(1)}, X_{(2)},X_{(3)}}(x_1,x_2,x_3)dx_1dx_2dx_3$
$=3!\int_0^{1-2d}\int_{x_1+d}^{1-d}\int_{x_2+d}^{1}dx_1dx_2dx_3$
$=(1-2d)^3$

### source: 機率論_Ross DP280 EX.6b
When a sample of 2n-1 random variable (a.k.a 2n+1 i.i.d r.v)is observed, the (n+1) smallest is called the sample median. If a sample of size 3from a uniform distrubution over (0,1) is obsered, find the probalility that the sample median is between $\frac {1}{4}$ and $\frac {3}{4}$.

$sol.$
$f_{X_{(2)}}(x)=\frac {3!}{1!1!}x(1-x)　0<x<1$

### source: Hogg詳解4.4.11
Find the probability that the range of a random sample of size 4 from the uniform distribution having the pdf $f(x)=1,　0<x<1, zearo elsewhere, is less than 1/2.

$sol.$
首先，題目裡提到全距(range)，因此要先求$f(y_1,y_n)$
使用joint pdf of $y_1,y_n$ formula:
$f(y_{1},y_{n})=n(n-1)f(y_{1}f(y_{n})[\int _{x_{(1)}}^{x_{(n)}}f(x)dx]^{n-1-1}$
$=4\times 3 \times 1 \times 1 \times (y_4-y_1)^2$
$=12(y_4-y_1)^2,　0<y_1<y_4<1$

全距=最大值-最小值=$Y_4-Y_1$
$P(Y_4-Y_1<0.5)=P(Y_4<Y_1+0.5)=P(Y_1>Y_4-0.5)$
$=1-P(Y_1\le Y_4-0.5)$
$=1-\int_0^{1} \int_{0}^{y_4-0.5} 12(y_4-y_1)^2 dy_1dy_4$

### source: Hogg 4.46
Let $X_1,X_2,X_3$ be a random sample from a distribution of the continuous type having pdf $f(x)=2x$, $0<x<1$, find the largest $X_i$ is less than median dribution.

$sol.$
簡易想法:
$P(Y_n \le m)=P(all　x \le m)=(\frac{1}{2})^n$

可以直接用公式解:$P(X_{(k)}<Q_p<X_{(s)})=\sum \limits_{x=k}^{s-1} \binom{n}{x}p^x(1-p)^{n-x}$, $s>k$

### source: 108北大考古
Let X and Y denote independent random variables with respecti probability density function f(x)=2x, 0<x<l, zero elsewhere, and g(v)=3y- , 0<y<l , zero elsewhere. Let U=min(X,Y) and V =max(X, Y). Find the joint probability density function of U and V

$sol.$
想法：order statistics 不影響原分配，即使為joint distribution 也一樣，直接分情況transformation 即可。
答案：$6uv(u+v)$, $0<u<v<1$
