rmultinom1 function

Internal function that samples z's from a categorical distribution