我如何创建(在Javascript中)一个工具来识别一系列数字中最长的重复模式?
好吧,长话短说,我总体上想做的就是测试一系列数千个“先前生成的看似“随机”的数字的随机性水平。
我已经写了一些东西来测试数字的概率然而,取得了巨大成功,下一步是识别重复或重复出现的模式,
我更愿意用 javascript 完成这部分,以避免暂时自学另一种语言。
现在,显然,我可以。使用正则表达式并输入一些随机序列我自己,但这并不理想,并且需要无限的时间才能得到我想要的结果。
Alright, long story short, what I overall am attempting to do, is test the level of randomness in a series of multiple thousands of " previously generated seemingly "random" numbers.
I've already written something that will test for the probability of numbers with great success, however, the next step is identifying repeating or recurring patterns.
I'd prefer to get this part done in javascript, so as to avoid having to teach myself another language for the time being.
Now, obviously, I could just use regex and punch in some random sequences myself, but that is not ideal, and would take an infinite amount of time to get the results I'm after.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊,我错过了你上面的一些评论。我相信这就是您正在寻找的:
它会很慢,但它会完成工作。
Ah, I missed a number of your comments above. I believe this is what you're looking for:
It'll be slow, but it'll get the job done.