Random sampling for histogram construction | Synapse