let laws2 iter func gen =
  let res = foldn ~init:[] iter
    ~f:(fun acc _ -> let n = gen () in (n, func n) :: acc)
  in
  let stat = statistic (List.map ~f:(fun (_, (_, v)) -> v) res) in
  let res = List.filter ~f:(fun (_, (b, _)) -> not b) res in
  if res = [] then (None, stat) else (Some (fst (List.hd_exn res)), stat)