JP2011145464A - Device and program for generation of pseudo-random number - Google Patents

Device and program for generation of pseudo-random number Download PDF

Info

Publication number
JP2011145464A
JP2011145464A JP2010005823A JP2010005823A JP2011145464A JP 2011145464 A JP2011145464 A JP 2011145464A JP 2010005823 A JP2010005823 A JP 2010005823A JP 2010005823 A JP2010005823 A JP 2010005823A JP 2011145464 A JP2011145464 A JP 2011145464A
Authority
JP
Japan
Prior art keywords
map
mapping
bijection
bijective
pseudo
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010005823A
Other languages
Japanese (ja)
Other versions
JP5455664B2 (en
Inventor
Chitake Itoi
千岳 糸井
Takashi Iwano
隆 岩野
Hidetoshi Okutomi
秀俊 奥富
Manabu Kaneda
学 金田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nihon University
Toshiba Information Systems Japan Corp
Original Assignee
Nihon University
Toshiba Information Systems Japan Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nihon University, Toshiba Information Systems Japan Corp filed Critical Nihon University
Priority to JP2010005823A priority Critical patent/JP5455664B2/en
Publication of JP2011145464A publication Critical patent/JP2011145464A/en
Application granted granted Critical
Publication of JP5455664B2 publication Critical patent/JP5455664B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To extend a cycle and secure maximum cycle length and uniformity. <P>SOLUTION: The pseudo-random number generating device includes: a bijective mapping preparing means 12 which prepares at least one original bijective mapping and a bijective mapping for cycle extension obtained by mapping calculation of a reverse mapping of the original bijective mapping and an ergodic bijective mapping of the original bijective mapping using a mapping function set by an initial value setter 11; a mapping value calculator 13 which repeats processing to obtain the mapping value using the bijective mapping for cycle extension further after obtaining the mapping value using the original bijective mapping only once, prepared by the bijective mapping preparing means 12; a bit string extractor 15 which extracts a bit string from the mapping value obtained by the mapping value calculator 13; and a pseudo-random number output means 15 which outputs the bit string extracted by the bit string extractor 14 until reaching the bit length set by the initial value setter. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

この発明は、全単射写像を用いて擬似乱数を生成する擬似乱数生成装置及び擬似乱数生成用プログラムに関するものである。   The present invention relates to a pseudo-random number generation device and a pseudo-random number generation program that generate pseudo-random numbers using bijective mapping.

従来の擬似乱数生成装置においては、有限演算実装における非線形(カオス)写像を用いた擬似乱数生成法を採用したものが知られている(特許文献1参照)。この従来例にあっては、全単射を保証しない写像を用いていた。また、全単射を保証するものでも、短周期帯に落ち入ることで長い周期が得られなくなることから、周期を監視する機構が必要であった。   A conventional pseudo-random number generator is known that employs a pseudo-random number generation method using a non-linear (chaos) mapping in a finite operation implementation (see Patent Document 1). In this conventional example, a mapping that does not guarantee bijection is used. In addition, even if it is guaranteed to be bijection, a long period cannot be obtained by falling into the short period band, so a mechanism for monitoring the period is necessary.

また、最大周期と一様性を保証する擬似乱数生成器として線形合同法や、M系列乱数(GFSR:Generalized Feedbacked Shift Register)が知られている。しかしながら、周期が限定されており生成パターンも一方向的に決定されたものを出力する方式であり、生成パターンが限られていた。また、これらの生成法では、一素周期の中で各値が一度だけ出現する。従って、ある値を観測したらその後、その値はその周期中で出現しない。   As a pseudo-random number generator that guarantees the maximum period and uniformity, a linear congruential method and an M-sequence random number (GFSR: Generalized Feedbacked Shift Register) are known. However, the cycle is limited, and the generation pattern is also a method of outputting the one determined in one direction, and the generation pattern is limited. Further, in these generation methods, each value appears only once in a single cycle. Therefore, if a certain value is observed, then that value does not appear in that cycle.

上記GFSRの改良としてTwisted GFSR、メルセンヌツイスターが存在するが、周期を延ばすパラメータ帯が固定値であり、それを探索する必要があるという労力が存在する。   Twisted GFSR and Mersenne Twister exist as an improvement of the GFSR, but the parameter band for extending the period is a fixed value, and there is an effort to search for it.

更に、写像変更ないしは写像変換を用いた擬似乱数生成装置としては、二次元キャットマップのような写像を用いるものが知られている(特許文献2参照)。しかしながら、この二次元キャットマップは暗号化や復号に不適切と言われており、また、周期延長が可能なものでもない。   Further, as a pseudo-random number generation device using mapping change or mapping conversion, a device using a mapping such as a two-dimensional cat map is known (see Patent Document 2). However, this two-dimensional cat map is said to be inappropriate for encryption and decryption, and it is not possible to extend the period.

特開2003−152706号公報JP 2003-152706 A 特開2007−264147号公報JP 2007-264147 A

本発明は上記のような擬似乱数生成における現状に鑑みてなされたもので、その目的は、周期延長を行い、最大周期長と一様性を確保し、かつ大量に乱数を生成することのできる、全単射写像を用いた擬似乱数生成装置及び擬似乱数生成用プログラムを提供することである。   The present invention has been made in view of the present situation in the generation of pseudo-random numbers as described above, and its purpose is to extend the period, ensure the maximum period length and uniformity, and generate a large number of random numbers. Another object of the present invention is to provide a pseudo random number generation device and a pseudo random number generation program using bijective mapping.

本発明に係る擬似乱数生成装置は、擬似乱数の生成に必要な写像関数と擬似乱数のビット長の初期値を設定する初期値設定手段と、この初期値設定手段により設定された写像関数を用いて、少なくとも1つの原全単射写像と、前記原全単射写像の逆写像と前記原全単射写像についてエルゴード的な全単射写像との写像計算により得られる周期延長用全単射写像と、を準備する全単射写像準備手段と、前記全単射写像準備手段により準備された、前記原全単射写像を一度ずつ用いて写像値を得た後に更に前記周期延長用全単射写像を用いて写像値を得る処理を繰り返す写像値計算手段と、前記写像値計算手段により得られた写像値からビット列を抽出するビット列抽出手段と、前記ビット列抽出手段によって抽出されたビット列を前記初期値設定手段により設定されたビット長となるまで出力する擬似乱数出力手段とを具備することを特徴とする。   The pseudorandom number generator according to the present invention uses a mapping function necessary for generating a pseudorandom number, an initial value setting means for setting an initial value of the bit length of the pseudorandom number, and a mapping function set by the initial value setting means. A period extending bijective map obtained by mapping at least one bijective map, a reverse map of the original bijective map, and an ergodic bijective map of the original bijective map. And a bijection mapping preparation means for preparing the periodical extension bijection after obtaining a mapping value by using the original bijection mapping prepared once by the bijection mapping preparation means. A mapping value calculating means for repeatedly obtaining a mapping value using mapping; a bit string extracting means for extracting a bit string from the mapping value obtained by the mapping value calculating means; and a bit string extracted by the bit string extracting means as the initial value. Value setting Characterized by comprising a pseudo-random number output means for outputting to the bit length set by the unit.

本発明に係る擬似乱数生成装置では、全単射写像準備手段は、写像関数として、線形合同法による写像、M系列乱数による写像、変形テント関数による写像、或いは前記以外の手法により作成した全単射写像のいずれかを用いることを特徴とする。   In the pseudo-random number generation device according to the present invention, the bijection mapping preparation means includes a mapping function based on a linear congruence method, a mapping based on an M-sequence random number, a mapping based on a modified tent function, or a mapping method other than the above. One of the projection maps is used.

本発明に係る擬似乱数生成装置では、全単射写像準備手段は、準備した全単射写像の数と全単射写像に含まれる集合の数の乗算により決まる周期毎に、エルゴード的な全単射写像を変更した新たな周期延長用全単射写像を準備することを特徴とする。   In the pseudorandom number generator according to the present invention, the bijection map preparation means includes an ergodic complete unit for each period determined by multiplication of the number of prepared bijection maps and the number of sets included in the bijection map. It is characterized by preparing a new bijective map for period extension with a modified projective map.

本発明に係る擬似乱数生成装置では、全単射写像準備手段は、準備した原全単射写像数の全単射写像がなされた場合に周期延長用全単射写像を準備することを特徴とする。   In the pseudorandom number generation device according to the present invention, the bijection map preparation means prepares a bijection map for period extension when a bijection map of the prepared number of original bijective maps is made. To do.

本発明に係る擬似乱数生成装置では、全単射写像準備手段は、全単射写像数の全単射写像がなされる前に予め周期延長用全単射写像を準備することを特徴とする。   In the pseudorandom number generation device according to the present invention, the bijection map preparation means prepares a period extension bijection map in advance before bijection mapping of the number of bijection maps is made.

本発明に係る擬似乱数生成用プログラムは、擬似乱数を生成するコンピュータを、乱数の生成に必要な写像関数と擬似乱数のビット長の初期値を設定する初期値設定手段、この初期値設定手段により設定された写像関数を用いて、少なくとも1つの原全単射写像と、前記原全単射写像の逆写像と前記原全単射写像についてエルゴード的な全単射写像との写像計算により得られる周期延長用全単射写像と、を準備する全単射写像準備手段、前記全単射写像準備手段により準備された、前記原全単射写像を一度ずつ用いて写像値を得た後に更に前記周期延長用全単射写像を用いて写像値を得る処理を繰り返す写像値計算手段、前記写像値計算手段により得られた写像値からビット列を抽出するビット列抽出手段、前記ビット列抽出手段によって抽出されたビット列を前記初期値設定手段により設定されたビット長となるまで出力する擬似乱数出力手段として機能させることを特徴とする。   The program for generating pseudo-random numbers according to the present invention includes a computer that generates pseudo-random numbers, an initial value setting unit that sets an initial value of a mapping function necessary for generating random numbers and a bit length of pseudo-random numbers, and the initial value setting unit. Using a set mapping function, it is obtained by calculating a map of at least one original bijective map, an inverse map of the original bijective map, and an ergodic bijective map for the original bijective map. A bijection mapping preparation means for preparing a period extension bijection map, a bijection map preparation means prepared by the bijection map preparation means, and after obtaining a map value by using the original bijection map once each further Map value calculation means for repeatedly obtaining a map value using a bijection map for period extension, bit string extraction means for extracting a bit string from the map value obtained by the map value calculation means, and extraction by the bit string extraction means The bit string, characterized in that to function as a pseudo random number output means for outputting to the bit length set by the initial value setting means.

本発明に係る擬似乱数生成用プログラムは、擬似乱数を生成するコンピュータを、全単射写像準備手段として、線形合同法による写像、M系列乱数による写像、変形テント関数による写像、或いは前記以外の手法により作成した全単射写像のいずれかを写像関数として用いるように機能させることを特徴とする。   The program for generating pseudo-random numbers according to the present invention uses a computer that generates pseudo-random numbers as a bijection mapping preparation means, mapping by linear congruential method, mapping by M-sequence random numbers, mapping by modified tent functions, or other methods than the above It is made to function so that any one of the bijection maps created by (1) may be used as a mapping function.

本発明に係る擬似乱数生成用プログラムは、擬似乱数を生成するコンピュータを、全単射写像準備手段として、準備した全単射写像の数と全単射写像に含まれる集合の数の乗算により決まる周期毎に、エルゴード的な全単射写像を変更した新たな周期延長用全単射写像を準備するように機能させることを特徴とする。   The pseudo random number generation program according to the present invention uses a computer that generates pseudo random numbers as a bijection mapping preparation unit, and is determined by multiplying the number of prepared bijection maps by the number of sets included in the bijection map. It is characterized in that it functions so as to prepare a new bijection map for period extension in which the ergodic bijection map is changed for each cycle.

本発明に係る擬似乱数生成用プログラムは、擬似乱数を生成するコンピュータを、全単射写像準備手段として、準備した原全単射写像数の全単射写像がなされた場合に周期延長用全単射写像を準備するように機能させることを特徴とする。   The pseudo-random number generation program according to the present invention uses a computer that generates pseudo-random numbers as a bijection mapping preparation means, and when a bijection map of the prepared original bijection map number is made, It is characterized by functioning to prepare a projective map.

本発明に係る擬似乱数生成用プログラムは、擬似乱数を生成するコンピュータを、全単射写像準備手段として、全単射写像数の全単射写像がなされる前に予め周期延長用全単射写像を準備するように機能させることを特徴とする   The program for generating pseudo-random numbers according to the present invention uses a computer that generates pseudo-random numbers as a bijection mapping preparation unit, and a bijection map for period extension is used in advance before bijection mapping of the number of bijection maps is made. Characterized by functioning to prepare

本発明によれば、少なくとも1つの原全単射写像と、前記原全単射写像の逆写像と前記原全単射写像についてエルゴード的な全単射写像との写像計算により得られる周期延長用全単射写像と、を準備し、準備された、前記原全単射写像を一度ずつ用いて写像値を得た後に更に前記周期延長用全単射写像を用いて写像値を得る処理を繰り返すことにより写像値計算を行うので、周期延長用全単射写像によって周期延長が行われ、最大周期長と一様性を確保することができる。   According to the present invention, at least one original bijective map, an inverse map of the original bijective map, and a period extension obtained by a map calculation of an ergodic bijective map with respect to the original bijective map. The bijection map is prepared, the prepared bijective map is used once to obtain a map value, and then the process of obtaining the map value using the period extending bijection map is repeated. Thus, the map value is calculated, so that the period extension is performed by the bijection map for period extension, and the maximum period length and uniformity can be ensured.

本発明では、全単射写像であれば制限なく利用可能であり、写像の順番の入れ替えや再利用もできるため、生成パターンを豊富に提供することができる。   In the present invention, any bijective map can be used without limitation, and the order of mapping can be changed and reused, so abundant generation patterns can be provided.

本発明の擬似乱数生成装置における全単射族による写像値の周期延長手法について説明するための写像値巡回状態を示す図。The figure which shows the map value cyclic state for demonstrating the period extension method of the map value by a bijection group in the pseudorandom number generator of this invention. 本発明の擬似乱数生成装置における全単射族による写像値の周期延長全単射写像の生成について説明するための図。The figure for demonstrating the production | generation of the period extension bijection map of the map value by the bijection group in the pseudorandom number generation apparatus of this invention. 本発明に係る擬似乱数生成装置の構成を示すブロック図。The block diagram which shows the structure of the pseudorandom number generator which concerns on this invention. 本発明に係る擬似乱数生成装置を構成するコンピュータシステムのブロック図。The block diagram of the computer system which comprises the pseudorandom number generation apparatus which concerns on this invention. 本発明に係る擬似乱数生成装置の第1の実施例の動作を説明するためのフローチャート。The flowchart for demonstrating operation | movement of the 1st Example of the pseudorandom number generator which concerns on this invention. 本発明に係る擬似乱数生成装置の第2の実施例の動作を説明するためのフローチャート。The flowchart for demonstrating operation | movement of the 2nd Example of the pseudorandom number generator which concerns on this invention. 本発明の擬似乱数生成装置における全単射族による写像として、線形合同法を用いた各初期値の列を示す図。The figure which shows the row | line | column of each initial value using the linear congruential method as a mapping by the bijection group in the pseudorandom number generation apparatus of this invention. 本発明の擬似乱数生成装置における全単射族による写像として、M系列(GFSR)を用いた各初期値の列を示す図。The figure which shows the row | line | column of each initial value using M series (GFSR) as a mapping by the bijection group in the pseudorandom number generator of this invention. 本発明の擬似乱数生成装置における全単射族による写像として、M系列(TGFSR)を用いた各初期値の列を示す図。The figure which shows the row | line | column of each initial value using M series (TGFSR) as a mapping by the bijection group in the pseudorandom number generator of this invention. 本発明の擬似乱数生成装置における全単射族による写像として用いる、変形テント写像のマップを示す図。The figure which shows the map of a deformation | transformation tent map used as a map by the bijection group in the pseudorandom number generator of this invention. 本発明の擬似乱数生成装置における全単射族による写像として、変形テント写像を用いた写像遷移を示す図。The figure which shows the map transition using a deformation | transformation tent map as a map by the bijection group in the pseudorandom number generator of this invention.

以下添付図面を参照して、本発明に係る擬似乱数生成装置及び擬似乱数生成用プログラムを説明する。原理は次の通りである。例として次の(式1)に示す有限集合x(集合の数が4)の全単射族の写像“ f0、f1、f2”を3つ用意した場合の、図1の如き写像の列を例とする。 A pseudorandom number generation device and a pseudorandom number generation program according to the present invention will be described below with reference to the accompanying drawings. The principle is as follows. As an example, the map shown in Fig. 1 when three maps "f 0 , f 1 , f 2 " of the all-injection group of the finite set x (the number of sets is 4) shown in the following (Formula 1) is prepared. For example,

Figure 2011145464
Figure 2011145464

これらの漸化式は次の(式2)により表わされる。   These recurrence formulas are expressed by the following (formula 2).

Figure 2011145464
Figure 2011145464

上記において、選択する写像関数fyiの順番yに制限はないが、図1の例では
=(i+1)mod3 (i=0,1,…)を用いている。
In the above description, the order y i of the mapping functions f yi to be selected is not limited, but y i = (i + 1) mod 3 (i = 0, 1,...) Is used in the example of FIG.

上記写像によって繰り返し写像を行って得られる数列は、初期値x=0のとき、
0, 2, 1, 3, 1, 2, 2, 0, 3
を繰り返す周期長9の周期帯(初期値x=2、x=3によっても写像結果である数列のパターンが同じ)が得られる。また、初期値x=1のときには、
1, 3, 0
を繰り返す周期長3の周期帯が得られる。このように例示の写像をそのまま用いた場合には、生成パターンが2つの周期帯に分かれて存在する。
The numerical sequence obtained by repeatedly performing mapping by the above mapping has an initial value x 0 = 0,
0, 2, 1, 3, 1, 2, 2, 0, 3
A periodic band having a cycle length of 9 is obtained (the pattern of the number sequence as the mapping result is the same even with the initial values x 0 = 2 and x 0 = 3). When the initial value x 0 = 1,
1, 3, 0
A period band with a period length of 3 is obtained. Thus, when the example mapping is used as it is, the generation pattern exists in two periodic bands.

このように全単射写像を単に用いただけでは周期帯がいくつかに分かれ、短周期が存在し、各値の出現頻度が一様にならない。係る系として、有限演算下での非線形写像を用いて得られる乱数列があり、長周期性と一様性の保証された擬似乱数列を得ようとした場合に課題となる。   Thus, simply using a bijection map, the periodic bands are divided into several, there are short periods, and the frequency of occurrence of each value is not uniform. As such a system, there is a random number sequence obtained by using a non-linear mapping under a finite operation, which becomes a problem when trying to obtain a pseudo-random number sequence in which long periodicity and uniformity are guaranteed.

ここで、“f2”を理想的な写像“Q”に変更することによって、3種類の写像を用いる場合の最大周期長12を実現し、かつ各値の出現頻度が一様に3となる数列を得ることを可能にする。即ち、長周期性と一様性の保証された擬似乱数列を得るための理想的な全単射写像“Q”を次のようにして作成する。 Here, by changing “f 2 ” to the ideal map “Q”, the maximum period length 12 when three types of maps are used is realized, and the appearance frequency of each value is uniformly 3. Allows you to get a sequence of numbers. That is, an ideal bijection map “Q” for obtaining a pseudo-random number sequence in which long periodicity and uniformity are guaranteed is created as follows.

まず、図1にて用いた全単射写像“f0、f1”の逆写像“f0 -1、f1 -1 ”を生成する。また、エルゴード的な全単射写像“α“を用意する。そして、これら逆写像“f0 -1、f1 -1 ”とエルゴード的な全単射写像“α“を用いて、図2に示すように写像“Q”を作る計算(Q=αf0 -1f1 -1)を実行する。 First, an inverse map “f 0 −1 , f 1 −1 ” of the bijective map “f 0 , f 1 ” used in FIG. 1 is generated. In addition, an ergodic bijective map “α” is prepared. Then, using these inverse maps “f 0 −1 , f 1 −1 ” and the ergodic bijective map “α”, a calculation for creating a map “Q” as shown in FIG. 2 (Q = αf 0 − 1 f 1 -1 ).

このように、図1にて用いた全単射写像“f2”を“Q”に変更することで、初期値x=1のとき
0, 2, 1, 1, 3, 0, 2, 0, 3, 3, 1, 2
を繰り返す最大周期長12の数列が得られ、各値の出現頻度が一様な値(3回)である数列を得ることが可能となる。
Thus, by changing the bijection map “f 2 ” used in FIG. 1 to “Q”, the initial value x 0 = 1 is obtained.
0, 2, 1, 1, 3, 0, 2, 0, 3, 3, 1, 2
It is possible to obtain a numerical sequence having a maximum cycle length of 12 repeating the above, and a numerical sequence in which the appearance frequency of each value is a uniform value (three times).

即ち、図2で用いた全単射写像の数が“3”であり、集合の数が“4”であり、素周期が3種類の全単射写像を用いるとき、その最大周期長は、3×4=12から求められる。そして、上記の通り、各値の出現頻度が一様に3回となっている擬似乱数列が得られていることが分かる。   That is, when the number of bijective maps used in FIG. 2 is “3”, the number of sets is “4”, and three types of bijective maps are used, the maximum period length is It is obtained from 3 × 4 = 12. And as above-mentioned, it turns out that the pseudorandom number sequence in which the appearance frequency of each value is 3 times is obtained.

上記において、選択する写像関数“fyi”(y=imodK:iは写像回数、Kは用意した全単射写像の数)は全単射であれば何でもよく、写像関数“fyi”は1回の写像の度に変更する。 In the above, the mapping function “f yi ” (y i = imodK: i is the number of mappings, K is the number of prepared bijective maps) may be any bijection, and the mapping function “f yi ” is Change every mapping.

図2で用いた周期延長計算に利用する写像“α“はいくつかの周期帯に分かれて短周期に落ちない、最大周期を持つ全単射写像であればよい(本発明において、周期延長計算に利用する写像“α“を「エルゴード的な全単射写像」と呼ぶ)。例えば、写像の集合要素を単純にシフト(f(x)=(x+1)modN ただし、Nは集合の数)したものとすることができる。選択した全単射写像の逆写像とエルゴード的な全単射写像とを用い、周期を延長する写像“Q”を計算して作ることが重要である。これによって、最大周期長と一様性を持つ乱数列を生成可能になることが分かった。   The map “α” used in the period extension calculation used in FIG. 2 may be a bijective map having a maximum period that is divided into several period bands and does not fall into a short period (in the present invention, the period extension calculation is performed). The map “α” used for the above is called an “ergodic bijective map”). For example, the set elements of the mapping can be simply shifted (f (x) = (x + 1) mod N where N is the number of sets). It is important to calculate and create a map “Q” that extends the period using the inverse of the selected bijective map and an ergodic bijective map. As a result, it was found that a random number sequence having the maximum period length and uniformity can be generated.

