Why is it hard for a program to generate random nu

2019-01-23 03:22发布

My kids asked me this question and I couldn't really give a concise, understandable explanation.

So I'm hoping someone on SO can.

标签: random
26条回答
狗以群分
2楼-- · 2019-01-23 03:48

Because a program is a system and everything in a system is made to run with consistency and regularity. Randomness has no place in a system.

查看更多
forever°为你锁心
3楼-- · 2019-01-23 03:49

"Kids, unless they're broken, computers never lie, and they always do what you tell them to do. Even when we are disappointed by the results, it always turns out that they were doing what they were told to do with complete fidelity. They can only do two things: add one and one, and move a number from one place to another. If you want them to produce random numbers, you need to explain to them how to do that in terms of adding one and one and moving. Once you have explained that, the results will not be random."

查看更多
登录 后发表回答