A discrete version of the half-normal distribution and its generalization with applications