# Dataset interferes with SeedRandom

Bug introduced in 11.0.1 or earlier and fixed in 11.1

This seems like a pretty awful bug:

SeedRandom[1];
RandomInteger[10, 10]

Out: {1,4,0,7,0,0,8,6,0,4}


While:

SeedRandom[1];
Dataset[<|a -> 1, b -> 2|>];
RandomInteger[10, 10]

Out: {7,0,0,8,6,0,4,1,8,5}


I see this with 11.0.1 on Linux, OS X, and Windows. Am I missing something?

• @Kuba, but then, those built-in symbols ought to have wrapped things in BlockRandom[] to prevent such interference. – J. M. will be back soon Jan 27 '17 at 13:59
• Also re: using SeedRandom right before calling the random function, I don't think that's the only use case. For example I have a whole series of random calls that I'm making, and I usually just put a single SeedRandom at the very top to guarantee determinism. Having to place a SeedRandom in front of every random call seems rather ugly, and may actually result in worse randomization in some cases. – Mohammed AlQuraishi Jan 27 '17 at 14:45
• Agree it's a bug. I bet that DataSet is using some random numbers under the hood to build a hash table. – Kelly Lowder Jan 27 '17 at 15:08
• A (grotesque) workaround: SeedRandom[1]; BlockRandom[Dataset[<|a -> 1, b -> 2|>]]; RandomInteger[10, 10]. – J. M. will be back soon Jan 27 '17 at 15:44
• If it is an intended behaviour (and I can't see why it should be) it should at least be documented (e.g. in the "Possible Issues") – mikado Jan 27 '17 at 18:20

\$Version