coding style wise to make it slightly more clear:

```scala
normalizedCumWeights.sliding(2).map { x =>
  new IndependentlySampledRDD[T, T](this, new BernoulliSampler[T](x(0), x(1)), seed)
}.toArray
```