General theory[edit]
A MWC sequence is based on arithmetic modulo a base b, usually b = 232, because arithmetic modulo of that b is automatic in most computers. However, sometimes a base such as b = 232 − 1 is used, because arithmetic for modulus 232 − 1 requires only a simple adjustment from that for 232, and theory for MWC sequences based on modulus 232 has some nagging difficulties avoided by using b = 232 − 1.
In its most common form, a lag-r MWC generator requires a base b, a multiplier a, and a set of r+1 random seed values, consisting of r residues of b,
x0, x1, x2 ,..., xr−1,
and an initial carry cr−1 < a.
The lag-r MWC sequence is then a sequence of pairs xn, cn determined by
x_n=(ax_{n-r}+c_{n-1}),mod,b, c_n=leftlfloorfrac{ax_{n-r}+c_{n-1}}{b}
ight
floor, nge r,
and the MWC generator output is the sequence of x's,
xr , xr+1 , xr+2, ...
The period of a lag-r MWC generator is the order of b in the multiplicative group of numbers modulo abr − 1. It is customary to choose a's so that p = abr − 1 is a prime for which the order of b can be determined. Because 2 is a quadratic residue of numbers of the form 8k±1, b = 232 cannot be a primitive root of p = abr − 1. Therefore there are no MWC generators for base 232 that have the maximum possible period, one of the difficulties that use of b = 232 − 1 overcomes.
A theoretical problem with MWC generators, pointed out by Couture and l'Ecuyer (1997) is that the most significant bits are slightly biased; complementary-multiply-with-carry generators do not share this problem: "We shall see that, for the complementary MWC, each bit of the output value is fair, that is, the two binary digits will appear equally often in a full period, a property not shared by MWC generators." They do not appear to elaborate further as to the extent of the bias. Complementary-multiply-with-carry generators also require slightly more computation time per iteration, so there is a tradeoff to evaluate depending on implementation requirements.
Comparisons with linear congruential generators[edit]
Linear congruential generators are implemented as
x_{n+1}=(ax_n+c) mod,2^{32},
because most arithmetic processors are able to put the multiplier a and the current x in 32-bit registers, form the 64-bit product in adjoining registers, and take the lower 32 bits as the product, that is, form
a imes x mod,2^{32}.
Adding the 32-bit c to that lower half then provides (ax+c) mod 232. If a mod 8 is 3 or 5 and c is odd, the resulting base 232 congruential sequence will have period 232.
A lag-1 multiply-with-carry generator allows us to make the period nearly 263 by using those same computer operations, except that this time the top half of the 64-bit product is used rather than ignored after the 64 bits are formed. It is used as a new carry value c rather than the fixed carry value of the standard congruential sequence: Get ax+c in 64-bits, then form a new c as the top half of those 64 bits, and the new x as the bottom half.
With multiplier a specified, each pair of input values x, c is converted to a new pair,
xleftarrow (ax+c),mod,2^{32}, cleftarrow leftlfloorfrac{ax+c}{2^{32}}
ight
floor.
If x and c are not both zero, then the period of the resulting multiply-with-carry sequence will be the order of b = 232 in the multiplicative group of residues modulo ab − 1, that is, the smallest n such that bn = 1 mod (ab − 1). If we choose an a of 28 to 31 bits such that ab−1 is a "safe prime", that is both ab − 1 and ab/2 − 1 are prime, then the period will be ab/2 − 1, approaching 263, which in practice may be an acceptably large subset of the number of possible 32-bit pairs (x, c).
Following are some maximal values of a for computer applications which satisfy the above safe prime condition:
Bits in a b Maximum a Such That ab−1 is a Safe Prime Period
15 216 215−50 = 32,718 1,072,103,423
16 216 216−352 = 65,184 2,135,949,311
31 232 231−563 = 2,147,483,085 4,611,684,809,394,094,079
32 232 232−178 = 4,294,967,118 9,223,371,654,602,686,463
64 264 264−742 = 18,446,744,073,709,550,874 170,141,183,460,469,224,887,945,252,369,640,456,191
128 2128 2128−10,408 2127(2128−10,408)−1
256 2256 2256−9166 2255(2256−9166)−1
512 2512 2512−150,736 2511(2512−150,736)-1
However, as being a safe prime does not affect the randomness of the sequence, one may instead simply choose a such that the order of b is ab/2 − 1. The following are again maximum values of a of various sizes.
Bits in a b Maximum a Such that b has order ab/2−1 Period
15 216 215−29 = 32,739 1,072,791,551
16 216 216−22 = 65,514 2,146,762,751
31 232 231−68 = 2,147,483,580 4,611,685,872,398,499,839
32 232 232−76 = 4,294,967,220 9,223,371,873,646,018,559
63 264 263−140 = 9,223,372,036,854,775,668 85,070,591,730,234,614,574,571,566,698,273,439,743
64 264 264−116 = 18,446,744,073,709,551,500 170,141,183,460,469,230,661,776,147,440,730,111,999
Here is a comparison of congruential and MWC sequences for the simple case of arithmetic modulo 10; here the "registers" are a single digit, adjoining registers are two digits:
Starting with x_0=1, the congruential sequence
x_n=(7x_{n-1}+3),mod,10,
has this sequence of adjoining registers:
10,03,24,31,10,03,24,31,10,ldots,
and the output sequence of x's, (the rightmost register), has period 4:
0,3,4,1,0,3,4,1,0,3,4,1,ldots
Starting with x_0=1,c_0=3, the MWC sequence
x_n=(7x_{n-1}+c_{n-1}),mod,10, c_n=leftlfloorfrac{7x_{n-1}+c_{n-1}}{10}
ight
floor,
has this sequence of adjoining registers
10,01,07,49,67,55,40,04,28,58,61,13,22,16,43,25,37,52,19,64,34,31 10,01,07,...
with output sequence of x's having period 22:
0,1,7,9,7,5,0,4,8,8,1,3,2,6,3,5,7,2,9,4,4,1 0,1,7,9,7,5,0,...
Notice that if those repeated segments of x values are put in reverse order starting from a x_{22n+20},
449275cdots97101,449275cdots9710144cdots
we get the expansion j/(ab−1) with a=7, b=10, j=31:
frac{31}{69}=.4492753623188405797101,4492753623ldots
This is true in general: The sequence of x's produced by a lag-r MWC generator:
x_n=(ax_{n-r}+c_{n-1})mod,b,, c_n=leftlfloorfrac{ax_{n-r}+c_{n-1}}{b}
ight
floor,
when put in reverse order, will be the base-b expansion of a rational j/(abr − 1) for some 0 < j < abr.
Also notice that if, starting with x_0=34, we generate the ordinary congruential sequence
x_n=7x_{n-1},mod,69,
we get the period 22 sequence
31,10,1,7,49,67,55,40,4,28,58,61,13,22,16,43,25,37,52,19,64,34, 31,10,1,7,...
and that sequence, reduced mod 10, is
1,0,1,7,9,7,5,0,4,8,8,1,3,2,6,3,5,7,2,9,4,4, 1,0,1,7,9,7,5,0,...
the same sequence of x's resulting from the MWC sequence.
This is true in general, (but apparently only for lag-1 MWC sequences):
Given initial values x_0,c_0, the sequence x_1,x_2,ldots resulting from the lag-1 MWC sequence
x_n=(ax_{n-1}+c_{n-1}),mod b,, c_n=leftlfloorfrac{ax_{n-1}+c_{n-1}}{b}
ight
floor
is exactly the congruential sequence yn = ayn − 1 mod(ab − 1), reduced modulo b.
Choice of initial value y0 merely rotates the cycle of x's.
Complementary-multiply-with-carry generators[edit]
Establishing the period of a lag-r MWC generator usually entails choosing multiplier a so that p=abr − 1 is prime. If p is a safe prime, then the order of b will be p − 1 or (p − 1)/2. Otherwise, it is likely that p − 1 will have to be factored in order to find the order of b mod p, and p = abr − 1 may be difficult to factor.
But a prime of the form p = abr + 1 will make p−1 easy to factor, so a version of multiply-with-carry that involves the order of b for a prime p = abr + 1 would reduce considerably the computational number theory required to establish the period of a MWC sequence.
Fortunately, a slight modification of the MWC procedure leads to primes of the form abr + 1. The new procedure is called complementary-multiply-with-carry (CMWC),
and the setup is the same as that for lag-r MWC: multiplier a, base b, r + 1 seeds
x0, x1, x2, ..., xr−1, and cr − 1.
There is a slight change in the generation of a new pair (x, c): x_n=(b-1)-(ax_{n-r}+c_{n-1}),mod,b, c_n=leftlfloorfrac{ax_{n-r}+c_{n-1}}{b}
ight
floor.
That is, take the complement, (b−1)−x, when forming the new x.
The resulting sequence of x's produced by the CMWC RNG will have period the order of b in the multiplicative group of residues modulo abr+1, and the output x's, in reverse order, will form the base b expansion of j/(abr+1) for some 0
ทฤษฎีทั่วไป [แก้ไข]MWC ลำดับตามเลขคณิต modulo b พื้นฐาน ปกติ b = 232 เนื่องจากเลขคณิต modulo ของ b ที่เป็นไปโดยอัตโนมัติในคอมพิวเตอร์ส่วนใหญ่ อย่างไรก็ตาม บางฐานเช่น b = 232 − 1 ใช้ เพราะเลขคณิตสำหรับโมดูลัส 232 − 1 ต้องการเพียงปรับปรุงง่าย ๆ จากที่สำหรับ 232 และทฤษฎีใน MWC ลำดับตามโมดูลัส 232 มีปัญหาหลุดบางหลีกเลี่ยง โดยใช้ b = 232 − 1แบบทั่วไป การกำเนิด MWC r ความล่าช้าต้อง b ฐาน การคูณ และชุดของ r + ค่าสุ่มเมล็ด 1 ประกอบด้วย r ตกของ bx 0, x 1, x 2,..., xr−1และเริ่มต้นการดำเนินการ cr−1 <ลำดับ MWC r ความล่าช้าอยู่แล้วคู่ xn, cn ตามลำดับที่ x_n = (ax_ { n r } + c_ { n-1 }) ,mod,b, c_n leftlfloorfrac {ax_ {n-r } + c_ {n-1 } } = {b }
ight
floor, nge rและผลผลิตเครื่องกำเนิดไฟฟ้า MWC ลำดับของรายxr, xr + xr 1 + 2, ...ระยะเวลาของการกำเนิด MWC r ความล่าช้าเป็นลำดับของ b ในกลุ่มเชิงการคูณเลข modulo abr − 1 มันเป็นขนบธรรมเนียมให้เลือกเป็นของที่ p = abr − 1 เป็นนายกที่ซึ่งสามารถกำหนดลำดับของ b เนื่องจาก 2 ตกค้างกำลังสองของเลขแบบฟอร์ม 8k±1, b = 232 ไม่รากดั้งเดิมของ p = abr − 1 ดังนั้นจึง มีกำเนิดไม่ MWC ใน 232 ฐานที่มีสูงสุดหนึ่งรอบระยะเวลา เป็นไปได้ของความยากลำบากที่ใช้ b = 232 overcomes − 1ปัญหาทฤษฎีกำเนิด MWC ชี้ให้เห็น โดย Couture และ l'Ecuyer (1997) ได้ว่า บิตที่สำคัญมีเล็กน้อยลำเอียง เสริมคูณมีถือกำเนิดร่วมกันปัญหานี้: "เราจะเห็นว่า MWC เสริม แต่ละบิตของมูลค่าผลผลิตเป็นธรรม คือ เลขฐานสองสองหลักจะเท่า ๆ กันบ่อยในช่วงเต็มรูปแบบ คุณสมบัติที่ใช้ร่วมกัน โดยกำเนิด MWC ไม่" พวกเขาไม่สามารถอธิบายรายละเอียดเพิ่มเติมเกี่ยวกับขอบเขตของความโน้มเอียง มื้อคูณมีถือกำเนิดยังต้องใช้เวลาคำนวณเพิ่มเติมเล็กน้อยต่อการเกิดซ้ำ ดังนั้นมีข้อดีข้อเสียเพื่อประเมินขึ้นอยู่กับความต้องการใช้งานเปรียบเทียบกับเครื่องกำเนิดไฟฟ้า congruential เชิงเส้น [แก้ไข]กำเนิดเส้น congruential จะดำเนินการเป็นx_ {n + 1 } = (ax_n + c) mod,2^{32 },เนื่องจากตัวประมวลผลทางคณิตศาสตร์ส่วนใหญ่จะใส่ตัวคูณ เป็น และปัจจุบัน x ใน 32 บิตลง ทะเบียน แบบฟอร์มผลิตภัณฑ์ 64 บิตติดกับเครื่องบันทึกเงินสด และใช้ 32 บิตล่างเป็นผลิตภัณฑ์ กล่าวคือ แบบฟอร์มa imes x mod,2^{32 }เพิ่ม c 32 บิตที่ครึ่งล่างแล้วให้ (ax + c) mod 232 ถ้า mod 8 เป็น 3 หรือ 5 และ c เป็นคี่ ผลลัพธ์ฐาน 232 congruential ลำดับที่จะได้รอบ 232A lag-1 multiply-with-carry generator allows us to make the period nearly 263 by using those same computer operations, except that this time the top half of the 64-bit product is used rather than ignored after the 64 bits are formed. It is used as a new carry value c rather than the fixed carry value of the standard congruential sequence: Get ax+c in 64-bits, then form a new c as the top half of those 64 bits, and the new x as the bottom half.With multiplier a specified, each pair of input values x, c is converted to a new pair,xleftarrow (ax+c),mod,2^{32}, cleftarrow leftlfloorfrac{ax+c}{2^{32}}
ight
floor.If x and c are not both zero, then the period of the resulting multiply-with-carry sequence will be the order of b = 232 in the multiplicative group of residues modulo ab − 1, that is, the smallest n such that bn = 1 mod (ab − 1). If we choose an a of 28 to 31 bits such that ab−1 is a "safe prime", that is both ab − 1 and ab/2 − 1 are prime, then the period will be ab/2 − 1, approaching 263, which in practice may be an acceptably large subset of the number of possible 32-bit pairs (x, c).Following are some maximal values of a for computer applications which satisfy the above safe prime condition:Bits in a b Maximum a Such That ab−1 is a Safe Prime Period15 216 215−50 = 32,718 1,072,103,42316 216 216−352 = 65,184 2,135,949,31131 232 231−563 = 2,147,483,085 4,611,684,809,394,094,07932 232 232−178 = 4,294,967,118 9,223,371,654,602,686,463
64 264 264−742 = 18,446,744,073,709,550,874 170,141,183,460,469,224,887,945,252,369,640,456,191
128 2128 2128−10,408 2127(2128−10,408)−1
256 2256 2256−9166 2255(2256−9166)−1
512 2512 2512−150,736 2511(2512−150,736)-1
However, as being a safe prime does not affect the randomness of the sequence, one may instead simply choose a such that the order of b is ab/2 − 1. The following are again maximum values of a of various sizes.
Bits in a b Maximum a Such that b has order ab/2−1 Period
15 216 215−29 = 32,739 1,072,791,551
16 216 216−22 = 65,514 2,146,762,751
31 232 231−68 = 2,147,483,580 4,611,685,872,398,499,839
32 232 232−76 = 4,294,967,220 9,223,371,873,646,018,559
63 264 263−140 = 9,223,372,036,854,775,668 85,070,591,730,234,614,574,571,566,698,273,439,743
64 264 264−116 = 18,446,744,073,709,551,500 170,141,183,460,469,230,661,776,147,440,730,111,999
Here is a comparison of congruential and MWC sequences for the simple case of arithmetic modulo 10; here the "registers" are a single digit, adjoining registers are two digits:
Starting with x_0=1, the congruential sequence
x_n=(7x_{n-1}+3),mod,10,
has this sequence of adjoining registers:
10,03,24,31,10,03,24,31,10,ldots,
and the output sequence of x's, (the rightmost register), has period 4:
0,3,4,1,0,3,4,1,0,3,4,1,ldots
Starting with x_0=1,c_0=3, the MWC sequence
x_n=(7x_{n-1}+c_{n-1}),mod,10, c_n=leftlfloorfrac{7x_{n-1}+c_{n-1}}{10}
ight
floor,
has this sequence of adjoining registers
10,01,07,49,67,55,40,04,28,58,61,13,22,16,43,25,37,52,19,64,34,31 10,01,07,...
with output sequence of x's having period 22:
0,1,7,9,7,5,0,4,8,8,1,3,2,6,3,5,7,2,9,4,4,1 0,1,7,9,7,5,0,...
Notice that if those repeated segments of x values are put in reverse order starting from a x_{22n+20},
449275cdots97101,449275cdots9710144cdots
we get the expansion j/(ab−1) with a=7, b=10, j=31:
frac{31}{69}=.4492753623188405797101,4492753623ldots
This is true in general: The sequence of x's produced by a lag-r MWC generator:
x_n=(ax_{n-r}+c_{n-1})mod,b,, c_n=leftlfloorfrac{ax_{n-r}+c_{n-1}}{b}
ight
floor,
when put in reverse order, will be the base-b expansion of a rational j/(abr − 1) for some 0 < j < abr.
Also notice that if, starting with x_0=34, we generate the ordinary congruential sequence
x_n=7x_{n-1},mod,69,
we get the period 22 sequence
31,10,1,7,49,67,55,40,4,28,58,61,13,22,16,43,25,37,52,19,64,34, 31,10,1,7,...
and that sequence, reduced mod 10, is
1,0,1,7,9,7,5,0,4,8,8,1,3,2,6,3,5,7,2,9,4,4, 1,0,1,7,9,7,5,0,...
the same sequence of x's resulting from the MWC sequence.
This is true in general, (but apparently only for lag-1 MWC sequences):
Given initial values x_0,c_0, the sequence x_1,x_2,ldots resulting from the lag-1 MWC sequence
x_n=(ax_{n-1}+c_{n-1}),mod b,, c_n=leftlfloorfrac{ax_{n-1}+c_{n-1}}{b}
ight
floor
is exactly the congruential sequence yn = ayn − 1 mod(ab − 1), reduced modulo b.
Choice of initial value y0 merely rotates the cycle of x's.
Complementary-multiply-with-carry generators[edit]
Establishing the period of a lag-r MWC generator usually entails choosing multiplier a so that p=abr − 1 is prime. If p is a safe prime, then the order of b will be p − 1 or (p − 1)/2. Otherwise, it is likely that p − 1 will have to be factored in order to find the order of b mod p, and p = abr − 1 may be difficult to factor.
But a prime of the form p = abr + 1 will make p−1 easy to factor, so a version of multiply-with-carry that involves the order of b for a prime p = abr + 1 would reduce considerably the computational number theory required to establish the period of a MWC sequence.
Fortunately, a slight modification of the MWC procedure leads to primes of the form abr + 1. The new procedure is called complementary-multiply-with-carry (CMWC),
and the setup is the same as that for lag-r MWC: multiplier a, base b, r + 1 seeds
x0, x1, x2, ..., xr−1, and cr − 1.
There is a slight change in the generation of a new pair (x, c): x_n=(b-1)-(ax_{n-r}+c_{n-1}),mod,b, c_n=leftlfloorfrac{ax_{n-r}+c_{n-1}}{b}
ight
floor.
That is, take the complement, (b−1)−x, when forming the new x.
The resulting sequence of x's produced by the CMWC RNG will have period the order of b in the multiplicative group of residues modulo abr+1, and the output x's, in reverse order, will form the base b expansion of j/(abr+1) for some 0
การแปล กรุณารอสักครู่..

