Random sampling library