選択し得る全単射写像は、最大周期をもつ擬似乱数生成方法で知られる線形合同法、M系列(GSFR)、GSFRの周期を延長させた改良版(Twisted GFSR、メルセンヌツイスター等)のような完成されたものを用いることもできるが、短周期帯を含んでいても全単射写像であれば特に制限はない。これらの系では乱数列パターンは決定されているが、全単射写像“fyi”の順番の入れ替えや写像“Q”を変更することで乱数列のパターンを、より豊富に作ることが可能である。 The bijection map that can be selected, such as the linear congruence method known for the pseudorandom number generation method with the maximum period, M series (GSFR), and the improved version with extended GSFR period (Twisted GFSR, Mersenne Twister, etc.) The completed one can also be used, but there is no particular limitation as long as it is a bijection map even if it includes a short period band. In these systems, the random number sequence pattern is determined, but it is possible to create more random number sequence patterns by changing the order of the bijective map “f yi ” or changing the map “Q”. is there.

本発明の実施例に係る擬似乱数生成装置は、図3に示すように構成される。即ち、初期値設定手段11、全単射写像準備手段12、写像値計算手段13、ビット列抽出手段14及び擬似乱数出力手段15を備える。初期値設定手段11は、擬似乱数の生成に必要な写像関数と擬似乱数のビット長の初期値を設定するものである。初期値に関しては、コンピュータシステムのキーボードなどの入力手段から入力することができる。   The pseudorandom number generator according to the embodiment of the present invention is configured as shown in FIG. That is, an initial value setting unit 11, a bijection mapping preparation unit 12, a mapping value calculation unit 13, a bit string extraction unit 14, and a pseudo random number output unit 15 are provided. The initial value setting means 11 sets an initial value of the mapping function and the bit length of the pseudo random number necessary for generating the pseudo random number. The initial value can be input from input means such as a keyboard of a computer system.

