# Using one-sample Kolmogorov-Smirnov test impementation for comparing two samples with purely discrete CDF

In one-sample Kolmogorov-Smirnov test one tests whether sample $$X = (X_1,\dots,X_n)$$ come from theoretical distribution by computing $$D_n = \sup_{x} |F_n(x) - F(x)|$$, where $$F_n(x)$$ denotes the empirical cumulative distribution function of $$X$$ and $$F(x)$$ denotes the cumulative distribution function of a prespecified theoretical distribution.

It is known that in case when $$F(x)$$ is continuous, the distribution of $$D_n$$ does not depend on $$F(x)$$. In classical KS-test it is assumed that distibutions are continuous. It is possible, however, to perform test for purely discrete $$F(x)$$. In that case it's hard to compute $$P(D_n \leq q |H_0)$$ (p-value), where $$H_0$$ is a null hypothesis that $$X$$ comes from $$F(x)$$.

Dimitrova, D. S et al. study how to compute p-value for continuous, discrete or mixed $$F(x)$$ - http://openaccess.city.ac.uk/id/eprint/18541/. Let's focus on purely discrete CDF. In that case $$F(x)$$ must be non-decreasing and right-continuous, with countable number of jumps. If it's true, one could compute $$D_n$$ and corresponding p-value for purely discrete $$F(x)$$ using function KSgeneral::disc_ks_test() from package KSgeneral (implemented by the same authors) in R.

Is it possible to use this implementation for two-sample KS-test, when we get samples $$X = (X_1,\dots,X_n)$$ and $$Y = (Y_1,\dots,Y_m)$$, to test whether these two samples come from the same discrete distribution? Let $$F(x)$$ be empirical cumulative distribution function of $$Y$$. Then, I believe, KSgeneral::disc_ks_test() is going to perform two-sample test for $$X$$ and $$Y$$, am I wrong?