Random experiments with Scala code