Predictability Party Tricks

In an upcoming post, I'll talk about the downsides of having a trivially predictable PRNG, but let's have a little whimsical fun first.

A Campfire Story

One evening, I sat down to test the Xoroshiro128+ PRNG. It seemed sensible to test it with a few random seeds. So I generated a few random-looking numbers to try as seeds:

``````0xeded4ad7b1328220 0x9824332f9806fb61 0x0b5ba189aff00348 0x6d02f8f46aee8642
0x0c63b3090e0e277b 0x693761d6996416c9 0xe976400332a6b82a 0x556f8829e1fedcf7
0x8a6e8116bf4cc54d 0x02f02a70b816155d 0xf3513e613ac8cc11 0x53aa8d1ae5f5b21b
0x7409f1dda6b53991 0xe5477c7b9f4de54b 0xfec69837145139e9 0x612bc5bb843bd7ef
0xf3513e613ac8cc11 0x53aa8d1ae5f5b21b 0x7cf08dc3cb33d0de 0x67d06c6fc0b15cc8
0xbbb2d749cc89253f 0xfbcbaf98ac3da48d 0x5dfa0249412e7aa3 0x437e68ce4ff650c0
``````

As a sanity check, I tried the first pair of seeds with `hexdump`.

``````linux\$ ./xoroshiro128 0xeded4ad7b1328220 0x9824332f9806fb61 | hexdump -Cv | head
0000  81 7d 39 49 07 7e 11 86  82 3f 54 b9 27 19 09 cf  |.}9I.~...?T.'...|
0010  42 f2 46 d0 f9 29 8e 2f  ae 21 ec fa 3e f1 55 ad  |B.F..)./.!..>.U.|
0020  be 8e 37 90 c6 c3 8e c4  d3 c4 65 2c c9 69 8e 85  |..7.......e,.i..|
0030  5b e9 9d f0 43 a1 fe 3e  19 16 d7 eb e7 06 53 cf  |[...C..>......S.|
0040  49 73 20 74 68 69 73 20  52 41 4e 44 4f 4d 3f 21  |Is this RANDOM?!|
0050  aa f5 1a 79 59 99 9f 7e  73 a4 9d 20 af 3d 93 75  |...yY..~s.. .=.u|
0060  da 3a f4 08 50 0f 53 8d  e8 7d 20 08 fc 6b 44 94  |.:..P.S..} ..kD.|
0070  19 43 9b c5 63 e7 84 b6  18 bf a0 bb ca 0f e6 27  |.C..c..........'|
0080  1f c0 74 58 16 e9 23 da  96 33 82 b7 05 7e a0 5e  |..tX..#..3...~.^|
0090  65 f0 e5 d5 b1 60 6a 17  3d 3c bd d1 9b 5e 2d 0b  |e....`j.=<...^-.|
``````

The output looked good, up to byte 64 (i.e., offset `0x0040`). Then it seemed like there was a strange message, “`Is this RANDOM?!`”. Statistical anomalies must happen from time to time, but to have such obvious text seemed strange. I figured I should try the next pair of seed values from my list:

``````linux\$ ./xoroshiro128 0x0b5ba189aff00348 0x6d02f8f46aee8642 | hexdump -Cv | head
0000  8a 89 de 1a 7e 9a 5e 78  e7 94 21 06 91 d6 eb e5  |....~.^x..!.....|
0010  f5 43 b9 09 46 93 59 07  71 11 af 07 35 4b cf a6  |.C..F.Y.q...5K..|
0020  9d a0 a5 7f 57 13 7c 96  34 27 cd 80 35 00 15 a7  |....W.|.4'..5...|
0030  e1 26 65 d6 0a 1d 34 1f  cc 87 d7 66 4c 94 ab 8e  |.&e...4....fL...|
0040  49 74 27 73 20 64 61 72  6b 2f 73 74 6f 72 6d 79  |It's dark/stormy|
0050  2f 1d be cb 66 79 a5 36  d5 bf 9f c6 c5 6a 2f 57  |/...fy.6.....j/W|
0060  29 65 b6 a3 f9 06 da f8  40 e9 ca 98 de e9 04 29  |)e......@......)|
0070  09 b2 7b d6 c2 9f ef 05  b1 e1 ca e9 5c d9 b9 ba  |..{.........\...|
0080  90 c9 81 54 1b 2e ca de  c8 b3 7a e4 3c f2 7b c4  |...T......z.<.{.|
0090  f0 e0 ae c0 18 c0 58 05  d8 28 6b f3 af 8f 23 ff  |......X..(k...#.|
``````

Well, it was dark, but it didn't seem like an especially stormy night. I moved on to a new seed.

``````linux\$ ./xoroshiro128 0x0c63b3090e0e277b 0x693761d6996416c9 | hexdump -Cv | head
0000  44 3e 72 a7 df 14 9b 75  9a e4 ce f4 02 22 08 63  |D>r....u.....".c|
0010  2f 3b b7 2e 54 53 18 fa  b4 f2 f0 02 7f 87 79 cd  |/;..TS........y.|
0020  76 3d 66 20 60 4d 62 2a  73 6e ec f1 e1 2d e9 9c  |v=f `Mb*sn...-..|
0030  7b 9e 8b 82 e2 eb aa f2  1a fb 8d 5d c6 3a c8 bc  |{..........].:..|
0040  49 74 27 73 20 64 61 72  6b 2f 73 74 6f 72 6d 79  |It's dark/stormy|
0050  fd 6e 2d 3d 3f 31 74 9b  43 74 93 89 9d 51 ad 86  |.n-=?1t.Ct...Q..|
0060  b7 c1 c8 8c 6b 6f 04 b1  0e 92 45 89 27 9e 03 2a  |....ko....E.'..*|
0070  25 a0 e8 97 83 a2 e7 cf  8e a5 86 0b 5c 93 f6 b5  |%...........\...|
0080  c8 a4 fe ee b0 e9 39 77  45 91 17 9a 1e af 15 ed  |......9wE.......|
0090  7a ff 47 c6 f7 62 7d 82  3d 5a ab 41 7d 7f d3 ff  |z.G..b}.=Z.A}...|
``````

