True Random Numbers - Computerphile

preview_player
Показать описание
Programs aren't capable of generating true random numbers, so how can we? Are they even useful? Dr Valerio Giuffrida demonstrates how to get a true random number from most computers.

This video was filmed and edited by Sean Riley.

Рекомендации по теме
Комментарии
Автор

It would be nice to see a follow-up video explaining how the hardware produces truly random numbers.

antiHUMANDesigns
Автор

An Italian science researcher in a room completely empty apart of a computer and an espresso machine? Yeap, checks out 😛

pelegsap
Автор

I never knew that x86 processors had this functionality built in. It might be slow, but if you absolutely need just a few truly random numbers, it sure beats a wall of lava lamps, a "chaotic pendulum", or a radioactive check source next to a Geiger counter. Long term fans of this channel might get the reference. ;)

jlp
Автор

Overjoyed to see Compiler Explorer being used to show how these things work under the hood!

MattGodbolt
Автор

Hey Valerio, the whole point of the video was for you to explain how hardware could generate a truly random seed, and you didn't even mention that at all. Either in general or in the case of the x86. For anyone who didn't already know, it was all gobbledegoop. The only clue was when the questioner asked if you knew what the source of entropy was within the chip, and you said you didn't know. Anyway wikipedia says it's "thermal noise within the silicon". Cheers. 🙂

blucat
Автор

It's also nice to have the same seed create the same random numbers in for example Minecraft so I can play in the same world shared by a friend or website and spawn in the same place like next to a village. I imagine some other games operate on the same principle in a great variety of implementations, and that many others at least theoretically could.

jlp
Автор

True random numbers were friends we made along the way

PurpleBaldGuy
Автор

His Italian-ness is at 11. I actually lol’d when I saw the espresso machine on his desk.

droppedpasta
Автор

Seed numbers generating the same sequence of pseudo randomness is very usefull in thinks like VFX for example, when you need to rerender certain effects but dont want to do everything back from 0... So using the same seeds assures you it will still fit togetter with everything else... For example when calculating particles, wind, fluid sims, etc... but even the noise from monte carlo raytracers.

Capeau
Автор

Would be interesting to hear how the computer collects and uses entropy.

JeffBilkins
Автор

02:40 “making the program deterministic and then the bug will appear…”
Threads: hold my beer

martijn
Автор

Eve Online was seeded on the number "42". Just have to love that.

Liqtor
Автор

The real utility difference between RdRand and RdSeed is that numbers from RdRand can be concatenated to make larger random numbers up to 256 bits and still maintain O(2^256) security. 128 bits for older chips. RdSeed you can concatenate the outputs to make as large a number as you like. So 512 bit keys or 1024 bit keys or 10 million bit keys will support a security strength that large. RdRand offers computational prediction resistance and O(2^256)+O(2^256) = O(2^257), not O(2^512). This is sometimes referred to as the additive vs multiplicative prediction resistance of RdRand vs RdSeed.

davidjohnston
Автор

The standard C++ library <random> can use a "true random" engine automatically if available in the hardware, so it's really easy to use in modern C++.

Also, as you mentioned, it is recommended to use it mainly for randomizing the seed.

antiHUMANDesigns
Автор

Well in linux you have /dev/random and urandom that gets entropy from hardware cpu, hard disk, user inputs etc. That can say that are "real" random numbers

matiasm.
Автор

Pseudo random number generation and seeds were used in computer games all the way back into the 80's. One of the best "adventure" type games was Akalabeth, and the only way you got the same dungeons and overland maps was to use the same "seed."

Which is why when i was writing games back then, i would just very rapidly (machine coding) generate PR number after PR number while waiting for the player to input. Player input is about as random a factor as you can get. Nobody is going to be able to repeatably respond within milliseconds every time.

One of my favorite tricks was to use the refresh register in a Z80 as the seed. Because it was constantly incrementing, and i could use that to tweak the randomness of the numbers i was generating, again using the player as the randomizing element. Mainly because the refresh register was a zero cost (in programming terms) high speed moving target.

jeromethiel
Автор

Another situation where is useful to set a seed is for teaching programming or data analysis, so everyone can replicate the expected results and easily verify they did the assignments correct.

EstebanGrasso
Автор

An interesting followup would be to plot the distribution of the random numbers over a few different tests and compare it to pseudorandom numbers.

klutterkicker
Автор

This video is supposed to be on “true” random number generation.
And you didn’t talk about how we generate TRNs🤦

fullfungo
Автор

I came for random numbers, I stayed for the strong accent

danfg