Discretization-based Direct Random Sample Generation