Random subsample function and unit test.  This function samples with a supplied probability, unlike random_subset which specifies the length of the subset