# Why can we simply pool the realized observations in a permutation test?

Let a vector of i.i.d random varibles $(X_1,X_2,X_3,\cdots, X_m)$ and another vector of i.i.d rvs $(Y_1,Y_2,Y_3,\cdots, Y_n)$ be given. Suppose $X_i$ stands for the recovery time using a new treatment and $Y_i$ be the recovery time with the old treatment. Suppose we are interested in running a hypothesis test with the following null hypothesis $\mathbb{E}[X_i]=\mathbb{E}[Y_i]$ and alternatiave hypothesis $\mathbb{E}[X_i]\neq\mathbb{E}[Y_i]$. Now, we wish to estimate the null distribution using the permutation distribution. This is when I fail to understand: we then say under the null hypothesis, $X_i$ and $Y_i$ are identically distributed and then pool the r.v.s $X_i$ and $Y_i$ and find the permutation distribution.

Why do we know $X_i$ and $Y_i$ are identically distributed under the null? I mean, there mean is the same does not mean they share the same distribution at all. Help is appreciated. (Maybe I misunderstood what my textbooks are saying, if so, please point out my mistake.)

Why do we know $X_i$ and $Y_i$ are identically distributed under the null?