全単射写像準備手段12は、上記初期値設定手段11により設定された写像関数を用いて、少なくとも1つの原全単射写像と、上記原全単射写像の逆写像と上記原全単射写像についてエルゴード的な全単射写像との写像計算により得られる周期延長用全単射写像と、を準備するものである。また、写像値計算手段13は、上記全単射写像準備手段12により準備された、上記原全単射写像を一度ずつ用いて写像値を得た後に更に上記周期延長用全単射写像により写像値を得る処理を繰り返すものである。   The bijective mapping preparation means 12 uses the mapping function set by the initial value setting means 11 to at least one original bijective map, an inverse of the original bijective map, and the original bijective. A period extending bijective map obtained by mapping calculation with an ergodic bijective map is prepared. The map value calculation means 13 obtains a map value by using the original bijection map prepared by the bijection map preparation means 12 once, and further maps by the bijection map for period extension. The process of obtaining a value is repeated.

ビット列抽出手段14は、上記写像値計算手段13により得られた写像値からビット列を抽出するものである。擬似乱数出力手段15は、上記ビット列抽出手段14によって抽出されたビット列を上記初期値設定手段11により設定されたビット長となるまで出力するものである。   The bit string extraction unit 14 extracts a bit string from the mapping value obtained by the mapping value calculation unit 13. The pseudo-random number output means 15 outputs the bit string extracted by the bit string extraction means 14 until the bit length set by the initial value setting means 11 is reached.

