Is Kolmogorov-Smirnov test valid with discrete distributions? I'm comparing a sample and checking whether it distributes as some, discrete, distribution.  However, I'm not enterily sure that Kolmogorov-Smirnov applies. Wikipedia seems to imply it does not. If it does not, how can I test the sample's distribution?
 A: I believe the K-S test uses the fact that if $X$ is a random variable with CDF $F$ then $F(X)$ is a uniform random variable.   This is not the case if $X$ is not continuous.  For example, if $X$ is Bernoulli then $F(X)=X$, not a uniform.
A: It does not apply to discrete distributions. See http://www.itl.nist.gov/div898/handbook/eda/section3/eda35g.htm for example.
Is there any reason you can't use a chi-square goodness of fit test?
see http://www.itl.nist.gov/div898/handbook/eda/section3/eda35f.htm for more info.
A: As is often the case in statistics, it depends on what you mean.


*

*If you mean "I calculate my test statistic on a sample drawn from a discrete distribution and then look up the standard tables" then you'll get a true type I error rate lower than the one you chose (possibly a lot lower).
How much depends on "how discrete" the distribution is. If the probability of any one outcome is fairly low (so the proportion of tied-values in the data would be expected to be low) then it won't matter very much -- many people wouldn't have a problem with running a 5% test at 4.5% say. So for example, if you're testing a discrete uniform on [1,1000], you probably needn't worry. 
But if there's a high probability of a value being tied, then the effect on the type I error rate can be marked. If you get a significance level of 0.005 when you wanted 0.05, that may be an issue, since it will correspondingly impact the power.

*If instead you mean "I calculate my test statistic on a sample drawn from a discrete distribution and then use a suitable critical value/calculate a suitable p-value for my situation" (say via a permutation test, for example), then the test is certainly valid in the sense that you'll get the right type I error rate -- up to the discreteness of the test statistic itself, of course. (Though there may well be better tests for your particular purpose, just as there usually are in the continuous case.)
Note that the distribution of the test-statistic itself is no longer distribution-free but a permutation-test avoids that issue.
So sometimes it's okay to use the standard tables even with discrete distributions, and even when its not okay, it's not so much the test statistic as the critical values/p-values you use with it that's the issue.
