We cannot write a program that generates randomness, because as soon as we've done so it can be used to predict that randomness. We can extropolate (within limits) randomness, mix it, & adjust its probability distribution. But randomness itself must be sourced as input!
There's dedicated circuits for this, & often we can extract randomness from other inputs as sideeffect of the digitization process.
Maybe randomness is just what we don't understand, or maybe its some sort of nonsentient deity.
In any case we it can be useful for computers to behave slightly unpredictably whether for fun, security, or occasionally something else!
@alcinnz From one perspective, a stream of data is only random if it's unpredictable.
If it came from software, you might know how to predict the next output, but I don't - so it looks indistinguishable from random to me; I might as well call it "random".
At one end of the scale for conversations about randomness lies physics, but at the other end it's philosophy :-)
@alcinnz Our brains aren’t that big. We can’t comprehend the scale. It’s like standing on the edge of the Grand Canyon or see Sequoias is a photo.
What we think of as randomness is millions of hundreds of thousands of accumulated decisions, and our brains can’t comprehend that.
Computers deal with a flat world. They work in a vacuum, and that is why they can’t really create randomness without external input. We have to pipe in the outer world so they have some grit to them.
@alcinnz@floss.social do a degree you are correct but if yo've ever work with pointers and stuff such as malloc you will notice that the memory is not always clean when you receive it. generally it's good practice to memset the memory all to 0's but one could also not do that and instead use whatever happens to already be at the given address as input for the random number generator's seed.
you could also do this as well with multi-threading with all of the threads accessing the same variable address. this would introduce some choas as each thread doesn't know the order which they are executed.
mostly you'll find the randomness in undefined behavior. #