This applet computes probabilities for the Mann-Whitney $U$ Test.
Let $X_1,\ldots,X_{n_1}$ and $Y_1,\ldots,Y_{n_2}$ be independent random samples.
The Mann-Whitney statistic $U$ is the number of pairs $(X_i,Y_j)$ where
$X_i > Y_j$.

Note: Although the Wilcoxon Rank Sum test uses a different statistic, it will yield
an identical $p-$value as a test based on the Mann-Whitney U-statistic. Both tests are equivalent; the
statistics simply differ by a shift in location.

#### Directions

- Enter the size of the first sample in the $n_1$ box.
- Enter the size of the second sample in the $n_2$ box.
- Hitting "Tab" or "Enter" on your keyboard will plot the probability mass function (pmf) of the Mann-Whitney $U$ statistic.

To compute a probability, select $P(U=u)$ from the drop-down box,
enter a numeric $u$ value, and press "Enter" on your keyboard. The probability
$P(U=u)$ will appear in the
pink box.
Select $P(U \leq u)$ from the drop-down box for a left-tail probability (this is the cdf).

#### Details

The Mann-Whitney $U$ statistic has:

- Probability mass function (pmf):

$$f(u)=P(U=u)=\frac{n_1!n_2!}{(n_1+n_2)!}c(u|n_1,n_2)$$
where $c(u|n_1,n_2)$ is the total number of sequences where the $X_i$'s exceed the $Y_j$'s exactly $u$ times
given $n_1$ and $n_2$.
- Support: $U=0,1,\ldots,n_1 n_2$
- $\mu=E(U)=\frac{n_1 n_2}{2}$
- $\sigma^2=Var(U)= \frac{n_1 n_2(n_1+n_2+1)}{12}$
- $\sigma=SD(U)= \sqrt{\frac{n_1 n_2(n_1+n_2+1)}{12}}$