An array extension to randomly sample intervals from an array