关于随机化的问题 [英] Questions on Randomising

查看:129
本文介绍了关于随机化的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们!

我是新手,我正在努力了解这是如何运作的。

一切都很清楚,唯一的事情我不是理解为什么新生成的随机数的顺序是随机的?

如果这些是生成的随机数:3,10,5,2

为什么订单不是2,3,5,10而不是随机的?

Tnx!


**编辑**

此线程被拆分来自如何删除a的相关主题来自记录集但不记录表

推荐答案

@ doma23


我想这会归结为随机数及其序列的性质。如果可以预测序列中的下一个数字大于前一个,那么这种可预测性就会排除随机性的概念。
@doma23
I guess this would be down to the nature of random numbers and sequences thereof. If it were predictable that the next number in the sequence were greater than the previous, then that very predicatability would preclude the concept of randomness.


我不确定你是否理解我。

调用randomizer函数后我有这个查询:

数字随机

1 63

2 321

3 801

4 102

5 200


现在,如果我打算排序通过RANDOM ASCENDING,我应该有这个:

数字随机

1 63

4 102

5 200

2 321

3 801

数字列仍然是随机的。

相反,似乎我选择ASCENDING OR DESCENDING并不重要,只要我选择SORT BY它就会按照一些未知的规则对RANDOM进行排序。

那是我不明白的。

或者你想告诉我Access识别使用rnd产生的数字功能,因此当包括SORT BY时,它只是随机排序这些数字?

另一件我不明白的是为什么hype261把*数字放在一起?在randomizer函数中:randomizer = Rnd()* 100 * number?

另外,如果有一个* number,为什么函数永远不会返回高于999的数字?

如果rnd()函数给出0到10之间的随机数,即。让我们说它的数字4会返回6,而应该是randomizer = 6 * 100 * 4 = 2400.


希望我很清楚,对不起,如果我''添加到作者已经找到解决方案的主题,但我真的觉得这很有趣,我想知道它是如何工作的?

谢谢!
I''m not sure you understood me well.
After calling randomizer function I have this query:
Number Random
1 63
2 321
3 801
4 102
5 200

And now, if I''m going to sort it by RANDOM ASCENDING, I should have this:
Number Random
1 63
4 102
5 200
2 321
3 801

Number column would still be always random.
Instead, it seems it doesn'' matter whether I choose ASCENDING OR DESCENDING, as long as I choose SORT BY it will sort RANDOM by some unknown rule.
That''s what I don''t understand.
Or you wanted to tell me that Access recognizes wheter the number were generated by using rnd function, and therefore when SORT BY is included it just sorts those numbers randomly?

The other thing I don''t understand is why hype261 put the "* number" in randomizer function: randomizer = Rnd() * 100 * number ?
Futhermore, if there is a "* number", how come the function never returns numbers higher than 999?
If the rnd() function gives a random number from 0 to 10, ie. let''s say it returns 6 for the number 4, than it should be randomizer = 6 * 100 * 4 = 2400.

Hope I was clear, and sorry if I''m adding to the topic whose author already found solution, but I really find this interesting and I would like to know how it really works?
Thanks!


I我觉得我现在明白了一点。


我不知道为什么Random列似乎没有正确排序。

Rnd()返回一个实数值介于0和1之间。数字的范围总是通过乘以它应该跨越的范围来处理。 IE浏览器。 15和15之间的随机数20是(Rnd()* 5)+ 15

我不知道为什么Number包含在原始代码中。


我们可能需要将此保留在此处或拆分为新线程。如果您有兴趣继续深造,请告诉我。
I think I understand a little better now.

I have no idea why the Random column doesn''t seem to sort correctly.
Rnd() returns a real value which is between 0 and 1. The range of numbers is always handled by multiplication by the range it should span. IE. A random number between 15 & 20 is (Rnd() * 5) + 15.
I have no idea why Number was included within the original code.

We probably need to leave this here or split into a new thread. Let me know if you''re interested in continuing further.


这篇关于关于随机化的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