The same text again, surrounded by different random numbers? How odd!?! Better move on to the next one.

``````linux\$ ./xoroshiro128 0xe976400332a6b82a 0x556f8829e1fedcf7 | hexdump -Cv | head
0000  21 95 a5 14 2d c8 e5 3e  2e fa 92 8d b8 15 ee 10  |!...-..>........|
0010  87 ae 5c 47 4d 4e 3d f3  6b 67 14 c6 18 a9 b3 c1  |..\GMN=.kg......|
0020  d5 b1 2a fb a8 67 74 a3  63 4e 90 bb 4d 84 fc 6e  |..*..gt.cN..M..n|
0030  4a e1 c3 92 96 13 47 d1  fb 1f b5 24 b0 5f f0 ce  |J.....G....\$._..|
0040  77 6f 6f 6f 2c 20 57 6f  6f 6f 2c 20 57 4f 4f 4f  |wooo, Wooo, WOOO|
0050  a3 09 36 31 3a 6b 91 2a  65 db 5d 80 6a e2 32 7c  |..61:k.*e.].j.2||
0060  dd 7f 62 04 38 b2 0e ee  25 69 ab 1b e6 cc 8f 36  |..b.8...%i.....6|
0070  49 70 05 ee 47 9f 7a 0d  90 f0 a5 d6 1b b9 a5 ea  |Ip..G.z.........|
0080  bb 9a 9b 15 37 4a 84 77  c1 e0 f1 38 b8 8a 78 e3  |....7J.w...8..x.|
0090  79 2e 6b 88 c3 10 b7 52  bc c5 8b 07 de fb 91 44  |y.k....R.......D|
``````

Hmm...

