Understanding “randomness”

前端 未结 28 1976
轻奢々
轻奢々 2020-11-22 15:28

I can\'t get my head around this, which is more random?

rand()

OR:

rand() * rand()

I´m f

28条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 16:10

    As others already pointed out, this question is hard to answer since everyone of us has his own picture of randomness in his head.

    That is why, I would highly recommend you to take some time and read through this site to get a better idea of randomness:

    • http://www.random.org/

    To get back to the real question. There is no more or less random in this term:

    both only appears random!

    In both cases - just rand() or rand() * rand() - the situation is the same: After a few billion of numbers the sequence will repeat(!). It appears random to the observer, because he does not know the whole sequence, but the computer has no true random source - so he can not produce randomness either.

    e.g.: Is the weather random? We do not have enough sensors or knowledge to determine if weather is random or not.

提交回复
热议问题