JPH04182828A - In-table entry selection method using pseudo-random numbers - Google Patents
In-table entry selection method using pseudo-random numbersInfo
- Publication number
- JPH04182828A JPH04182828A JP2313223A JP31322390A JPH04182828A JP H04182828 A JPH04182828 A JP H04182828A JP 2313223 A JP2313223 A JP 2313223A JP 31322390 A JP31322390 A JP 31322390A JP H04182828 A JPH04182828 A JP H04182828A
- Authority
- JP
- Japan
- Prior art keywords
- pseudo
- entry
- sequential
- random numbers
- entries
- 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.)
- Pending
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
【発明の詳細な説明】
〔概要〕
擬似乱数(A 、 B 、〜)を展開した擬似乱数展開
テーブルと、0からN迄のN個の互いに異なるデータを
シーケンシャルに並べたシーケンシャルテーブルとを備
えて、該擬似乱数展開テーブルから取り出した擬似乱数
(A、B、〜)を、上記の数Nで割った余りで、該シー
ケンシャルテーブルの対応するエントリーを選択して、
各々のエントリー内のデータが全て異なるようにするテ
ーブル内エンドリー選択方式に関し、
高速に、互いに異なるM(≦N)個の擬似乱数を選択す
ることを目的とし、
該擬似乱数展開テーブルから擬似乱数(A、B、〜)を
取り出し、上記の数Nで割ったときの剰余(α。[Detailed Description of the Invention] [Summary] The present invention includes a pseudo-random number expansion table in which pseudo-random numbers (A, B, ~) are expanded, and a sequential table in which N mutually different data from 0 to N are sequentially arranged. , select the corresponding entry in the sequential table using the remainder of dividing the pseudo-random number (A, B, ~) taken out from the pseudo-random number expansion table by the above number N,
Regarding the in-table endley selection method in which all data in each entry is different, the purpose is to quickly select M (≦N) mutually different pseudorandom numbers, and the pseudorandom numbers ( A, B, ~) and divide it by the above number N, the remainder (α).
β、〜)に基づいて、上記シーケンシャルテーブルを検
索したときの対応するエントリーの内容(余りα、β、
〜)を抽出して、上記シーケンシャルテーブルとは別の
選択テーブルの各エントリーに順次、格納すると共に、
該シーケンシャルテーブルから抽出したエントリー位置
に、該シーケンシャルテーブルの最終エントリーを移動
して、以鋒での該シーケンシャルテーブルに対する検索
エントリーの数を1個減らすことをM(≦N)回繰り返
して、該選択テーブル上に、M個の互いに異なる擬似乱
数を生成するように構成する。β, ~), the content of the corresponding entry when searching the above sequential table (remainder α, β,
~) and sequentially store them in each entry of a selection table different from the above sequential table, and
The process of moving the last entry of the sequential table to the entry position extracted from the sequential table and reducing the number of search entries for the sequential table by one is repeated M (≦N) times, and then the selection is performed. The table is configured to generate M mutually different pseudorandom numbers.
本発明は、擬似乱数(A 、 B 、〜)を展開した擬
似乱数展開テーブルと、0からN迄のN個の互いに異な
るデータをシーケンシャルに並べたシーケンシャルテー
ブルとを備えて、該シーケンシャルテーブルの中からラ
ンダムにエントリーを選択して擬似乱数を生成する場合
において、選択した各々のエントリーが全て異なる必要
があるエントリー選択方式に関する。The present invention includes a pseudo-random number expansion table in which pseudo-random numbers (A, B, ~) are expanded, and a sequential table in which N mutually different data from 0 to N are sequentially arranged. The present invention relates to an entry selection method in which each selected entry must be different when pseudorandom numbers are generated by randomly selecting entries from a list of entries.
例えば、電子計算機の中央処理装置(CPU)の試験プ
ログラムで命令列を実行させ、ある命令が、その他の命
令に影響を及ぼさないことを試験する場合には、各々の
命令のオペランドを全て異なるメモリ空間に置くことに
より、より効果的に試験を行うことができるが、この時
のオペランドのメモリ空間を、互いに異なる擬似乱数を
用いて取り出すようにすれば、該試験プログラムを効果
的に運用することができる。For example, when executing a sequence of instructions in a test program for the central processing unit (CPU) of an electronic computer and testing that a certain instruction does not affect other instructions, all operands of each instruction are stored in different memories. Testing can be performed more effectively by placing the operands in the memory space, but if the memory space of the operands is retrieved using different pseudo-random numbers, the test program can be operated more effectively. I can do it.
従って、該互いに異なる擬似乱数を高速に選択すること
ができる方式が要求される。Therefore, a method is required that can quickly select the different pseudo-random numbers.
〔従来の技術と発明が解決しようとする課題〕第2図は
従来の擬似乱数を使ったテーブル内エントリー選択方式
を説明する図である。[Prior art and problems to be solved by the invention] FIG. 2 is a diagram illustrating a conventional table entry selection method using pseudo-random numbers.
該従来の方式では、互いに異なる数が格納されているテ
ーブル内のエントリーを擬似乱数を使って並べ替え、先
頭から順番に使用していた。In this conventional method, entries in a table that store different numbers are rearranged using pseudo-random numbers, and the entries are used in order from the beginning.
具体的には、先ず、擬似乱数(A、B、〜)(例えば、
4バイトの符号無し2進数)を展開した擬似乱数展開テ
ーブル1と、0からN迄のN個の互いに異なるデータを
シーケンシャルに並べたシーケンシャルテーブル2とを
備える。Specifically, first, pseudorandom numbers (A, B, ~) (for example,
It includes a pseudo-random number expansion table 1 in which a 4-byte unsigned binary number is expanded, and a sequential table 2 in which N mutually different data from 0 to N are sequentially arranged.
該シーケンシャルテーブル2には、互いに異なる数(後
述の剰余演算のr余り」に対応する数)がシーケンシャ
ルに並んでいるので、上記擬像乱数展開テーブル1から
読み出した擬似乱数(A、B。In the sequential table 2, numbers that are different from each other (numbers corresponding to "remainder r of the remainder operation described later") are sequentially arranged. Therefore, the pseudo random numbers (A, B.
〜)を、該シーケンシャルテーブル2を構成しているエ
ントリーの数Nで割って得た余りの数に対応する該シー
ケンシャルテーブル2の各エントリーを選択して、先頭
から順に入れ替えることにより、該シーケンシャルテー
ブル2上でシーケンシャルに並んでいる数の列を、擬似
乱数の列にしようとする方式である。~) by the number N of entries constituting the sequential table 2, and selecting each entry of the sequential table 2 corresponding to the remainder and replacing them in order from the beginning. This is a method that attempts to turn the sequence of numbers sequentially arranged on 2 into a sequence of pseudo-random numbers.
そこで、最初、上記シーケンシャルテーブル2の第1番
目のエントリーの内容(余りO)を取り出した後、上記
擬似乱数展開テーブル1から最初の擬似乱数Aを取り出
し、該擬似乱数Aを上記数N(本例では、例えば、’1
024′である)で割ったときの剰余(余りα:本例で
は、“512°)に基づいて、上記シーケンシャルテー
ブル2を検索し、上記第1番目のエントリー(余り0に
対応するエントリー)と、上記剰余に基づいて、上記シ
ーケンシャルテーブル2を検索したエントリー(余り°
512゛ に対応するエントリー)とを、図示されてい
る如くに入れ替える。Therefore, first, after taking out the contents of the first entry (remainder O) of the above sequential table 2, the first pseudo-random number A is taken out from the above-mentioned pseudo-random number expansion table 1, and the pseudo-random number A is In the example, for example, '1
The above sequential table 2 is searched based on the remainder (remainder α: 512° in this example) when divided by , based on the above remainder, the entry (remainder °
The entry corresponding to 512゛) is replaced as shown.
この操作により、該シーケンシャルテーブル2の第1番
目のエントリーには、擬似乱数’512’が入る。As a result of this operation, the pseudorandom number '512' is entered in the first entry of the sequential table 2.
次に、上記シーケンシャルテーブル2の第2番目のエン
トリーの内容(余りl)を取り出した後、上記擬似乱数
展開テーブル1から次の擬似乱数Bを取り出し、該擬似
乱数Bを上記の数N (=1024)で割ったときの剰
余(余りβ:零例では、’514’)に基づいて、上記
シーケンシャルテーブル2を検索したエントリーと、上
記第2番目のエントリー(余り1に対応したエントリー
)とを入れ替える。Next, after extracting the contents of the second entry (remainder l) of the sequential table 2, the next pseudo-random number B is extracted from the pseudo-random number expansion table 1, and the pseudo-random number B is converted to the number N (= Based on the remainder (remainder β: '514' in the zero example) when divided by Replace.
この操作により、該シーケンシャルテーブル2の第2番
目のエントリーには、擬似乱数“514“が入る。As a result of this operation, the pseudorandom number "514" is entered in the second entry of the sequential table 2.
以下、同じ操作を繰り返して、例えば、8回目の操作に
おいて、擬似乱数Hを取り出し、該擬似乱数Hを上記数
N (=1024)で割ったときの剰余(余りθ:零例
では、°0゛)に基づいて、上記シーケンシャルテーブ
ル2を検索して得たエントリー、即ち、余りOに対応す
る第1番目のエントリーと、上記第8番目のエントリー
(余り7に対応するエントリー)とを、図示されている
如くに、入れ替える。Hereafter, the same operation is repeated, for example, in the 8th operation, a pseudo-random number H is taken out, and the remainder when the pseudo-random number H is divided by the above number N (=1024) (remainder θ: zero In the example, °0゛) Based on the above, the entries obtained by searching the sequential table 2, that is, the first entry corresponding to the remainder O and the eighth entry (the entry corresponding to the remainder 7) are shown in the figure. Replace as shown.
この結果、上記第1番目の操作で得られていたシーケン
シャルテーブルlの、第1番目のエントリーの擬似乱数
’512’が°7“と入れ替えられることになる。As a result, the pseudorandom number '512' in the first entry of the sequential table l obtained in the first operation is replaced with '7''.
このように、従来方式においては、擬似乱数展開テーブ
ル1から取り出した擬似乱数(A、B、〜)を、数N(
本例では、前述のように、’1024′)で割ったとき
の剰余が、既に、入れ替えられているエントリーを指す
とか、図示説明していないが、同じ剰余が発生すること
があり、−度入れ替えられて選択されたものが、再度選
択されることがある。In this way, in the conventional method, the pseudo-random numbers (A, B, ~) taken out from the pseudo-random number expansion table 1 are converted into the number N (
In this example, as mentioned above, the remainder when divided by '1024') may refer to an entry that has already been replaced, and although it is not illustrated or explained, the same remainder may occur. What was selected after being swapped may be selected again.
従って、従来方式においては、上記のように、例えば、
互いに異なる8個の擬似乱数が必要なときでも、N(本
例では、前述のように、“1024“)回の同じ操作を
繰り返さないと、上記シーケンシャルテーブル2の先頭
8個に、互いに異なる真の擬似乱数を設定することがで
きないということになり、該シーケンシャルテーブル2
のエントリーの数Nが増加するにつれて、該並べ替えに
時間がかかるという問題があった。Therefore, in the conventional method, as mentioned above, for example,
Even when eight different pseudo-random numbers are required, if the same operation is not repeated N (in this example, "1024" as described above) times, different truths will be added to the first eight of the sequential table 2. This means that it is not possible to set pseudo-random numbers for the sequential table 2.
There is a problem in that as the number N of entries increases, the sorting takes more time.
本発明は上記従来の欠点に鑑み、擬似乱数(A、B。In view of the above-mentioned conventional drawbacks, the present invention provides pseudorandom numbers (A, B).
〜)を展開した擬像乱数展開テーブルと、0からN迄の
N個の互いに異なるデータをシーケンシャルに並べたシ
ーケンシャルテーブルとを備えて、該擬似乱数展開テー
ブルから取り出した擬似乱数(A、B、〜)を、上記の
数Nで割った余りで、該シーケンシャルテーブルのエン
トリーを選択し、各々のエントリーが全て異なるように
するテーブル内エントリー選択方式を提供することを目
的とするものである。), and a sequential table in which N mutually different data from 0 to N are sequentially arranged, and pseudorandom numbers (A, B, .
上記の問題点は下記の如くに構成した擬似乱数によるテ
ーブル内エントリー選択方式によって解決される。The above problem can be solved by an in-table entry selection method using pseudo-random numbers configured as follows.
擬似乱数(A、B、〜)を展開した擬似乱数展開テーブ
ルlと、OからN迄のN個の互いに異なるデータをシー
ケンシャルに並べたシーケンシャルテーブル2とを備え
て、
該シーケンシャルテーブル2の各エントリーを、上記擬
似乱数展開テーブル1を使用して並べ替えることにより
、M個(≦N)の互いに異なる擬似乱数を得る方式にお
いて、
該擬似乱数展開テーブル1から擬似乱数(A、B。A pseudo-random number expansion table 1 in which pseudo-random numbers (A, B, ~) are expanded, and a sequential table 2 in which N mutually different data from O to N are sequentially arranged, and each entry of the sequential table 2 is provided. In this method, M (≦N) mutually different pseudorandom numbers are obtained by rearranging the pseudorandom numbers (A, B) using the pseudorandom number expansion table 1.
〜)を取り出し、上記数Nで割ったときの剰余(α、β
、〜)に基づいて、上記シーケンシャルテーブル2を検
索したときの対応するエントリーの内容(余りα、β、
〜)を抽出して、該シーケンシャルテーブル2と異なる
別の選択テーブル3の各エントリーにに順次、格納する
と共に、該シーケンシャルテーブル2から抽出したエン
トリー位置に、該シーケンシャルテーブル2の最終エン
トリーを移動して、以陳での該シーケンシャルテーブル
2に対する検索エントリーの数を1個減らすことをM(
≦N)回繰り返して、該選択テーブル3上に、M個の互
いに異なる擬似乱数を生成するように構成する。~) and divide it by the above number N, the remainder (α, β
, ~), the content of the corresponding entry when searching the above sequential table 2 (remainder α, β,
~) and sequentially store them in each entry of another selection table 3 different from the sequential table 2, and move the last entry of the sequential table 2 to the entry position extracted from the sequential table 2. Therefore, M(
≦N) times to generate M mutually different pseudo-random numbers on the selection table 3.
即ち、本発明によれば、擬似乱数(A、B、〜)を展開
した擬似乱数展開テーブル1と、余り0から余りN迄の
N個の互いに異なるデータをシーケンシャルに並べたシ
ーケンシャルテーブル2とを備えて、
該シーケンシャルテーブル2の各エントリーを、擬似乱
数展開テーブル1を使用して並べ替えることで、互いに
異なるM個(≦N)の擬似乱数を得る方式において、
該シーケンシャルテーブル2内のエントリーの並べ替え
を行わずに、擬似乱数展開テーブル1から擬似乱数(A
、B、〜)を読み出し、該読み出した擬似乱数(A、B
、〜)を、例えば、該シーケンシャルテーブル2のエン
トリーの数、例えば、1024で割ったときの余りによ
り、該シーケンシャルテーブル2内のエントリーを選択
して、そのエントリーの内容を別途設けられている選択
テーブル3に順次格納すると共に、該選択されたエント
リー位置に、該シーケンシャルテーブル2内の最終エン
トリーを移動することを繰り返すことで、次に、該シー
ケンシャルテーブル2からエントリー位置択する時には
、前回のシーケンシャルテーブル2の大きさから1工ン
トリー分を引いたシーケンシャルテーブル2の中からエ
ントリーを選択するようにしたものである。That is, according to the present invention, a pseudo-random number expansion table 1 in which pseudo-random numbers (A, B, ~) are expanded, and a sequential table 2 in which N mutually different data from remainder 0 to remainder N are sequentially arranged. In this method, M (≦N) mutually different pseudo-random numbers are obtained by rearranging each entry in the sequential table 2 using the pseudo-random number expansion table 1. Pseudo-random numbers (A
, B, ~), and the read pseudo-random numbers (A, B
, ~), for example, by the number of entries in the sequential table 2, for example, 1024, an entry in the sequential table 2 is selected, and the contents of the entry are selected by a separately provided selection. By repeating the process of sequentially storing data in Table 3 and moving the final entry in Sequential Table 2 to the selected entry position, next time when selecting an entry position from Sequential Table 2, the previous sequential An entry is selected from a sequential table 2 that is obtained by subtracting one entry from the size of table 2.
従って、シーケンシャルテーブル2のエントリー数が、
例えば、1024個あったとしても、本発明によるエン
トリー選択方式では、例えば、互いに異なる8個の擬似
乱数が必要なとき、8回の上記操作を繰り返すことによ
り、該シーケンシャルテーブル2内の全て異なるエント
リーを選択し、該エントリーの内容を得ることで、互い
に異なる擬似乱数を得ることが可能である。Therefore, the number of entries in sequential table 2 is
For example, even if there are 1024 pseudo-random numbers, in the entry selection method according to the present invention, if 8 mutually different pseudo-random numbers are required, by repeating the above operation 8 times, all different entries in the sequential table 2 can be selected. By selecting and obtaining the contents of the entry, it is possible to obtain mutually different pseudorandom numbers.
然も、シーケンシャルテーブル2からエントリーを選択
するごとに、以降での選択範囲が1エントリー宛少なく
なり、シーケンシャルテーブル2のエントリーの数が増
加しても、短時間に、全て異なるエントリーを選択し、
互いに異なる擬似乱数を得ることができる効果がある。However, each time an entry is selected from sequential table 2, the selection range from then on decreases by one entry, and even if the number of entries in sequential table 2 increases, all different entries can be selected in a short time.
This has the effect of being able to obtain pseudorandom numbers that are different from each other.
以下本発明の実施例を図面によって詳述する。 Embodiments of the present invention will be described in detail below with reference to the drawings.
第1図は本発明の一実施例を示した図であり、擬似乱数
(A、B、〜)を展開した擬似乱数展開テーブル1と、
OからN迄のN個の互いに異なるデータをシーケンシャ
ルに並べたシーケンシャルテーブル2とを備えて、該擬
似乱数展開テーブル1から取り出した擬似乱数(A、B
、〜)を、上記シーケンシャルテーブル2のエントリー
の数Nで割った余りで、該シーケンシャルテーブル2の
エントリーを選択して、そのエントリーの内容を該シー
ケンシャルテーブル2とは別の選択テーブル3に格納し
、該選択されたエントリーの位置に、該シーケンシャル
テーブル2の最終エントリーを移動して、以降での該シ
ーケンシャルテーブル2に対する検索エントリーの数を
1個減らすことをM(≦N)回繰り返して、選択テーブ
ル3内の各々のエントリーの内容が全て異なるようにし
て、M(≦N)個の互いに異なる擬似乱数を得る手段が
本発明を実施するのに必要な手段である。尚、全図を通
して同じ符号は同じ対象物を示している。FIG. 1 is a diagram showing an embodiment of the present invention, in which a pseudo-random number expansion table 1 in which pseudo-random numbers (A, B, ~) are expanded,
A sequential table 2 in which N pieces of mutually different data from O to N are sequentially arranged, and pseudorandom numbers (A, B
, ~) by the number N of entries in the sequential table 2, select an entry in the sequential table 2, and store the contents of the entry in a selection table 3 separate from the sequential table 2. , moves the final entry of the sequential table 2 to the position of the selected entry and reduces the number of subsequent search entries for the sequential table 2 by one M (≦N) times, and then selects the selected entry. Means for obtaining M (≦N) mutually different pseudorandom numbers by making the contents of each entry in Table 3 completely different is a means necessary to implement the present invention. Note that the same reference numerals indicate the same objects throughout the figures.
以下、第1図によって本発明の擬似乱数を使用したテー
ブル内エントリー選択方式を説明する。Hereinafter, an in-table entry selection method using pseudo-random numbers according to the present invention will be explained with reference to FIG.
擬似乱数展開テーブル1.シーケンシャルテーブル2の
各エントリーは、例えば、4バイトの符号なし2進整数
とし、該シーケンシャルテーブル2は、0〜1023の
値をシーケンシャルに持つ1024エントリーで作られ
ているとする。Pseudo-random number expansion table 1. It is assumed that each entry of the sequential table 2 is, for example, a 4-byte unsigned binary integer, and that the sequential table 2 is made up of 1024 entries having sequential values of 0 to 1023.
本実施例においては、上記1024個のエントリーから
8個の互いに異なるエントリーを選択するものとする。In this embodiment, it is assumed that 8 mutually different entries are selected from the 1024 entries.
8個のエントリーを選択するための擬似乱数を擬似乱数
展開テーブル1上に、例えば、4バイト×8個=32バ
イト用意する。Pseudo-random numbers for selecting eight entries are prepared on the pseudo-random number expansion table 1, for example, 4 bytes x 8 = 32 bytes.
a)該擬似乱数展開テーブル1の最初の4バイトAを取
出し、上記シーケンシャルテーブル2のエントリー数N
(1024)で割った余りに対応するエントリーを、該
シーケンシャルテーブル2から選択されたエントリー(
512)とし、その内容を選択テーブル3の第1番目の
領域に格納する。a) Take out the first 4 bytes A of the pseudo-random number expansion table 1 and calculate the number of entries N of the sequential table 2.
The entry corresponding to the remainder divided by (1024) is selected from the sequential table 2 (
512) and its contents are stored in the first area of the selection table 3.
b) 該シーケンシャルテーブル2の選択されたエント
リー位置に、該シーケンシャルテーブル2の最終エント
リー(1023)を移動する。b) Move the last entry (1023) of the sequential table 2 to the selected entry position of the sequential table 2;
C)上記擬似乱数展開テーブル1から、擬似乱数の2番
自の4バイトBを取出し、該シーケンシャルテーブル2
のエントリー数から1を引いた値(1021−1=10
23)で割った余りに対応するエントリーを選択された
エントリー(514)とし、その内容を選択テーブル3
の第2番目の領域に格納する。C) From the above pseudo-random number expansion table 1, extract the second 4 bytes B of the pseudo-random number and convert it to the sequential table 2.
The value obtained by subtracting 1 from the number of entries in (1021-1=10
The entry corresponding to the remainder divided by 23) is set as the selected entry (514), and its contents are stored in selection table 3
It is stored in the second area of .
d)該シーケンシャルテーブル2の選択されたエントリ
ー位置に、該シーケンシャルテーブル2の最終エントリ
ーから1エントリーを引いたエントリー(1022)を
移動する。d) Move an entry (1022) obtained by subtracting one entry from the last entry of the sequential table 2 to the selected entry position of the sequential table 2;
e)上記C)〜d)を指定されたエントリーの個数分、
即ち、本実施例では、上記8個分繰り返す。e) The above C) to d) for the specified number of entries,
That is, in this embodiment, the above-mentioned eight times are repeated.
f)該8回繰り返した時点で、上記選択テーブルには、
互いに異なるエントリーを示す数値、即ち、擬似乱数が
格納されており、然も、該シーケンシャルテーブル2の
エントリー数は、当初のエントリー数(1024)から
8を減電したエントリー数(=1017)となる。f) At the time of repeating the eight times, the above selection table has the following information:
Numerical values indicating mutually different entries, that is, pseudo-random numbers are stored, and the number of entries in the sequential table 2 is the number of entries (=1017) obtained by subtracting 8 from the original number of entries (1024). .
従って、本発明によれば、擬似乱数展開テーブル1から
取り出して使用した擬似乱数が同じであっても、その剰
余は、必ず、該シーケンシャルテーブル2のエントリー
数以内の数となり、同じエントリーが選択されることは
なく、又、既に、選択されたエントリーの内容は、別の
選択テーブル3に格納されてル)るので、該エントリー
が再び選択されることもない。Therefore, according to the present invention, even if the pseudo-random numbers taken out and used from the pseudo-random number expansion table 1 are the same, the remainder will always be a number within the number of entries in the sequential table 2, and the same entry will not be selected. Moreover, since the contents of the selected entry are already stored in another selection table 3, the entry will not be selected again.
このようにして、必要とする擬似乱数の個数回、本例で
は8個分だけの上記a)〜d)の操作で、必要とする、
「互いに異なる8個の擬似乱数」を高速に得ることがで
きる。In this way, by performing the operations a) to d) above for the required number of pseudo-random numbers, in this example 8, the required
"Eight mutually different pseudo-random numbers" can be obtained at high speed.
このように、本発明による疑似乱数によるテーブル内エ
ントリー選択方式は、擬似乱数(A、B、〜)を展開し
た擬似乱数展開テーブル1と、0からN迄のN個め互い
に異なるデータをシーケンシャルに並べたシーケンシャ
ルテーブル2とを備えて、該擬似乱数展開テーブル1か
ら取り出した擬似乱数(A、B、〜)を、上記シーケン
シャルテーブル2のエントリーの数Nで割った余りで、
該シーケンシャルテーブル2のエントリーを選択して、
その内容を該シーケンシャルテーブル2とは別の選択テ
ーブル3に格納し、該選択されたエントリーの位置に、
該シーケンシャルテーブル2の最終エントリーを移動し
、以陳での該シーケンシャルテーブル2に対する検索エ
ントリーの数を1個減らすことを繰り返して、選択テー
ブル3内の各々のエントリーの内容が全て異なるように
して、互いに異なるM(≦N)個の擬似乱数を得るよう
にした所に特徴がある。As described above, the in-table entry selection method using pseudo-random numbers according to the present invention sequentially selects the pseudo-random number expansion table 1 in which pseudo-random numbers (A, B, ~) are expanded, and N mutually different data from 0 to N. The pseudo-random numbers (A, B, ~) taken out from the pseudo-random number expansion table 1 are divided by the number N of entries in the sequential table 2, and the remainder is
Select the entry of the sequential table 2,
The contents are stored in a selection table 3 separate from the sequential table 2, and at the position of the selected entry,
Move the last entry of the sequential table 2 and reduce the number of search entries for the sequential table 2 by one in the subsequent steps, so that the contents of each entry in the selection table 3 are all different, The feature is that M (≦N) mutually different pseudorandom numbers are obtained.
以上説明した様に、本発明によれば、擬似乱数(A、B
、〜)を展開した擬似乱数展開テーブルと、0からN迄
のN個の互いに異なるデータをシーケンシャルに並べた
シーケンシャルテーブルとを備えて、該擬似乱数展開テ
ーブルから取り出した擬似乱数を、上記の数Nで割った
余りで、該シーケンシャルテーブルのエントリーを選択
して、その内容を該シーケンシャルテーブルとは異なる
別の選択テーブルに格納し、該選択テーブルの、各々の
エントリー内のデータが全て異なるようにして、互いに
異なるM(≦N)個の擬似乱数を得るようにしたもので
あるので、該シーケンシャルテーブルのエントリーの数
Nが増加しても、又、該選択に使用した擬似乱数(A、
B、〜)が同じ値であっても、短時間に全て異なるエン
トリーを選択して、互いに異なる擬似乱数を得ることが
できる効果がある。As explained above, according to the present invention, pseudorandom numbers (A, B
, ~) and a sequential table in which N mutually different data from 0 to N are sequentially arranged, and the pseudorandom numbers extracted from the pseudorandom number expansion table are Select an entry in the sequential table using the remainder divided by N, and store its contents in a selection table different from the sequential table, so that the data in each entry in the selection table is all different. Therefore, even if the number N of entries in the sequential table increases, the pseudo-random numbers (A,
Even if B, ~) have the same value, it is possible to select all different entries in a short time and obtain mutually different pseudorandom numbers.
第1図は本発明の一実施例を示した図。
第2図は従来の擬似乱数を使ったテーブル内エントリー
選択方式を説明する図。
である。
図面において、
1は疑似乱数展開テーブル。
2はシーケンシャルテーブル。
3は選択テーブル。FIG. 1 is a diagram showing an embodiment of the present invention. FIG. 2 is a diagram illustrating a conventional table entry selection method using pseudo-random numbers. It is. In the drawing, 1 is a pseudo-random number expansion table. 2 is a sequential table. 3 is a selection table.
Claims (1)
ル(1)と、0からN迄のN個の互いに異なるデータを
シーケンシャルに並べたシーケンシャルテーブル(2)
とを備えて、 該シーケンシャルテーブル(2)の各エントリーを、上
記擬似乱数展開テーブル(1)を使用して並べ替えるこ
とにより、M個(≦N)の互いに異なる擬似乱数を得る
方式において、 該擬似乱数展開テーブル(1)から擬似乱数(A、B、
〜)を取り出し、上記数Nで割ったときの剰余(α、β
、〜)に基づいて、上記シーケンシャルテーブル(2)
を検索したときの対応するエントリーの内容(余りα、
β、〜)を抽出して、該シーケンシャルテーブル(2)
と異なる別の選択テーブル(3)の各エントリーにに順
次、格納すると共に、該シーケンシャルテーブル(2)
から抽出したエントリー位置に、該シーケンシャルテー
ブル(2)の最終エントリーを移動して、以降での該シ
ーケンシャルテーブル(2)に対する検索エントリーの
数を1個減らすことをM(≦N)回繰り返して、該選択
テーブル(3)上に、M個の互いに異なる擬似乱数を生
成することを特徴とする擬似乱数によるテーブル内エン
トリー選択方式。[Claims] A pseudo-random number expansion table (1) in which pseudo-random numbers (A, B, ~) are expanded, and a sequential table (2) in which N mutually different data from 0 to N are sequentially arranged.
A method of obtaining M (≦N) mutually different pseudorandom numbers by rearranging each entry of the sequential table (2) using the pseudorandom number expansion table (1), Pseudo-random numbers (A, B,
~) and divide it by the above number N, the remainder (α, β
, ~), the above sequential table (2)
The content of the corresponding entry when searching for (remainder α,
β, ~) and the sequential table (2)
Sequentially stored in each entry of another selection table (3) different from the sequential table (2).
Repeat M (≦N) times by moving the final entry of the sequential table (2) to the entry position extracted from and reducing the number of subsequent search entries for the sequential table (2) by one; An in-table entry selection method using pseudo-random numbers, characterized in that M mutually different pseudo-random numbers are generated on the selection table (3).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2313223A JPH04182828A (en) | 1990-11-19 | 1990-11-19 | In-table entry selection method using pseudo-random numbers |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2313223A JPH04182828A (en) | 1990-11-19 | 1990-11-19 | In-table entry selection method using pseudo-random numbers |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH04182828A true JPH04182828A (en) | 1992-06-30 |
Family
ID=18038595
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2313223A Pending JPH04182828A (en) | 1990-11-19 | 1990-11-19 | In-table entry selection method using pseudo-random numbers |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH04182828A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004515855A (en) * | 2000-12-08 | 2004-05-27 | ドイッチェ テレコム アーゲー | Method and apparatus for generating pseudo-random sequences |
JP2006181191A (en) * | 2004-12-28 | 2006-07-13 | Le Tekku:Kk | Random number extraction method for gaming machine and random number extraction device for gaming machine |
WO2008053936A1 (en) * | 2006-10-31 | 2008-05-08 | Kiyoto Yui | Pseudo-random number generation device, pseudo-random number generation program, and medium containing pseudo-random number generation program |
-
1990
- 1990-11-19 JP JP2313223A patent/JPH04182828A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004515855A (en) * | 2000-12-08 | 2004-05-27 | ドイッチェ テレコム アーゲー | Method and apparatus for generating pseudo-random sequences |
JP2006181191A (en) * | 2004-12-28 | 2006-07-13 | Le Tekku:Kk | Random number extraction method for gaming machine and random number extraction device for gaming machine |
WO2008053936A1 (en) * | 2006-10-31 | 2008-05-08 | Kiyoto Yui | Pseudo-random number generation device, pseudo-random number generation program, and medium containing pseudo-random number generation program |
US8510359B2 (en) | 2006-10-31 | 2013-08-13 | Kiyoto Yui | Pseudo-random number generation device, pseudo-random number generation program, and medium containing pseudo-random number generation program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4644471A (en) | Method for processing a data base | |
CA2340531C (en) | Document retrieval system and search method using word set and character look-up tables | |
JP4965009B2 (en) | Generating a full hash using an offset table | |
US7062499B2 (en) | Enhanced multiway radix tree and related methods | |
JPH11212980A (en) | Production of index and retrieval method | |
JP2606460B2 (en) | Data generation method for CAD / CAM device | |
US5745891A (en) | Apparatus for rearranging the rows of information in a displayed table by highlighting a different column attribute | |
JP3644494B2 (en) | Information retrieval device | |
JPH021059A (en) | Associative retrieving system | |
JP2005242997A (en) | Data retrieval device and method | |
US7302377B1 (en) | Accelerated event queue for logic simulation | |
JPH04182828A (en) | In-table entry selection method using pseudo-random numbers | |
JP2007233554A (en) | Search method for high-speed pattern matching device | |
JPH06215044A (en) | Information retrieval processor | |
JPH01259418A (en) | string search device | |
JPS63204434A (en) | Electronic document retrieving device | |
JPH0584937B2 (en) | ||
JPS6143338A (en) | How to search sparse databases using associative techniques | |
JPH11194480A (en) | Formation of mask pattern data for writing and its apparatus | |
JPH0736918A (en) | Retrieval result display method | |
JPH01228022A (en) | Tow-dimensional data storing system | |
JP3018579B2 (en) | Name search processor | |
JPS63104132A (en) | Extension system for summary of parts list | |
JP2735255B2 (en) | Hatching treatment method | |
JP2889319B2 (en) | Graphic drawing device |