ทฤษฎีทั่วไป [แก้ไข]
ลำดับ MWC จะขึ้นอยู่กับการคำนวณแบบโมดูโลฐานเป็นขมักข = 232 เพราะการคำนวณแบบโมดูโลขที่เป็นไปโดยอัตโนมัติในคอมพิวเตอร์มากที่สุด แต่บางครั้งฐานเช่นข = 232-1 ถูกนำมาใช้เพราะทางคณิตศาสตร์สำหรับโมดูลัส 232-1 ต้องใช้เพียงการปรับตัวง่ายจากที่ 232 และทฤษฎีสำหรับลำดับ MWC ขึ้นอยู่กับโมดูลัส 232 มีความยากลำบากจู้จี้บางหลีกเลี่ยงได้โดยใช้ข = 232 - 1 ในรูปแบบที่พบมากที่สุดของเครื่องกำเนิดไฟฟ้าล่าช้าอา MWC ต้องเป็นขฐานคูณและชุดของ R + 1 ค่าเมล็ดสุ่มประกอบด้วยสารตกค้างอาร์ของขx0, x1, x2, .. , XR-1 และการดำเนินการเริ่มต้น CR-1 <a. ล่าช้า-R ลำดับ MWC แล้วลำดับของคู่ XN, CN กำหนดโดยx_n = (ax_ {} NR + c_ {n-1}) bmod b, c_n = left lfloor frac {ax_ {NR} + c_ {n-1}} {ข} สิทธิ rfloor, n ge R, และการส่งออกเครื่องกำเนิดไฟฟ้า MWC เป็น ลำดับของ x ของXR, XR + 1, XR + 2, ... ระยะเวลาของเครื่องกำเนิดไฟฟ้าล่าช้าอา MWC เป็นคำสั่งของขในกลุ่มคูณของตัวเลขโมดูโล ABR - 1. มันเป็นธรรมเนียมที่จะเลือกเพื่อให้ว่า p = ABR - 1 เป็นสำคัญที่คำสั่งของขสามารถกำหนด เพราะ 2 เป็นสารตกค้างกำลังสองของตัวเลขของรูปแบบ 8k ± 1, B = 232 ไม่สามารถเป็นรากดั้งเดิมของ p = ABR - 1 จึงไม่มีเครื่องปั่นไฟ MWC ฐาน 232 ที่มีระยะเวลาที่เป็นไปได้สูงสุดซึ่งเป็นหนึ่งในความยากลำบาก . ว่าการใช้ข = 232-1 ครอบงำปัญหาทางทฤษฎีกับเครื่องปั่นไฟ MWC ชี้ให้เห็นโดย Couture และแมง Ecuyer (1997) คือบิตที่สำคัญที่สุดคือลำเอียงเล็กน้อย เสริม-คูณกับการพกพาเครื่องกำเนิดไฟฟ้าไม่ใช้ปัญหานี้ "เราจะได้เห็นว่าสำหรับ MWC ประกอบการแต่ละบิตของมูลค่าการส่งออกมีความเป็นธรรมที่เป็นตัวเลขสองหลักไบนารีจะปรากฏขึ้นอย่างเท่าเทียมกันมักจะอยู่ในช่วงเวลาที่เต็มรูปแบบ สถานที่ให้บริการไม่ได้ใช้ร่วมกันโดยกำเนิดสติว. " พวกเขาดูเหมือนจะไม่ได้อธิบายรายละเอียดต่อไปในฐานะที่มีขอบเขตของการมีอคติที่ เครื่องกำเนิดไฟฟ้าเสริม-คูณที่มีการดำเนินการนอกจากนี้ยังต้องใช้เวลาในการคำนวณมากขึ้นเล็กน้อยต่อการทำซ้ำเพื่อให้มีการถ่วงดุลอำนาจที่จะประเมินขึ้นอยู่กับความต้องการการใช้งาน. เปรียบเทียบกับเครื่องปั่นไฟ congruential เชิงเส้น [แก้ไข] เชิงเส้นกำเนิด congruential จะดำเนินการตามx_ {n + 1} = (ax_n + c) bmod 2 ^ {32} เพราะการประมวลผลมากที่สุดทางคณิตศาสตร์มีความสามารถที่จะนำตัวคูณและ x ในปัจจุบันในการลงทะเบียน 32 บิตในรูปแบบผลิตภัณฑ์ 64 บิตในการลงทะเบียนที่อยู่ติดกันและใช้เวลา ต่ำกว่า 32 บิตเป็นผลิตภัณฑ์ที่มีรูปแบบเป็น ครั้ง x bmod 2 ^ {32}. เพิ่ม 32 บิตคที่ลดลงครึ่งหนึ่งจากนั้นจะให้ (ขวาน + c) mod 232 ถ้าสมัยที่ 8 เป็น 3 หรือ 5 และ c คือแปลกฐานผล 232 ลำดับ congruential จะมีระยะเวลา 232 ความล่าช้า-1 คูณกับการพกพาเครื่องกำเนิดไฟฟ้าช่วยให้เราสามารถที่จะทำให้ระยะเวลาเกือบ 263 การดำเนินงานโดยใช้คอมพิวเตอร์เครื่องเดียวกันเหล่านั้นยกเว้นว่าเวลานี้ ครึ่งบนของผลิตภัณฑ์ 64 บิตจะใช้มากกว่าละเว้นหลังจาก 64 บิตจะเกิดขึ้น มันถูกใช้เป็นค่าดำเนินการใหม่ c มากกว่าค่าดำเนินการคงที่ของลำดับ congruential มาตรฐาน: รับขวาน + C 64 บิตแล้วในรูปแบบคใหม่เป็นครึ่งบนของบรรดา 64 บิตและ x ใหม่เป็น ครึ่งล่าง. ด้วยตัวคูณระบุคู่ของค่าที่ป้อนเข้า x แต่ละคจะถูกแปลงเป็นคู่ใหม่, x leftarrow (ขวาน + c) , bmod 2 ^ {32} ค leftarrow ซ้าย lfloor frac {ขวาน + C} {2 ^ {32}} สิทธิ rfloor. ถ้า x และคไม่ได้ทั้งศูนย์แล้วระยะเวลาของผลคูณที่มีการดำเนินการตามลำดับจะเป็นคำสั่งของข = 232 ในกลุ่มของสารตกค้างคูณแบบโมดูโล AB - 1, ที่อยู่, ที่เล็กที่สุดเช่นที่ n = 1 พันล้าน mod (AB - 1) ถ้าเราเลือกของ 28-31 บิตดังกล่าวว่า AB-1 คือ "นายกปลอดภัย" การที่มีทั้งข - 1 และ AB / 2-1 เป็นนายกแล้วระยะเวลาที่จะได้รับ AB / 2-1 ใกล้ 263 ซึ่งในทางปฏิบัติอาจจะเป็นส่วนย่อยที่มีขนาดใหญ่ที่ยอมรับของจำนวนคู่ 32 บิตที่เป็นไปได้ (x, c). ต่อไปนี้เป็นค่าสูงสุดของสำหรับการใช้งานคอมพิวเตอร์ที่ตอบสนองความต้องการดังกล่าวข้างต้นมีความปลอดภัยสภาพที่สำคัญ: บิตใน AB สูงสุดดังกล่าวที่ AB-1 เป็นระยะเวลาที่ปลอดภัยนายกรัฐมนตรี15 216 215-50 = 32718 1072103423 16 216 216-352 = 65184 2135949311 31 232 231-563 = 2147483085 4,611,684,809,394,094,079 32 232 232-178 = 4294967118 9,223,371,654,602,686,463 64 264 264-742 = 18,446,744,073,709,550,874 170,141,183,460,469,224,887,945,252,369,640,456,191 128 2128 2127 2128-10,408 (2128-10,408) -1 256 2256 2255 2256-9166 (2256-9166) -1 512 2512 2512-150,736 2511 (2512-150,736) -1 อย่างไรก็ตามในฐานะที่เป็นนายกปลอดภัยไม่ส่งผลกระทบต่อการสุ่มของ ลำดับหนึ่งอาจแทนเพียงแค่เลือกดังกล่าวว่าคำสั่งของขเป็น AB / 2 - 1 ต่อไปนี้เป็นค่าสูงสุดอีกครั้งของขนาดต่างๆ. บิตใน AB สูงสุดดังกล่าวว่ามีคำสั่งข AB / 2-1 ระยะเวลา216 215-29 15 = 32739 1072791551 16 216 216-22 = 65514 2146762751 31 232 231-68 = 2147483580 4,611,685,872,398,499,839 32 232 232-76 = 4294967220 9,223,371,873,646,018,559 63 264 263-140 = 9,223,372,036,854,775,668 85,070,591,730,234,614,574,571,566,698,273,439,743 64 264 264-116 = 18,446,744,073,709,551,500 170,141,183,460,469,230,661,776,147,440,730,111,999 นี่คือ การเปรียบเทียบของลำดับ congruential และ MWC สำหรับกรณีที่เรียบง่ายของการคำนวณแบบโมดูโล 10; ที่นี่ "" การเป็นหลักเดียวที่อยู่ติดกันมีการลงทะเบียนตัวเลขสองหลัก: เริ่มต้นด้วย x_0 = 1 ลำดับ congruential x_n = (7x_ {n-1} 3) , bmod , 10, มีลำดับของที่อยู่ติดกันนี้ ลงทะเบียน: 10,03,24,31,10,03,24,31,10 ldots, และลำดับการส่งออกของ x ของ (ลงทะเบียนขวาสุด) มีระยะเวลา 4: 0,3,4,1,0, 3,4,1,0,3,4,1, ldots เริ่มต้นด้วย x_0 = 1 c_0 = 3 ลำดับ MWC x_n = (7x_ {n-1} + c_ {n-1}) , bmod 10 c_n = left lfloor frac {7x_ {n-1} + c_ {n-1}} {10} สิทธิ rfloor, มีลำดับของการลงทะเบียนที่อยู่ติดกันนี้10,01,07,49, 67,55,40,04,28,58,61,13,22,16,43,25,37,52,19,64,34,31 10,01,07 ... กับลำดับการส่งออกของ x ของการมี ระยะเวลา 22: 0,1,7,9,7,5,0,4,8,8,1,3,2,6,3,5,7,2,9,4,4,1 0,1, 7,9,7,5,0 ... สังเกตว่าถ้าผู้ที่ซ้ำส่วนของค่า x จะวางในลำดับที่กลับเริ่มต้นจาก x_ {22N + 20} 449,275 cdots97101 449275 cdots9710144 cdots ที่เราได้รับ การขยายตัวเจ / (AB-1) ที่มี = 7, B = 10 เจ = 31: frac {31} {69} = 4492753623188405797101 , 4492753623 ldots. นี้จะเป็นจริงโดยทั่วไป: ลำดับของ x ที่ผลิตโดย ล่าช้าอากำเนิด MWC: x_n = (ax_ {} NR + c_ {n-1}) bmod ข ,, c_n = left lfloor frac {{ax_ NR} + c_ {n-1 }} {ข} สิทธิ rfloor, เมื่อใส่ในลำดับที่กลับจะเป็นการขยายตัวของฐานขของเหตุผลเจ / (ABR - 1). สำหรับบาง 0 <ญ <ABR ยังสังเกตเห็นว่าถ้าเริ่มต้นด้วย x_0 = 34 เราสร้างลำดับ congruential สามัญx_n = 7x_ {n-1} , bmod , 69, เราได้รับระยะเวลา 22 ลำดับ31,10,1,7,49,67,55,40,4,28, 58,61,13,22,16,43,25,37,52,19,64,34, 31,10,1,7 ... และลำดับที่ 10 สมัยที่ลดลงเป็น1,0,1, 7,9,7,5,0,4,8,8,1,3,2,6,3,5,7,2,9,4,4, 1,0,1,7,9,7, 5,0 ... ลำดับเดียวกันของ x ของที่เกิดจากการลำดับ MWC ได้. นี่คือความจริงโดยทั่วไป (แต่เห็นได้ชัดว่าเพียง แต่สำหรับความล่าช้า-1 MWC ลำดับ): ได้รับค่าเริ่มต้น x_0, c_0, x_1 ลำดับ x_2, ldots ที่เกิดจากความล่าช้า-1 ตามลำดับ MWC x_n = (ax_ {n-1} + c_ {n-1}) , bmod ข ,, c_n = left lfloor frac {ax_ {n-1 } + c_ {n-1}} {ข} สิทธิ rfloor ตรงลำดับ congruential yn = Ayn - 1 สมัย (AB - 1) ลดลงขโมดูโล. เลือก y0 ค่าเริ่มต้นเพียงหมุนวงจรของ x ของ. เสริม -multiply กับการพกพาเครื่องกำเนิดไฟฟ้า [แก้ไข] การสร้างช่วงเวลาของความล่าช้า-R กำเนิด MWC มักจะสร้างการเลือกตัวคูณเพื่อให้ p = ABR - 1 เป็นสำคัญ ถ้าหน้าเป็นสำคัญปลอดภัยแล้วคำสั่งของขจะเป็นพี - 1 หรือ (พี - 1) / 2 มิฉะนั้นจะเป็นไปได้ว่าพี - 1 จะต้องมีปัจจัยในการที่จะหาคำสั่งของสมัย p ขและ p = ABR - 1 อาจจะยากที่จะเป็นปัจจัย. แต่ที่สำคัญของรูปแบบพีที่ = ABR + 1 จะทำให้ P-1 ใช้ง่ายปัจจัยดังนั้นรุ่นคูณที่มีการดำเนินการที่เกี่ยวข้องกับคำสั่งของขสำหรับนายก p = ABR + 1 จะลดมากทฤษฎีจำนวนการคำนวณที่จำเป็นในการสร้างช่วงเวลาของการลำดับ MWC ได้. โชคดีที่ การปรับเปลี่ยนเล็กน้อยของขั้นตอน MWC นำไปสู่รูปแบบเฉพาะของ ABR เครื่องหมาย + 1. ขั้นตอนใหม่ที่เรียกว่าเสริม-คูณกับการพกพา (CMWC) และการติดตั้งเป็นเช่นเดียวกับที่ล่าช้าอา MWC: คูณฐาน B, R + 1 เมล็ดx0, x1, x2, ... , XR-1 และ CR - 1. มีการเปลี่ยนแปลงเล็กน้อยในการผลิตของคู่ใหม่คือ (x, c): x_n = (B-1) - (ax_ {NR} + c_ {n-1}) , bmod b, c_n = left lfloor frac {ax_ {NR} + c_ {n-1}} {ข} สิทธิ rfloor. นั่นคือการใช้ส่วนประกอบ (b-1) -x เมื่อขึ้นรูป x ใหม่. ลำดับที่เกิดจาก x ของที่ผลิตโดย CMWC RNG จะมีระยะเวลาในการสั่งซื้อของขในกลุ่มคูณตกค้างโมดูโล ABR + 1 และ x การส่งออกของในลำดับที่กลับจะฟอร์มการขยายตัวของฐานขเจ / นี้ (ABR + 1) สำหรับบาง 0
การใช้ความล่าช้า-R CMWC ทำให้มันง่ายมากที่จะหาช่วงเวลาสำหรับอาร์มีขนาดใหญ่เป็น 512, 1024, 2048 และอื่น ๆ (ทำพลังงานรา 2 ทำให้มันง่ายขึ้นเล็กน้อย (และเร็วขึ้น) ในการเข้าถึงองค์ประกอบในอาร์เรย์ที่มีอาร์มากที่สุด x ล่าสุด). ตัวอย่างบางส่วน: ด้วยข = 232 ระยะเวลาของความล่าช้า 1024 CMWC x_n = (B-1) - (ax_ {n-1024} + c_ {n-1}) , bmod ข . c_n = left lfloor frac {ax_ {n-1024} + c_ {n-1}} {ข} สิทธิ rfloor จะเป็น cdot232762 ประมาณ 109,867 สำหรับทั้งสามเมื่อ: 109111 หรือ 108798 หรือ 108517. กับข = 232 และ = 3636507990, p = ab1359 - 1 เป็นนายกปลอดภัยดังนั้นลำดับ MWC ขึ้นอยู่กับว่ามีระยะเวลา 3636507990 cdot243487 approx1013101. กับข = 232 เป็น RNG CMWC ที่มีระยะเวลาการบันทึกอาจจะอยู่ใกล้ จะขึ้นอยู่กับนายก p = 15455296b42658 + 1 คำสั่งของขสำหรับที่สำคัญคือ 241,489 * 21365056 ประมาณ 10,410,928
การแปล กรุณารอสักครู่..