擬似乱数生成装置は、図4に示されるコンピュータシステム100により実現される。このコンピュータシステム100は、擬似乱数を生成するコンピュータとしてのCPU101と、CPU101が用いる擬似乱数生成用プログラムが格納され、またCPU101が行った演算結果などが記憶されるメモリ102とを備えている。   The pseudorandom number generator is realized by a computer system 100 shown in FIG. The computer system 100 includes a CPU 101 as a computer that generates pseudo-random numbers, and a memory 102 in which a pseudo-random number generation program used by the CPU 101 is stored, and calculation results and the like performed by the CPU 101 are stored.

CPU101には、キーボードやマウスなどのデータを入力するための入力部103と、生成された擬似乱数を表示出力やプリント出力或いは別システムに出力するための出力部104が備えられている。   The CPU 101 includes an input unit 103 for inputting data such as a keyboard and a mouse, and an output unit 104 for outputting the generated pseudo-random number to a display output, a print output, or another system.

このCPU101がメモリ102内の図5に示されるフローチャートに対応する擬似乱数生成用プログラムを実行することによって、図3の各手段として機能する。以下、このフローチャートに基づき擬似乱数生成装置の動作を説明する。スタートとなり、初期化処理を行う(S11)。初期化処理S11においは、例えばシードSeedが与えられ、このシードSeedに基づき予め用意されている写像関数が複数である場合に、1写像関数を選択する。写像関数としては、線形合同法による写像、M系列乱数の写像、GFSR(Generalized Feedbacked Shift Register)の写像、Twisted GFSR(GFSRの改良)の写像、メルセンヌツイスター(TGFSRの改良)の写像、変形テント写像、その他全単射を満たす任意の全単射写像(図2に示した写像等)を用いることができる。1つの写像関数を有する場合には、シードSeedに基づく選択は行われない。シードSeedは、プログラムの立ち上り毎に適当な数値を発生させるなどにより与えられるようにし、シードSeedと写像関数を対応付けたテーブルなどにより関数選択を行う。   The CPU 101 functions as each unit in FIG. 3 by executing a pseudo random number generation program corresponding to the flowchart shown in FIG. The operation of the pseudorandom number generator will be described below based on this flowchart. At the start, initialization processing is performed (S11). In the initialization process S11, for example, a seed Seed is given, and when there are a plurality of mapping functions prepared in advance based on the seed Seed, one mapping function is selected. Mapping functions include linear congruential mapping, M-sequence random number mapping, GFSR (Generalized Feedback Shift Register) mapping, Twisted GFSR (GFSR improvement) mapping, Mersenne Twister (TGFSR improvement) mapping, modified tent mapping Any other bijective map satisfying the bijection (such as the map shown in FIG. 2) can be used. In the case of having one mapping function, selection based on seed Seed is not performed. The seed Seed is given by, for example, generating an appropriate numerical value every time the program starts, and performs function selection using a table that associates the seed Seed with a mapping function.

更に、初期化処理S11においは、シードSeedに基づく写像初期値x0の決定(決定手法は写像関数と同様)、写像回数iを0とする初期化、写像の順番の設定、擬似乱数のランダムビット長nの設定(ユーザによる入力)などが行われる。 Further, the initialization step S11 smell, determines the mapping the initial value x 0 which is based on seeds Seed (determination technique similar to the mapping function), initialization of the mapping count i to 0, setting the order of the mapping random pseudorandom The bit length n is set (input by the user).

ステップS11に続いて、上記で選択した写像関数からK個の全単射写像f0〜fK-1を生成して写像の準備を行う(S12)。ここで準備された全単射写像f0〜fK-1を、上記写像関数から生成したという意味で原全単射写像という。ステップS12の次には、上記ステップS12において準備された原全単射写像を用いて、ステップS11の初期化処理において設定された写像の順番に基づき、写像計算を行って1つの写像値を得る。(S13)。 Following step S11, it generates the K total injective mapping f 0 ~f K-1 from the mapping function selected above and to prepare for mapping (S12). The bijection maps f 0 to f K−1 prepared here are called original bijection maps in the sense that they are generated from the above mapping function. Next to step S12, using the original bijective map prepared in step S12, mapping calculation is performed based on the mapping order set in the initialization process of step S11 to obtain one mapping value. . (S13).

写像計算(S13)では、ステップS12において準備された原単射写像fy1の数がKであるとき、次の(式3)の漸化式により計算を行う。また、関数hによって写像の順番を選択する。

Figure 2011145464
In the mapping calculation (S13), when the number of the original bijection maps f y1 prepared in step S12 is K, the calculation is performed by the following recurrence formula (Formula 3). Further, the order of mapping is selected by the function h.
Figure 2011145464

上記のステップS13において写像値xi+1が得られると、iをi+1へカウントアップし(S14)、ステップS11の初期化処理において設定された位置の所定ビットを抽出してバッファへ蓄積する(S15)。例えば、最下位1ビットを抽出する場合の抽出式は、xi+1&1である。 When the mapping value x i + 1 is obtained in step S13, i is counted up to i + 1 (S14), and a predetermined bit at the position set in the initialization process in step S11 is extracted and stored in the buffer ( S15). For example, the extraction formula for extracting the least significant bit is x i + 1 & 1.

ステップS15に続いて、蓄積したビット列を出力するタイミングであるかを検出し(S16)、YESである場合には蓄積しておいたビット列を出力する(S17)。出力タイミングとしては、(1)バッファが満杯になった時点に出力、(2)システムの要求時に出力、(3)ユーザの要求時に出力のいずれかなどが初期設定される。ステップS16においてNOである場合には、ステップS18へ進む。   Following step S15, it is detected whether it is time to output the accumulated bit string (S16). If YES, the accumulated bit string is output (S17). As the output timing, (1) output when the buffer is full, (2) output when requested by the system, (3) output when requested by the user, or the like is initialized. If NO in step S16, the process proceeds to step S18.