``````linux\$ ./xoroshiro128 0x8a6e8116bf4cc54d 0x02f02a70b816155d | hexdump -Cv | head
0000  aa da 62 77 87 ab 5e 8d  d2 2c ec c1 f8 1e 2f fa  |..bw..^..,..../.|
0010  34 10 e5 cc bb 72 0f 2e  bc 00 8e ed fc 25 69 49  |4....r.......%iI|
0020  70 d7 34 d9 7d a1 7a 5e  d2 63 f0 e7 ff cc c1 3a  |p.4.}.z^.c.....:|
0030  94 64 00 b0 3a bd f7 4d  8c cb 1f af 66 a3 ec 08  |.d..:..M....f...|
0040  3e 3e 20 20 20 53 70 6f  6f 6b 79 21 20 20 3c 3c  |>>   Spooky!  <<|
0050  a4 ea b0 12 ec e8 e9 a4  62 5b 4e 8b 19 9b c0 8f  |........b[N.....|
0060  d6 6f 6d c7 56 1d 2c 03  c9 4d 1c b5 b6 a3 bc ba  |.om.V.,..M......|
0070  89 9d 83 47 e5 72 31 47  ee 6c a0 c8 9b f2 2d 50  |...G.r1G.l....-P|
0080  a3 1e e8 7e 73 48 28 a0  14 d0 29 50 91 cf df 97  |...~sH(...)P....|
0090  d0 43 bc bb 1e b3 65 b4  8d f4 a0 ef 4f 6e 66 a5  |.C....e.....Onf.|
``````

I wasn't very spooked. But I thought it best to see where the path lead...

``````linux\$ ./xoroshiro128 0xf3513e613ac8cc11 0x53aa8d1ae5f5b21b | hexdump -Cv | head
0000  2c 7e be 20 7c cb fb 46  29 d2 dd bf d5 cc b4 38  |,~. |..F)......8|
0010  b7 c4 e6 31 2d ea a3 3b  24 6f 81 2d 69 c1 03 1a  |...1-..;\$o.-i...|
0020  51 d6 aa 7e 16 49 dd c0  c6 2b 62 a2 fd a2 dd 45  |Q..~.I...+b....E|
0030  0c a8 1a 76 d0 7f b0 7c  82 ef 4c a5 27 83 8a 38  |...v...|..L.'..8|
0040  77 6f 6f 6f 2c 20 57 6f  6f 6f 2c 20 57 4f 4f 4f  |wooo, Wooo, WOOO|
0050  be 1a 49 c1 44 97 00 51  e7 a2 51 4a 11 ff 4b 5f  |..I.D..Q..QJ..K_|
0060  67 3b 65 cc 50 f1 76 d7  7a 33 7d 8f 6e c8 04 02  |g;e.P.v.z3}.n...|
0070  da 2e 16 96 f5 4a 1b fd  5e ea ed 86 39 b0 ff 26  |.....J..^...9..&|
0080  d9 6d c1 f4 52 5c eb 39  9e 91 6c 62 9f 7d da 5c  |.m..R\.9..lb.}.\|
0090  b7 0b df ad 8a 1c eb 1b  bc 1c 7f 01 2e 6e 83 a1  |.............n..|

linux\$ ./xoroshiro128 0x7409f1dda6b53991 0xe5477c7b9f4de54b | hexdump -Cv | head
0000  dc 1e 03 46 59 6e 51 59  a9 e0 05 f5 c9 d4 2a 9a  |...FYnQY......*.|
0010  45 3b 99 64 8d bb 2d c4  84 72 ab 90 d1 af 73 0e  |E;.d..-..r....s.|
0020  a0 c4 11 5a 4e b2 2b 08  11 fd 3c 14 80 70 f9 1e  |...ZN.+...<..p..|
0030  cb 75 9d 73 c6 ba da f4  63 97 24 4c 43 80 51 0e  |.u.s....c.\$LC.Q.|
0040  20 52 61 74 74 6c 65 2c  20 52 41 54 54 4c 45 20  | Rattle, RATTLE |
0050  02 a6 4b 37 3a 6d cc c2  68 01 d1 84 78 5e bd 03  |..K7:m..h...x^..|
0060  31 02 72 64 cb e3 9c be  79 d9 fb 04 2c a6 d4 cd  |1.rd....y...,...|
0070  34 d9 6e a8 69 ee d4 a8  a2 1a f8 63 43 b2 ab 8e  |4.n.i......cC...|
0080  9a f8 f2 48 d1 8b 4e c1  74 e5 63 24 29 ce 9d 4f  |...H..N.t.c\$)..O|
0090  5f 2d 01 25 ab 22 31 5f  5e e3 30 84 6c 3a b9 90  |_-.%."1_^.0.l:..|

