获取种子来生成一组特定的伪休息号
我想知道R中是否有一种方法可以找到生成一组特定数字的特定种子。
例如:
sample(1:300, 10)
我想找到给我的种子,作为先前代码的输出:
58 235 243 42 281 137 2 219 284 184
I was wondering if there is a way in R to find the specific seed that generates a specific set of numbers;
For example:
sample(1:300, 10)
I want to find the seed that gives me, as the output of the previous code:
58 235 243 42 281 137 2 219 284 184
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所
知道跑步大约需要7个小时。另外,这正是您可以在单独的线程中并行运行的任务,以将时间缩短了很多。
编辑:更新以包括我未考虑的负种子。因此,实际上可能需要两倍的时间。
As far as I know there is no elegant way to do this, but you could brute force it:
This takes 11.5 seconds to run with the first
1e6
seeds on my laptop - so if you're unlucky then it would take about 7 hours to run. Also, this is exactly the kind of task you could run in parallel in separate threads to cut the time down quite a bit.EDIT: Updated to include negative seeds which I had not considered. So in fact it could take twice as long.