ステップS16においてNOへ分岐するか、またはステップS17における処理が終わると、周期延長用全単射写像を準備するか否かの判定を行う(S18)。つまり、K回の原全単射写像による写像が終わったか検出される。ここで、ステップS18においてYESとなると、ステップS19において周期延長用全単射写像を準備する。   When the process branches to NO in step S16 or when the process in step S17 ends, it is determined whether or not to prepare a bijection map for period extension (S18). That is, it is detected whether or not the mapping by the K-time original bijection mapping has been completed. Here, if “YES” is determined in the step S18, a period extending bijective map is prepared in a step S19.

具体的には、既に述べた通り、原全単射写像“f0、f1・・・、fK-1”の逆写像“f0 -1、f1 -1 ・・・、fK-1 -1”を生成し、また、エルゴード的な全単射写像“α“を用意する。そして、これら逆写像“f0 -1、f1 -1 ・・・、fK-1 -1”とエルゴード的な全単射写像“α“を用いて乗算を行い、写像“Q”を作る。ここで、次の(式4)以降の関係が成り立っている。 Specifically, as already mentioned, an original bijective mapping "f 0, f 1 ···, f K-1" reverse mapping "f 0 -1, f 1 -1 ···, f K- 1 -1 ”is generated, and an ergodic bijection map“ α ”is prepared. Then, the inverse map “f 0 −1 , f 1 −1 ..., F K-1 −1 ” and the ergodic bijective map “α” are multiplied to create the map “Q”. . Here, the relationship after the following (Formula 4) is established.

Figure 2011145464
Figure 2011145464

このステップS19の次には、ステップS13へ進み、ステップS19において準備された周期延長用全単射写像xi+1による写像計算を行って1つの写像値を得る(S13)。一方、上記ステップS18において、NOとなるとステップS20へ進んで、これまでに生成された擬似乱数のランダムビット長が初期設定された長さnとなったかを検出し(S20)、NOであればステップS12へ戻って処理を続け、ステップS20においてYESとなると処理を終了してエンドとなる。 Following this step S19, the process proceeds to step S13, and a map calculation is performed using the period extending bijective map x i + 1 prepared in step S19 to obtain one map value (S13). On the other hand, if NO in step S18, the process proceeds to step S20, where it is detected whether the random bit length of the pseudo-random number generated so far has become the initially set length n (S20). Returning to step S12, the process is continued, and when YES is determined in step S20, the process ends and the process is ended.

このように、全単射写像準備手段12は、準備した全単射写像の数と全単射写像に含まれる集合の数の乗算により決まる周期毎に、エルゴード的な全単射写像を変更した新たな周期延長用全単射写像を準備するものである。そして、上記図5に示されるフローチャートでは、全単射写像準備手段12が、準備した原全単射写像数の全単射写像がなされた場合に周期延長用全単射写像を準備する(ステップS19)ことを示した。しかし、これによらず、次の図6のフローチャートに示すように、全単射写像数の全単射写像がなされる前に予め周期延長用全単射写像を準備する(ステップS30)としても良い。   In this way, the bijective map preparation means 12 changed the ergodic bijective map for each period determined by the multiplication of the number of prepared bijective maps and the number of sets included in the bijective map. A new bijective map for period extension is prepared. In the flowchart shown in FIG. 5, the bijection map preparation means 12 prepares a bijection map for period extension when the bijection map of the prepared original bijection map number is made (step S19). However, regardless of this, as shown in the flowchart of FIG. 6, the bijection map for period extension is prepared in advance before the bijection map of the bijection map number is made (step S30). good.

図6のフローチャートにおいては、ステップS30において、ステップS11で選択した写像関数からK個の全単射写像f0〜fK-1を生成して写像の準備を行うと共に、原全単射写像“f0、f1・・・、fK-1”の逆写像“f0 -1、f1 -1 ・・・、fK-1 -1”を生成し、また、エルゴード的な全単射写像“α“を用意する。そして、これら逆写像“f0 -1、f1 -1 ・・・、fK-1 -1”とエルゴード的な全単射写像“α“を用いて乗算を行い、写像“Q”を作る。 In the flowchart of FIG. 6, in step S30, K bijective maps f 0 to f K-1 are generated from the map function selected in step S11 to prepare the map, and the original bijective map “ f 0 , f 1 ..., f K-1 ”and the inverse map“ f 0 −1 , f 1 −1 ..., f K-1 −1 ”is generated, and ergodic bijection Prepare the map “α”. Then, the inverse map “f 0 −1 , f 1 −1 ..., F K-1 −1 ” and the ergodic bijective map “α” are multiplied to create the map “Q”. .

作成した写像“Q”は、処理に備えてメモリ102内のバッファに格納しておき、必要な周期においてステップS13において用いる。エルゴード的な全単射写像“α“は、写像の集合要素を単純にシフト(f(x)=(x+1)modN ただし、Nは集合の数)したものとすることができる。この場合、1周期毎にシフト量を変化させるなどして1周期毎に異なるαを作成し、これを用いて周期延長用全単射写像を準備するようにしても良い。1周期毎に異なるαを作成することは、図5のフローチャートにおいてステップS19で行うようにしても良い。   The created map “Q” is stored in a buffer in the memory 102 in preparation for processing, and used in step S13 in a necessary cycle. The ergodic bijective map “α” can be obtained by simply shifting the set elements of the map (f (x) = (x + 1) mod N, where N is the number of sets). In this case, a different α may be created for each period by changing the shift amount for each period, and a bijection map for period extension may be prepared using this α. Creating a different α for each period may be performed in step S19 in the flowchart of FIG.

図6のフローチャートにおいてステップS30以外では、図5のフローチャートにおける、周期延長用全単射写像を準備するか否かの判定を行うステップS18と周期延長用全単射写像を準備するステップS19の処理が削除される。また、ステップS20において、NOへ分岐するとステップS13へ戻って処理を続ける。これ以外は、図5において説明した処理と同様の処理が行われる。   In the flowchart of FIG. 6, except for step S30, the process of step S18 for determining whether or not to prepare a period extension bijection map and the step S19 of preparing a period extension bijection map in the flowchart of FIG. Is deleted. In step S20, if branched to NO, the process returns to step S13 to continue the processing. Except for this, the same processing as that described in FIG. 5 is performed.

次に、写像関数を線形合同法の写像とした場合に行われる擬似乱数生成処理の一例を説明する。一般的に利用されている線形合同法の式は次の(式5)で与えられる。   Next, an example of pseudorandom number generation processing performed when the mapping function is a linear congruential mapping will be described. A commonly used linear congruential equation is given by the following (Equation 5).

Figure 2011145464
Figure 2011145464

例としてM=7とした場合、a=2,c=0の時、全単射写像“f0”とすると As an example, if M = 7, and a = 2 and c = 0, the bijection map “f 0

Figure 2011145464
Figure 2011145464

上記(式6)による列は、初期値X0 =1のとき、
1,2,4を繰り返す周期長3の周期帯と、
初期値X0 =3のとき
3,6,5を繰り返す周期長3の周期帯との計2つの周期帯が存在する。
The column according to (Equation 6) above has an initial value X 0 = 1,
A period band of period length 3 that repeats 1, 2, 4;
When the initial value X 0 = 3, there are a total of two period bands, including a period band with a period length of 3 that repeats 3, 6, and 5.

a=5,c=0のとき、全単射写像“f1”とすると When a = 5 and c = 0, if the bijection map is “f 1

Figure 2011145464
Figure 2011145464

上記(式7)から
1,5,4,6,2,3の最大周期長6で循環する列が得られる。
2つの全単射写像“f0、f1”と、最大周期と一様性を実現する写像“Q”を用いて写像の列を作る。“f0、f1”の逆写像“f0 -1、f1 -1 ”と、ここでエルゴード的な全単射写像αは、次の通りである。
From the above (Equation 7), a row that circulates with a maximum period length 6 of 1, 5, 4, 6, 2, 3 is obtained.
A map sequence is created using two bijective maps “f 0 , f 1 ” and a map “Q” that realizes the maximum period and uniformity. "F 0, f 1" reverse mapping "f 0 -1, f 1 -1 " and, here ergodic bijective mapping alpha, is as follows.

Figure 2011145464
Figure 2011145464

このような全単射写像“α“と、上記逆写像“f0 -1、f1 -1 ”を用意して最大周期と一様性を実現する写像“Q”をQ=αf0 -1f1 -1により計算すると By preparing such a bijection map “α” and the inverse map “f 0 −1 , f 1 −1 ”, a map “Q” that realizes the maximum period and uniformity is Q = αf 0 −1. Calculating with f 1 -1