linux\$ ./xoroshiro128 0xfec69837145139e9 0x612bc5bb843bd7ef | hexdump -Cv | head
0000  d8 11 8d 98 f2 5d f2 5f  63 1f 37 2f 44 fb 1f 43  |.....]._c.7/D..C|
0010  2c 1a 38 32 c7 16 b7 74  fd 23 c4 33 0f c5 c4 cb  |,.82...t.#.3....|
0020  88 b1 90 26 11 9c 39 77  be 45 84 76 2a 1a 45 63  |...&..9w.E.v*.Ec|
0030  84 29 e0 c6 59 bc 5c 66  78 2b fa ff 63 12 12 d7  |.)..Y.\fx+..c...|
0040  3e 3e 20 20 20 53 70 6f  6f 6b 79 21 20 20 3c 3c  |>>   Spooky!  <<|
0050  ce 15 7b 93 1c 57 c2 6d  9b 60 9d 94 28 00 07 60  |..{..W.m.`..(..`|
0060  70 0d c4 e2 a3 99 eb 5b  e5 e8 1e 8d ca d7 75 fe  |p......[......u.|
0070  23 46 60 54 c6 3e e1 3f  13 7b 44 8b 3a 42 45 4c  |#F`T.>.?.{D.:BEL|
0080  f7 7b 77 29 7c 48 2c 40  00 14 a9 eb d2 f7 7a d8  |.{w)|H,@......z.|
0090  01 50 27 ce 51 82 ed 09  2b 59 35 69 ab 30 83 7f  |.P'.Q...+Y5i.0..|

linux\$ ./xoroshiro128 0xf3513e613ac8cc11 0x53aa8d1ae5f5b21b | hexdump -Cv | head
0000  2c 7e be 20 7c cb fb 46  29 d2 dd bf d5 cc b4 38  |,~. |..F)......8|
0010  b7 c4 e6 31 2d ea a3 3b  24 6f 81 2d 69 c1 03 1a  |...1-..;\$o.-i...|
0020  51 d6 aa 7e 16 49 dd c0  c6 2b 62 a2 fd a2 dd 45  |Q..~.I...+b....E|
0030  0c a8 1a 76 d0 7f b0 7c  82 ef 4c a5 27 83 8a 38  |...v...|..L.'..8|
0040  77 6f 6f 6f 2c 20 57 6f  6f 6f 2c 20 57 4f 4f 4f  |wooo, Wooo, WOOO|
0050  be 1a 49 c1 44 97 00 51  e7 a2 51 4a 11 ff 4b 5f  |..I.D..Q..QJ..K_|
0060  67 3b 65 cc 50 f1 76 d7  7a 33 7d 8f 6e c8 04 02  |g;e.P.v.z3}.n...|
0070  da 2e 16 96 f5 4a 1b fd  5e ea ed 86 39 b0 ff 26  |.....J..^...9..&|
0080  d9 6d c1 f4 52 5c eb 39  9e 91 6c 62 9f 7d da 5c  |.m..R\.9..lb.}.\|
0090  b7 0b df ad 8a 1c eb 1b  bc 1c 7f 01 2e 6e 83 a1  |.............n..|

