Kolmogorov–Smirnov test We measured time of reaction of 8 drivers right before and 15 minutes after drinking certain amount of alcohol. Times of reaction before were:
0.22, 0.18, 0.16, 0.19, 0.20, 0.23, 0.17, 0.25
and after:
0.28, 0.25, 0.20, 0.30, 0.19, 0.26, 0.28, 0.24.
The problem is to test the hypothesis whether drinking alcohol prolongs time of reaction (with a significance level $\alpha=0.05$).
My attempt to the problem:
The classical approach to the problem like that would be to use Kolmogorov–Smirnov test to verify if the distribution of the random variable "times before" (X) is equal to distribution of the random variable "times after" (Y). The value of D=0.625 and p-value=0.08787. It would mean that with significance level $\alpha=0.05$ we operate only on one distribution. However the alternative hypothesis in such case would be in a from $F \neq G$ and it does denote hypothesis "drinking alcohol prolongs time of reaction".
So my second step was to define alternative hypothesis as "CDF of Y lies below CDF of X". I found somewhere that in such situation I should focus only on $D^{-}$. Therefore $D^{-}=0$ and $p=1$. Is that a right solution?
 A: From your description of the experiment, it seems to me that this is a paired design. Specifically, I suppose that .22 and .28 are for the same driver
before and after drinking alcohol.
In that case, there are two difficulties using the K-S test with which I am
familiar. First, that test is for two independent samples from two different
populations. Second, that test is for continuous data, so that the
distribution theory does not allow for ties in the data (which you have).
Here is a boxplot of the differences in reaction time for the eight subjects,
with exact values superimposed (notice the ties at both extremes). Six of the
eight subjects were slower to react after drinking alcohol, some markedly so.

So if your assignment is specifically for drill in the use of K-S tests,
then I cannot be of assistance.
If, however, you want to do a test of the paired data to see whether
they show a statistically significan increase in reaction time after consuming alcohol,
then here are several possibilities.
First, lacking evidence that the data are far from normal, a paired t test
is appropriate. Results from R statistical software are as follows
(significance at the 1% level).
Bef = c(0.22, 0.18, 0.16, 0.19, 0.20, 0.23, 0.17, 0.25)
Aft = c(0.28, 0.25, 0.20, 0.30, 0.19, 0.26, 0.28, 0.24)

t.test(Bef, Aft, pair=T, alte="less")

        Paired t-test

data:  Bef and Aft 
t = -3.0151, df = 7, p-value = 0.00976
alternative hypothesis: true difference in means is less than 0 
95 percent confidence interval:
        -Inf -0.01858197 
sample estimates:
mean of the differences 
                  -0.05 

A Wilcoxon signed-rank test does not assume normal data, also has difficulty with ties, and tests for differences in medians, but gives
a similar result (significance at the 5% level):
wilcox.test(Bef, Aft, pair=T, alte="less")

        Wilcoxon signed rank test with continuity correction

data:  Bef and Aft 
V = 3, p-value = 0.02103
alternative hypothesis: true location shift is less than 0 

Warning message:
In wilcox.test.default(Bef, Aft, pair = T, alte = "less") :
  cannot compute exact p-value with ties

A (one-sided) permutation test does not assume normality and is not so sensitive to ties.
The P-value is about 0.011, and so finds a significant difference at the
2% level, but not quite at the 1% level. If you are interested in details of
the permutation test, please leave a Comment and I will plan to supply them
within a day. 
