"Repeating numbers in random number generator (TRandom3( ))

Yes, around 150 values appear two times.

The TRandom class reference explicitly says that the TRandom3 generator provides “only random number with 32 bits random” (and you would probably need something like 53 bits for really diverse random “double” values).

Try the TRandomMT64 generator (just be aware that, in the current ROOT 6 versions, using the seed = 0 does NOT make it “really” random, as is in the case of the TRandom3 generator).

See also this thread (“TRandom3, problem of repetition?”) and this video (“rand() Considered Harmful”) and the <random> header reference.

1 Like