random_walk function

Metropolis sampling of a discrete distribution