Figure 2011145464
Figure 2011145464

が得られ、“f→f→Q”の各初期値から得られる列は、図7のようになる。初期値が1の場合
1, 2, 3, 2, 4, 6, 3, 6, 2, 4, 1, 5, 5, 3, 1, 6, 5, 4
になり、最大周期長が3×6=18である、一様な出現頻度を満たす数列が得られる。
FIG. 7 shows a column obtained from the initial values of “f 0 → f 1 → Q”. When the initial value is 1
1, 2, 3, 2, 4, 6, 3, 6, 2, 4, 1, 5, 5, 3, 1, 6, 5, 4
Thus, a sequence satisfying a uniform appearance frequency with a maximum period length of 3 × 6 = 18 is obtained.

次に、写像関数をM系列乱数で知られるGFSR(Generalized Feedbacked Shift Register)の写像とした場合に行われる擬似乱数生成処理の一例を説明する。GFSRの漸化式は(式8)の通りであり、ここでn=3,m=1の場合には、(式9)となる。   Next, an example of pseudo-random number generation processing performed when the mapping function is a mapping of a GFSR (Generalized Feedback Shift Register) known by M-sequence random numbers will be described. The recurrence formula of GFSR is as (Equation 8). Here, when n = 3 and m = 1, (Equation 9) is obtained.

Figure 2011145464
Figure 2011145464

これにより、周期長7(2n-1)の循環する数列が生成できる。GFSRの全単射写像を“f0”とすると、f0は次の(式10)となる。 As a result, a circulating numerical sequence having a cycle length of 7 (2 n −1) can be generated. Assuming that the bijection map of the GFSR is “f 0 ”, f 0 is expressed by the following (Equation 10).

Figure 2011145464
Figure 2011145464

次に、“ f0” と最大周期と一様性を実現する写像“Q”を用いて写像の列を作る。なお、GFSRでは設定の自由度が初期値x0のみであり、数列のパターンは1つだけである。“f0”の逆写像“f0 -1”と、ここでエルゴード的な全単射写像αは、次の通りである。 Next, a map sequence is created using “f 0 ” and a map “Q” that realizes the maximum period and uniformity. Incidentally, the degree of freedom in setting the GFSR is only the initial value x 0, the pattern of the sequence is only one. "F 0" and the inverse mapping "f 0 -1", here ergodic bijective mapping alpha, is as follows.

Figure 2011145464
Figure 2011145464

このような全単射写像“α“と、上記逆写像“f0 -1”を用意して最大周期と一様性を実現する写像 “Q”をQ=αf0 -1により計算すると次のQが得られる。 When such a bijection map “α” and the above inverse map “f 0 −1 ” are prepared and a map “Q” that realizes the maximum period and uniformity is calculated by Q = αf 0 −1 , the following is obtained. Q is obtained.

Figure 2011145464
Figure 2011145464

とQを用いて、“f→Q”とする写像を繰り返し、各初期値から得られる数列は図8に示す通りとなる。初期値が1の場合
1, 4, 2, 5, 3, 1, 4, 2, 5, 6, 6, 7, 7, 3, 1
となり、最大周期長が2×7=14であり、一様な出現頻度を満たす数列が得られる。
The mapping of “f 0 → Q” is repeated using f 0 and Q, and the numerical sequence obtained from each initial value is as shown in FIG. When the initial value is 1
1, 4, 2, 5, 3, 1, 4, 2, 5, 6, 6, 7, 7, 3, 1
Thus, the maximum cycle length is 2 × 7 = 14, and a numerical sequence satisfying a uniform appearance frequency is obtained.

次に、写像関数をM系列乱数で知られるGFSRの改良版であるTGFSR(Twisted Generalized Feedbacked Shift Register)を含む写像とした場合に行われる擬似乱数生成処理の一例を説明する。TGFSRの漸化式は次の(式11)により表わされ、Aは次のような行列である。   Next, an example of pseudo-random number generation processing performed when the mapping function is a mapping including TGFSR (Twisted Generalized Feedback Shift Shift Register), which is an improved version of GFSR known by M-sequence random numbers, will be described. The recurrence formula of TGFSR is expressed by the following (formula 11), and A is the following matrix.

Figure 2011145464
Figure 2011145464

上記行列の最下行におけるベクトルaが最大周期を実現するものを選択すれば、周期は2nω-1になる。ここでn=2,m=1,ω=2の場合には、(式11)は次の(式12)の漸化式となるので、この漸化式を計算する。 If the vector a in the bottom row of the matrix is selected to achieve the maximum period, the period will be 2 nω-1 . Here, when n = 2, m = 1, and ω = 2, (Equation 11) becomes the recurrence formula of the following (Equation 12), and this recurrence formula is calculated.

Figure 2011145464
Figure 2011145464

Aの行列を次の通りとして、全単射写像を計算すると、次の“f0”が得られる。 When the bijection map is calculated with the matrix of A as follows, the following “f 0 ” is obtained.

Figure 2011145464
Figure 2011145464

上記“ f0”の写像は、
1,8,10,14,11,6の周期長6の列と
2,4,5,13,7,9の周期長6の列と
3,12,15の周期長3の列との、3つの短周期からなる周期帯を持つ。このため“f0”単独では最大周期が得られず、TGFSRとはならない。
The map of “f 0 ” above is
1, 8, 10, 14, 11, 6 with a period length of 6, 2, 4, 5, 13, 7, 9 with a period length of 6, and 3, 12, 15 with a period length of 3, It has a periodic band consisting of three short periods. For this reason, “f 0 ” alone does not provide the maximum period and does not result in TGFSR.

Aの行列を次の通りとして、全単射写像を計算すると“f1”が得られる。 When the bijection map is calculated with the matrix of A as follows, “f 1 ” is obtained.

Figure 2011145464
上記“ f1”の写像では、
1, 12, 15, 7, 13, 3, 8, 10, 14, 11, 2, 4, 5, 9, 6
の最大周期を実現する周期長15の数列が得られる。“f1”はエルゴード的であり、TGFSRであるといえる。“f0”の逆写像“f0 -1 ”と、“f1”の逆写像“f1 -1 ”と、更に、ここでエルゴード的な全単射写像αとを次の通りに用意する。
Figure 2011145464
In the map of “f 1 ” above,
1, 12, 15, 7, 13, 3, 8, 10, 14, 11, 2, 4, 5, 9, 6
A numerical sequence with a period length of 15 that realizes the maximum period is obtained. “F 1 ” is ergodic and can be said to be TGFSR. Reverse mapping "f 0""f 0 -1 ", the inverse mapping "f 1 -1" of "f 1", further, wherein preparing the ergodic bijective mapping α as follows .

Figure 2011145464
Figure 2011145464

最大周期と一様性を実現する写像 “Q”をQ=αf0 -1f1 -1により計算すると、次のQが得られる。 When the map “Q” realizing the maximum period and uniformity is calculated by Q = αf 0 −1 f 1 −1 , the following Q is obtained.

Figure 2011145464
Figure 2011145464

そして、“f→f→Q”の各初期値から得られる列は、図9に示す通りとなる。初期値が1の場合、
1, 8, 10, 2, 4, 5, 3, 12, 15, 4, 5, 9, 5, 13, 3, 6, 1, 12, 7, 9, 6, 8, 10, 14, 9, 2, 4, 10, 14, 11, 11, 6, 1, 12, 15, 7, 13, 7, 13, 14, 11, 2, 15, 3, 8
で循環し、最大周期長が3×15=45となり、一様な出現頻度を満たす数列が得られる。
The columns obtained from the initial values of “f 0 → f 1 → Q” are as shown in FIG. If the initial value is 1,
1, 8, 10, 2, 4, 5, 3, 12, 15, 4, 5, 9, 5, 13, 3, 6, 1, 12, 7, 9, 6, 8, 10, 14, 9, 2, 4, 10, 14, 11, 11, 6, 1, 12, 15, 7, 13, 7, 13, 14, 11, 2, 15, 3, 8
And the maximum cycle length is 3 × 15 = 45, and a number sequence satisfying a uniform appearance frequency is obtained.