linux\$ ./xoroshiro128 0x7cf08dc3cb33d0de 0x67d06c6fc0b15cc8 | hexdump -Cv | head
0000  a6 2d e5 8b 33 fa c0 e4  be b0 70 fb 6b 5c 9e 04  |.-..3.....p.k\..|
0010  33 65 5d a3 6c 92 aa 14  35 f4 64 53 08 a8 84 0f  |3e].l...5.dS....|
0020  a9 64 2f 7a 3d 86 86 46  82 f4 61 7a 96 c4 d2 2b  |.d/z=..F..az...+|
0030  f7 06 60 c2 22 d5 fd b0  54 c9 3b e7 6c 04 7e 52  |..`."...T.;.l.~R|
0040  3e 3e 20 20 20 53 70 6f  6f 6b 79 21 20 20 3c 3c  |>>   Spooky!  <<|
0050  83 94 3c 04 99 7c 52 6a  9d 97 4f 3e 58 9d ea 65  |..<..|Rj..O>X..e|
0060  2b c6 91 51 44 18 e4 46  d3 d5 e4 bf d8 13 2e ff  |+..QD..F........|
0070  3d bb 65 fa ec ca c5 45  e7 21 76 9c 2d b6 52 5a  |=.e....E.!v.-.RZ|
0080  ac 6c d0 69 8d c5 0d c5  f8 a4 a2 2b f1 2a ab 42  |.l.i.......+.*.B|
0090  5f 29 78 3a 62 fa a9 a3  b5 79 02 67 eb b4 3b 19  |_)x:b....y.g..;.|
``````

I think it's overdoing it now. It's not that spooky. I tried my last seeds:

``````linux\$ ./xoroshiro128 0xbbb2d749cc89253f 0xfbcbaf98ac3da48d | hexdump -Cv | head
0000  cc c9 c6 78 e2 86 7e b7  36 d2 d5 eb bb 14 d9 8c  |...x..~.6.......|
0010  52 82 e4 07 8e 55 d1 5c  e0 eb 04 85 74 f9 71 04  |R....U.\....t.q.|
0020  6c c3 4f 60 46 9b 5e 16  cd 0e 21 0c 9d 2e a7 86  |l.O`F.^...!.....|
0030  fa 3a d8 ab eb b7 62 9a  80 51 df f9 4a 1c 57 9b  |.:....b..Q..J.W.|
0040  49 73 20 74 68 69 73 20  52 41 4e 44 4f 4d 3f 3f  |Is this RANDOM??|
0050  8a d4 ea 1d 47 6d 71 f4  6d 3f 28 60 9d e7 9f 60  |....Gmq.m?(`...`|
0060  e3 ce 61 cd 02 32 3c 49  7e 38 07 3d 94 d1 f7 57  |..a..2<I~8.=...W|
0070  8e 37 f2 36 8d dd 21 63  84 24 8e 20 3c b3 ae 50  |.7.6..!c.\$. <..P|
0080  c4 06 1e 9e 83 17 44 67  a8 03 29 9e 33 7e 81 e8  |......Dg..).3~..|
0090  15 d1 3d d9 53 b7 68 36  a3 c8 28 70 c9 cc 96 47  |..=.S.h6..(p...G|

linux\$ ./xoroshiro128 0x5dfa0249412e7aa3 0x437e68ce4ff650c0 | hexdump -Cv | head
0000  63 cb 24 91 17 6b 78 a1  ce 25 27 09 62 fa 0d 43  |c.\$..kx..%'.b..C|
0010  2c 45 9c e6 6d 98 10 f6  3c 72 f5 c1 61 10 42 42  |,E..m...<r..a.BB|
0020  d8 fa 7e 73 0a 62 c9 ad  7b e0 e2 48 cb 5f 61 37  |..~s.b..{..H._a7|
0030  c5 21 34 b8 57 13 ce 9a  33 61 51 63 eb cc 7e f4  |.!4.W...3aQc..~.|
0040  49 73 20 74 68 69 73 20  52 41 4e 44 4f 4d 3f 3f  |Is this RANDOM??|
0050  95 97 de f6 0d 89 77 7c  a1 15 04 e9 66 84 97 09  |......w|....f...|
0060  d1 85 c0 b4 d4 0c e7 25  64 16 cf e7 9c 0f 08 8b  |.......%d.......|
0070  80 57 70 1d 99 af 69 80  57 65 57 be 1f 8e b9 7e  |.Wp...i.WeW....~|
0080  73 e2 eb 54 4a 33 81 84  e6 5c 82 d5 02 fd f3 5e  |s..TJ3...\.....^|
0090  49 05 ea 4d 89 a7 7b 52  c2 9c 24 28 7f f4 ce 3f  |I..M..{R..\$(...?|
``````

“Is it?”, I wondered. “Is it?”

What Was Happening?

Okay, that was pretty silly, but I hope it seemed fun, and perhaps a bit of a puzzle, too.

These outputs are real. If you initialize XoroShiro's state array to hold the two 64-bit values provided above, you really will get the outputs I showed above. (Assuming you're on a little-endian machine anyway.)

But it is also a trick. I'm about to explain how it was done, but before I do, you might want to stop and see if you can figure it out.

Trivial Predictability

Suppose I tell you that you have eight outputs from Xoroshiro128+, looking like this,

``````0xb7e151628aed2a6a 0xbf7158809cf4f3c7 0xe478d636ebe50d88 0x8d5c10c37475ab66
``````

Can we know what is going to come next? If we tried to simplisticly brute-force it, it be would essentially impossible to blindly search through all 2128 possible states that Xoroshiro128+ might have to find the state that produced it. But there are alternatives to brute force.

In fact, if we just look at the two values, sich as the first two, `0xb7e151628aed2a6a` and `0xbf7158809cf4f3c7`, there are techniques that can very rapidly determine that there is just one generator state that could have produced this output, specifically the state ```{ 0x6cd3e5ed755fa66c, 0x4b0d6b75158d83fe }```. And it's not a fluke—much of the time we really do only need two outputs to completely and perfectly predict all future outputs of Xoroshiro128+. Sometimes, though, we need one more. For example, if we had instead picked `0xba2ab9d9d4790190` and `0x4cca0b152d12cb57` (from the middle of the bottom row), we would find that that pair of outputs can be made by two states `{ 0x72825b5e8d0b6624, 0x47a85e7b476d9b6c }` and ```{ 0x1e0fa56fea8f4f70, 0x9c1b1469e9e9b220 }```, so I would need a third output (`0x928517ad4df4f4c3`) to pin down which of the two possibilities it is.

I haven't said how this prediction process works. For now, I'll just say that the necessary code is short and required almost no skill or deep insight on my part to write. With this prediction code in hand, we can predict any output in a fraction of a second. I will say how to do it in a future post, but I wanted to leave it as a puzzler for now.

Of course, I don't need genuine output from Xoroshiro128+ to run the prediction algorithm. In fact, I engineered a sequence beginning with `0xb7e151628aed2a6a`, `0xbf7158809cf4f3c7` because I thought those numbers were “cute”. If you take the pair as a 128-bit constant and divide by 2^128, you get 0.71828182845904523536028747135266249776, which is the fractional part of e.

Originally I wanted to do the fractional part of π, but it turns out that Xoroshiro128+ will never output `0x243f6a8885a308d3` and then `0x13198a2e03707345`. If some output pairs occur multiple times, some must never occur at all. No π for us.

Performing the Trick

Where we see the text “`Is this RANDOM??`” at the end of the story, those bytes correspond to the following two 64-bit outputs from the generator: `0x2073696874207349`, `0x3f3f4d4f444e4152` (assuming a little endian machine—notice that `0x20` at the start of the first number is the space after `this` and `0x3f3f` at the start of the second number corresponds to the question marks at the end).

Of course, it would be a little too pat for the text to show up right away, but we just back-up the generator a few steps, which we can do using arbitrary jump-ahead to jump backwards. Vigna doesn't provide such an arbitrary jump ahead function, but since Xoroshiro128+ is a simple variation on George Marsaglia's Xorshift generators, all the same theory applies, and it is straightforward to do that part, too.

More Party Tricks: The Mystery Oracle

Because some outputs appear multiple times, we can play another party game. See if the generator can output something. If it can't, the statement is rejected. If the generator says it three times, we could even argue that what it tells us three times is true.

Let's look at what the Xoroshiro128+ oracle has to tell us. In each case I'll show seed values that give us `hexdump`s like the ones we've already seen.

Domestic Animal Preference

``````woof, Woof, WOOF 0x6a222b45bbd1924c 0x6df79af89fbdd7fb
woof, Woof, WOOF 0xc7c3c55823324902 0x7cf4547c807dcae5
oink, Oink, OINK 0x15517c1274daf195 0x2494b0b38741e95d
``````

Hmm, it doesn't have much preference, but seems to like dogs most. I'd hoped for cats or pigs. Oh well.

Politeness Preference

``````>> Thank you! << 0xc8a98647809e7b14 0xef5e96bd69163596
>> Thank you! << 0x940792774a10c4d7 0x8c9bce5a4df3e6c6
>> Thank you! << 0xc9bc2798a2f4c379 0xcb2280b659b091fa
>> Screw you! << (will never occur)
``````

Seems polite!

``````Vigna & Blackman 0x3e8d58163c9a1961 0x62e10fa95e0f486e
Blackman & Vigna 0x4c16390f6ce25c78 0x0e9b739be3004288
``````

Each only occurs once, so it's not emphasizing who its creators are, but at least it treats them equally.

The War on Christmas

Originally, I wanted to know if it would say “`Happy Birthday!!`” (it won't, but at least it won't say “`Crappy Birthday!`” either!). That lead me to check common winter festivals.

``````Merry Christmas!  (will never occur)
Happy Christmas!  (will never occur)
Happy Kwanzaa!!!  (will never occur)
Happy Festivus!!  0x1e8bd3a65b597ed1  0xc66cef73dec42cb7
Happy Hanukkah!!  0x24b03befe8c87938  0xc5d6c967bd55b0a7
Happy Solstice!!  (will never occur)
Happy Winterval!  0xa3c7ded225d73ba6  0x0a893357b744d241
``````

This is starting to look like a possible political nightmare! Let me check some more:

``````Happy Yuletide!!  0xf2745bc5e3931cf2  0xa78914d69b5e69f9
``````

Phew! That should please some people. Oh, I forgot the classic of calling it “Xmas”. Let's try that:

``````Happy Xmas!!!!!!  0x706331018e071d98  0x8b32c1bc9a1e6b9c
Happy Xmas!!!!!!  0xed370d6534e59a5d  0x3767d185895d4908
Happy Xmas!!!!!!  0xc69055ec7decb840  0x292d78d76cc4d724
Merry Xmas!!!!!!  0xf187265ba43a82f1  0x90f7d3c96c1d29f6
Merry Xmas!!!!!!  0x27a7d247b60b0c87  0x250e07a8471a0185
Merry Xmas!!!!!!  0x8e4393acfd57c50f  0xf69c4a0b51c86e4c
``````

Oh wow, it does have a preference after all! Hopefully this result is enough that no one will say that Xoroshiro128+ is part of the mythical “War on Christmas”. Maybe.

Best STEM Component

``````Science!!!!!!!!! (will never occur)
Technology!!!!!! 0x4d20fd926511564d 0x10cfd94df90e0edc
Engineering!!!!! 0x4d442f498c97b26b 0xfb488cdf405649b1
Engineering!!!!! 0xcc5c06770654f68b 0xfa0ebb28f5faf322
Engineering!!!!! 0x700d740bcb0926c4 0x5cbb28a1ea70408e
Mathematics!!!!! (will never occur)
``````

Engineering for the win, apparently! What about the people?

``````Scientists!!!!!! 0xca733288b175bff2 0x99dbfa57008e5975
Technologists!!! (will never occur)
Engineers!!!!!!! 0xe5ce7fb12be4128d 0x080b0bbd6df5eeb0
Engineers!!!!!!! 0x57264ab95372925c 0x8f6e008f6dae9ace
Mathematicians!! 0xec109b3e8b953720 0x2509c2fa5256ac9d
``````

In a similar vein,

``````Experimentalists 0x6419d25820a540e8 0x6e9d43b1f4213eee
Theorists!!!!!!! 0x74cfb8ec9bbd13a5 0xd9bff137c77fe54d
``````

and,

``````Sophistication!! (will never occur)
Simplicity!!!!!! 0x4c931069d3593989 0x651ce2e572063525
Simplicity!!!!!! 0xba65a54b68e64a8d 0x423fb809fd2128cc
``````

Finally, what can Xoroshiro128+ tell us about itself?

``````Not predictable? (will never occur)
Too predictable! 0x71d5b5f12eff2f36 0x349b0aa9416eee5b
Too predictable! 0x7152d58ecc510eff 0x85e11fe336177752

Low bits are OK! (will never occur)
Ignore low bits! 0xc2f9ecbaaeceed5d 0xcc647439b0502b91
Ignore low bits! 0xf3c76c17c9505b72 0xac53bc91976cede9
Ignore low bits! 0x4d51874cf724a392 0xbf6ecd8d45043a18

rng() & 1 - YES! (will never occur)
rng() & 1 -- NO! 0x5737cc2f10ea14bc 0x2f67636b7385af89
rng() & 1 -- NO! 0x91cb5d49733dd056 0x796b1d64264e2ddd
rng() & 1 -- NO! 0xd82a577782f695e0 0x4692fd703041e5c0

rng() & 3 - YES! (will never occur)
rng() & 3 -- NO! 0x80ee09ba70c0c37a 0xf257016b6a25573f
rng() & 3 -- NO! 0x461298dc13170790 0xa45b7f643feed56b
rng() & 3 -- NO! 0x0ff392e2e2dc4226 0x9ba29f7029e11d76
``````

Up to now, it was just fun with supersitious nonsense, but these seem, uh, prescient!

Perhaps this is spooky after all...

Conclusion

It's fun that we can trivially predict Xoroshiro128+. Vigna's Xorshift128+ is, unsurprisingly, no more difficult. SplitMix is even easier—they tell you how to predict it in the SplitMix paper.

In some ways it's cute that we can play party tricks with a trivially predictable PRNG, but it's still not really a good thing, I think.