Incidentally, the maximum offset can be introduced for the first two strategies as well. To prevent sampling of an empty subsequence, we could choose it to be the minimum length in S minus 2. Random sampling may also create empty subsequences, and one way to guarantee nonempty entries is to sample the required number of minibatches using consecutive sampling, integrate them into one batch, and randomly pick subsequences with replacement.