この設計において、一般に任意のn,ωでは全単射写像が2ω−1+1個存在する。従って、全単射写像の周期を最低でも2ω−1+1とすることができる。このとき、擬似乱数列の素周期は、(2ω−1+1)(2−1)となり、各値の出現頻度は一様に、2ω−1+1となる。例えば、ω=32,n=624のとき、素周期は(231+1)(219968−1)となり、同じ演算精度32ビットで、状態の次元が32×624であるメルセンヌツイスター19937の周期219937−1より、遥かに長い周期列が得られる。 In this design, there are generally 2 ω−1 +1 bijection maps at arbitrary n and ω. Therefore, the period of the bijection map can be at least 2 ω−1 +1. At this time, the prime period of the pseudo random number sequence is (2 ω−1 +1) (2 −1), and the appearance frequency of each value is uniformly 2 ω−1 +1. For example, when ω = 32 and n = 624, the prime period is (2 31 +1) (2 19968 −1), the same calculation accuracy is 32 bits, and the period 2 of the Mersenne Twister 19997 whose state dimension is 32 × 624 A much longer periodic train is obtained than 19937-1 .

次に、写像関数を、一次元写像を用いた全単射族である変形テント写像とした場合に行われる擬似乱数生成処理の一例を説明する。演算精度Lビットとした時、演算幅N=2−1で表した変形テント写像式は次の式の通りであり、変形テント写像のマップを図10に示す。 Next, an example of pseudorandom number generation processing performed when the mapping function is a modified tent mapping that is a bijection group using a one-dimensional mapping will be described. When the calculation accuracy is L bits, the modified tent mapping formula expressed by the calculation width N = 2 L −1 is as follows, and a map of the modified tent mapping is shown in FIG.

Figure 2011145464
Figure 2011145464

上記変形テント写像式から用意できる全単射写像の数をKとすると、下記のように各写像“fM j”の全単射写像を用意できる。ここで、用意できる全単射写像の最大個数は、K≦Nである。また、逆写像“fM j −1”は次の通りとなる。 When the number of bijective maps that can be prepared from the modified tent map equation is K, bijective maps of each map “f M j ” can be prepared as follows. Here, the maximum number of bijective maps that can be prepared is K ≦ N. The inverse map “f M j −1 ” is as follows.

Figure 2011145464
Figure 2011145464

更に、エルゴード的な全単射写像“α“を用意し、次式のように写像“Q”を作る計算を実行する。   Further, an ergodic bijective map “α” is prepared, and a calculation for creating a map “Q” is executed as in the following equation.

Figure 2011145464
Figure 2011145464

上記のように、用意したK個の写像“fM j“によってK回分の写像計算を行った後、写像“Q”を適応して、図11に示すようにサイクリックに写像を行う。このばあいにおいて、各全単射写像“fM j“の集合の要素数は演算精度のN+1であることから、素周期(N+1)(K+1)であり、各値はK+1回出現する。素周期長はK=Nの時(N+1)であり、一様性が保証された擬似乱数列を得ることができる。 As described above, after K maps are calculated using the prepared K maps “f M j ”, the map “Q” is applied to perform cyclic mapping as shown in FIG. In this case, since the number of elements in the set of each bijection map “f M j ” is N + 1 of the calculation accuracy, it is a prime period (N + 1) (K + 1), and each value appears K + 1 times. The prime cycle length is (N + 1) 2 when K = N, and a pseudo-random number sequence with guaranteed uniformity can be obtained.

11 初期値設定手段
12 全単射写像準備手段
13 写像値計算手段
14 ビット列抽出手段
15 擬似乱数出力手段
100 コンピュータシステム
102 メモリ
103 入力部
104 出力部
11 Initial value setting means 12 Bijection mapping preparation means 13 Mapping value calculation means 14 Bit string extraction means 15 Pseudorandom number output means 100 Computer system 102 Memory 103 Input section 104 Output section

Claims (10)

擬似乱数の生成に必要な写像関数と擬似乱数のビット長の初期値を設定する初期値設定手段と、
この初期値設定手段により設定された写像関数を用いて、少なくとも1つの原全単射写像と、前記原全単射写像の逆写像と前記原全単射写像についてエルゴード的な全単射写像との写像計算により得られる周期延長用全単射写像と、を準備する全単射写像準備手段と、
前記全単射写像準備手段により準備された、前記原全単射写像を一度ずつ用いて写像値を得た後に更に前記周期延長用全単射写像を用いて写像値を得る処理を繰り返す写像値計算手段と、
前記写像値計算手段により得られた写像値からビット列を抽出するビット列抽出手段と、
前記ビット列抽出手段によって抽出されたビット列を前記初期値設定手段により設定されたビット長となるまで出力する擬似乱数出力手段と
を具備することを特徴とする擬似乱数生成装置。
An initial value setting means for setting a mapping function necessary for generating a pseudo-random number and an initial value of the bit length of the pseudo-random number;
Using the mapping function set by the initial value setting means, at least one original bijective map, an inverse map of the original bijective map, and an ergodic bijective map for the original bijective map, A bijection map preparation means for preparing a bijection map for period extension obtained by the map calculation of
A map value prepared by the bijective map preparation means, wherein a map value is obtained by using the original bijective map once, and then a process of obtaining a map value by using the period extending bijective map is repeated. Calculation means;
A bit string extracting means for extracting a bit string from the mapped value obtained by the mapped value calculating means;
And a pseudo-random number output unit that outputs the bit string extracted by the bit string extraction unit until the bit length set by the initial value setting unit is reached.
全単射写像準備手段は、写像関数として、線形合同法による写像、M系列乱数による写像、変形テント関数による写像、或いは前記以外の手法により作成した全単射写像のいずれかを用いることを特徴とする請求項1に記載の擬似乱数生成装置。   The bijection mapping preparation means uses any one of a mapping by a linear congruential method, a mapping by an M-sequence random number, a mapping by a modified tent function, or a bijection map created by a method other than the above as a mapping function. The pseudorandom number generation device according to claim 1. 全単射写像準備手段は、準備した全単射写像の数と全単射写像に含まれる集合の数の乗算により決まる周期毎に、エルゴード的な全単射写像を変更した新たな周期延長用全単射写像を準備することを特徴とする請求項1または2に記載の擬似乱数生成装置。   The bijective mapping preparation means a new cycle extension that changes the ergodic bijective map for each cycle determined by multiplying the number of prepared bijective maps by the number of sets included in the bijective map. 3. The pseudorandom number generator according to claim 1 or 2, wherein a bijection map is prepared. 全単射写像準備手段は、準備した原全単射写像数の全単射写像がなされた場合に周期延長用全単射写像を準備することを特徴とする請求項1乃至3のいずれか1項に記載の擬似乱数生成装置。   The bijection map preparation means prepares a bijection map for period extension when a bijection map having the prepared number of original bijective maps is made. The pseudo-random number generator according to item. 全単射写像準備手段は、全単射写像数の全単射写像がなされる前に予め周期延長用全単射写像を準備することを特徴とする請求項1乃至3のいずれか1項に記載の擬似乱数生成装置。   The bijection map preparation means prepares a bijection map for period extension in advance before bijection mapping of the number of bijection maps is made. The pseudorandom number generator described. 擬似乱数を生成するコンピュータを、
擬似乱数の生成に必要な写像関数と擬似乱数のビット長の初期値を設定する初期値設定手段、
この初期値設定手段により設定された写像関数を用いて、少なくとも1つの原全単射写像と、前記原全単射写像の逆写像と前記原全単射写像についてエルゴード的な全単射写像との写像計算により得られる周期延長用全単射写像と、を準備する全単射写像準備手段、
前記全単射写像準備手段により準備された、前記原全単射写像を一度ずつ用いて写像値を得た後に更に前記周期延長用全単射写像を用いて写像値を得る処理を繰り返す写像値計算手段、
前記写像値計算手段により得られた写像値からビット列を抽出するビット列抽出手段、
前記ビット列抽出手段によって抽出されたビット列を前記初期値設定手段により設定されたビット長となるまで出力する擬似乱数出力手段
として機能させる擬似乱数生成用プログラム。
A computer that generates pseudo-random numbers,
An initial value setting means for setting an initial value of a mapping function necessary for generating a pseudorandom number and a bit length of the pseudorandom number;
Using the mapping function set by the initial value setting means, at least one original bijective map, an inverse map of the original bijective map, and an ergodic bijective map for the original bijective map, A bijection map preparation means for preparing a bijection map for period extension obtained by the map calculation of
A map value prepared by the bijective map preparation means, wherein a map value is obtained by using the original bijective map once, and then a process of obtaining a map value by using the period extending bijective map is repeated. Calculation means,
A bit string extracting means for extracting a bit string from the mapped value obtained by the mapped value calculating means;
A pseudorandom number generation program that functions as a pseudorandom number output unit that outputs a bit string extracted by the bit string extraction unit until a bit length set by the initial value setting unit is reached.
擬似乱数を生成するコンピュータを、
全単射写像準備手段として、線形合同法による写像、M系列乱数による写像、変形テント関数による写像、或いは前記以外の手法により作成した全単射写像のいずれかを写像関数として用いるように機能させることを特徴とする請求項6に記載の擬似乱数生成用プログラム。
A computer that generates pseudo-random numbers,
As a bijection mapping preparation means, a function using any one of a mapping by a linear congruential method, a mapping by an M-sequence random number, a mapping by a modified tent function, or a bijection mapping created by a method other than the above is used as a mapping function. The pseudo-random number generation program according to claim 6.
擬似乱数を生成するコンピュータを、
全単射写像準備手段として、準備した全単射写像の数と全単射写像に含まれる集合の数の乗算により決まる周期毎に、エルゴード的な全単射写像を変更した新たな周期延長用全単射写像を準備するように機能させることを特徴とする請求項6または7に記載の擬似乱数生成装置。
A computer that generates pseudo-random numbers,
As a bijection mapping preparation means, for a new period extension by changing the ergodic bijection map for each period determined by multiplying the number of prepared bijection maps and the number of sets included in the bijection map The pseudo-random number generation device according to claim 6 or 7, wherein the pseudo-random number generation device functions to prepare a bijection map.
擬似乱数を生成するコンピュータを、
全単射写像準備手段として、準備した原全単射写像数の全単射写像がなされた場合に周期延長用全単射写像を準備するように機能させることを特徴とする請求項6乃至8のいずれか1項に記載の擬似乱数生成用プログラム。
A computer that generates pseudo-random numbers,
9. A bijective map preparation means that functions so as to prepare a bijective map for period extension when a bijective map of the prepared number of original bijective maps is made. The pseudorandom number generation program according to any one of the above.
擬似乱数を生成するコンピュータを、
全単射写像準備手段として、全単射写像数の全単射写像がなされる前に予め周期延長用全単射写像を準備するように機能させることを特徴とする請求項6乃至8のいずれか1項に記載の擬似乱数生成用プログラム。
A computer that generates pseudo-random numbers,
9. The bijection map preparation means is made to function so as to prepare a bijection map for period extension in advance before bijection maps of the number of bijective maps are made. Or the pseudo random number generation program according to item 1.
JP2010005823A 2010-01-14 2010-01-14 Pseudorandom number generator and pseudorandom number generation program Active JP5455664B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010005823A JP5455664B2 (en) 2010-01-14 2010-01-14 Pseudorandom number generator and pseudorandom number generation program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010005823A JP5455664B2 (en) 2010-01-14 2010-01-14 Pseudorandom number generator and pseudorandom number generation program

