java上的特定随机数生成器 [英] Specific random number generator on java
问题描述
我需要创建一个具有特定常量和方程式的RNG
r(1 =< r< 0)
X ^ n + 1 =(aX ^ n + b)mod m
r = X ^ n + 1 / m
- 获得最大周期长度使用= m = 2 ^ k,k> = 0
- a = 5
- b = 1
-根据m的大小,定义; x,m,a,b为长(最大为X:5 * 2 ^ k-1)
^=表示其后的字符是下标的前两个方程,在其他方程式中定义上标。
我尝试过的方法:
嘿,伙计们,
我收到你的要求,我正在阅读Java编程简介讲座,我得到了一个任务,这对我来说是完全无法解决的。
我要求你帮助理解这个常数方程式以及如何将它们应用到代码。
我很感激所有提前帮忙的人。
with我所有的敬意。
I need to create a RNG with specific "constants" and "equations"
r(1=< r < 0)
X^n+1 = (aX^n + b) mod m
r = X^n+1/m
-To get maximal length of period use = m = 2^k, k >= 0
- a = 5
- b = 1
-Depending on the size of m, define; x, m, a, b as long (maximum of X: 5*2^k-1)
" ^ " = indicates that characters after it are subscripted in first 2 equations, in the other equations it define upperscripts.
What I have tried:
Hey there folks,
I've a request from you, I'm having "Introduction to Java Programming" lecture, and I got an assignment, which is totally unsolvable to me right now.
I'm asking for your help to understand this "constants" "equations" and how to apply them to the code.
I'm so appreciate to everyone who try to help, in advance.
with all my respects.
推荐答案
参见 https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html [ ^ ]。
这篇关于java上的特定随机数生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!