use chi square test instead of KS test for discrete random variable