Publications (2)

Publication Number Publication Date
JP2011145464A true JP2011145464A (en) 2011-07-28
JP5455664B2 JP5455664B2 (en) 2014-03-26

Family

ID=44460377

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010005823A Active JP5455664B2 (en) 2010-01-14 2010-01-14 Pseudorandom number generator and pseudorandom number generation program

Country Status (1)

Country Link
JP (1) JP5455664B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019068392A (en) * 2017-10-03 2019-04-25 利和 石崎 Certificate issuance and authentication system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001013870A (en) * 1999-06-29 2001-01-19 Nec Corp Method of common key enciphering or deciphering, and recording medium with common key ciphering or deciphering program recorded thereon
WO2008114829A1 (en) * 2007-03-19 2008-09-25 Tokyo Denki University Encryption device, decryption device, encryption program, decryption program, and recording medium
JP2011123693A (en) * 2009-12-11 2011-06-23 Netcomsec Co Ltd Method, apparatus and program for determining period of integer sequence

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001013870A (en) * 1999-06-29 2001-01-19 Nec Corp Method of common key enciphering or deciphering, and recording medium with common key ciphering or deciphering program recorded thereon
WO2008114829A1 (en) * 2007-03-19 2008-09-25 Tokyo Denki University Encryption device, decryption device, encryption program, decryption program, and recording medium
JP2011123693A (en) * 2009-12-11 2011-06-23 Netcomsec Co Ltd Method, apparatus and program for determining period of integer sequence

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
CSNG200900442005; 吉岡  大三郎  他: '線形再帰方程式に基づく非線形フィードバックシフトレジスタの最大周期系列設計' 電子情報通信学会技術研究報告 Vol.109  No.112, 20090624, p.31-34, 社団法人電子情報通信学会 *
CSNG201000113001; 伊東  徹: '全単射関数の帰還周期長について' 電子情報通信学会技術研究報告 Vol.109  No.337, 20091209, p.1-6, 社団法人電子情報通信学会 *
JPN6013063986; 伊東  徹: '全単射関数の帰還周期長について' 電子情報通信学会技術研究報告 Vol.109  No.337, 20091209, p.1-6, 社団法人電子情報通信学会 *
JPN6013063988; 吉岡  大三郎  他: '線形再帰方程式に基づく非線形フィードバックシフトレジスタの最大周期系列設計' 電子情報通信学会技術研究報告 Vol.109  No.112, 20090624, p.31-34, 社団法人電子情報通信学会 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019068392A (en) * 2017-10-03 2019-04-25 利和 石崎 Certificate issuance and authentication system
JP7098099B2 (en) 2017-10-03 2022-07-11 利和 石崎 Certificate issuance and authentication system

Also Published As

Publication number Publication date
JP5455664B2 (en) 2014-03-26

Similar Documents

Publication Publication Date Title
CA2633923C (en) Mixed radix number generator with chosen statistical artifacts
US10359996B2 (en) Random number generator and stream cipher
JP4851493B2 (en) Mixed radix conversion with a priori defined statistical artifact
Bauke et al. Random numbers for large-scale distributed Monte Carlo simulations
Merah et al. A pseudo random number generator based on the chaotic system of Chua’s circuit, and its real time FPGA implementation
CN103098018B (en) Bit sequence generator
CN108139889A (en) Pseudo-random number sequence is generated by the non-linear mixing of multiple auxiliary pseudo-random number generator
JP5670849B2 (en) Pseudorandom number generation device and pseudorandom number generation method
KR20080063510A (en) Method of generating pseudo-random numbers
Drukker et al. Generating halton sequences using mata
JP5455664B2 (en) Pseudorandom number generator and pseudorandom number generation program
Hill Practical distribution of random streams for stochastic high performance computing
JP4709685B2 (en) Pseudorandom number generation device, pseudorandom number generation method, pseudorandom number generation program, encryption device, and decryption device
JP2018503862A5 (en)
US20100005129A1 (en) Method and apparatus for generating a random bit stream
Mocanu et al. Global feedback self-programmable cellular automaton random number generator
KR101630791B1 (en) Method of generating true random number from pseudo random number and computer readable medium
CN102904715A (en) Parallel pseudorandom bit generator based on coupling chaotic mapping system
JP2011123693A (en) Method, apparatus and program for determining period of integer sequence
Adak et al. Maximal length cellular automata in GF (q) and pseudo-random number generation
JP2007041199A5 (en)
JP2017058501A (en) Hash function calculation device and method
JP4547534B2 (en) Pseudorandom number generator strength evaluation device and encryption device
Mukherjee et al. High-speed on-chip event counters for embedded systems
JP5268741B2 (en) Pseudorandom number generator, pseudorandom number generation method, and pseudorandom number generation program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20121220

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131220

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140107

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140107

R150 Certificate of patent or registration of utility model

Ref document number: 5455664

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250