Functions to create and manipulate discrete random variables