JP2008197847A - Random number inspection device and inspection method therefor - Google Patents

Random number inspection device and inspection method therefor Download PDF

Info

Publication number
JP2008197847A
JP2008197847A JP2007031305A JP2007031305A JP2008197847A JP 2008197847 A JP2008197847 A JP 2008197847A JP 2007031305 A JP2007031305 A JP 2007031305A JP 2007031305 A JP2007031305 A JP 2007031305A JP 2008197847 A JP2008197847 A JP 2008197847A
Authority
JP
Japan
Prior art keywords
random number
statistic
determination
value
random
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
JP2007031305A
Other languages
Japanese (ja)
Other versions
JP4762166B2 (en
Inventor
Mitsuhiro Enomoto
光広 榎本
Toru Onodera
徹 小野寺
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2007031305A priority Critical patent/JP4762166B2/en
Publication of JP2008197847A publication Critical patent/JP2008197847A/en
Application granted granted Critical
Publication of JP4762166B2 publication Critical patent/JP4762166B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide random number inspection technology to easily inspect and check a required section of or the quality of random numbers necessary for a computer application by use of statistical technology, in a short time. <P>SOLUTION: This random number inspection device 10 has: a random number storage means 12 storing the random number (a) generated by a random number generation means 11; a statistic calculation means 13 provided as the need arises so as to calculate a statistic of the random number output from the random number storage means 12; a statistic decision means 14 deciding the calculated statistic, and having a decision vale storage function therefor; and an output control means 15 outputting the random number according to a decision result from the statistic decision means 14. The statistic decision means 14 generates the decision result required by the application 16. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、汎用コンピュータからパソコンやゲーム機のような民生レベルまで幅広い分野に適用される乱数検査技術に係り、特に、アプリケーションに必要な乱数の性質や区間を短時間に検査し、確認することができる乱数検査装置およびその検査方法に関する。   The present invention relates to a random number inspection technique applied to a wide range of fields from general-purpose computers to consumer levels such as personal computers and game machines, and in particular, inspects and confirms the nature and interval of random numbers required for applications in a short time. The present invention relates to a random number inspection apparatus capable of performing the same and an inspection method thereof.

乱数列とはランダムに並んだ数値の列で、数列X,X,…,Xから次の数値Xn+1が予測できない数列のことである。このような乱数列の数列を構成する数値を乱数という。乱数列を生成する装置または計算機アルゴリズムを乱数発生器と呼ぶ。 The random number sequence in the column of numbers arranged in random, sequence X 1, X 2, ..., is that the X n of the following numbers X n + 1 can not be predicted sequence. Numeric values constituting such a random number sequence are called random numbers. A device or computer algorithm that generates a random number sequence is called a random number generator.

乱数には、その生成方法で分類して、物理乱数と擬似乱数とに大別される。物理乱数は、物理現象を用いて生成された乱数で、擬似乱数は計算機アルゴリズムを用いて生成された乱数である。なお、物理乱数をハードウェア乱数と言うこともあるが、物理現象を用いずに計算機アルゴリズムをハードウェアで実現した乱数もハードウェア乱数ということになるので、ハードウエア乱数の用語を用いることなく、用語として物理乱数と擬似乱数とを使用する。   Random numbers are roughly classified into physical random numbers and pseudo-random numbers according to the generation method. A physical random number is a random number generated using a physical phenomenon, and a pseudo-random number is a random number generated using a computer algorithm. Although physical random numbers are sometimes referred to as hardware random numbers, random numbers obtained by implementing computer algorithms in hardware without using physical phenomena are also referred to as hardware random numbers. The terms use physical random numbers and pseudo-random numbers.

その他の乱数の呼称として、真性乱数、一様乱数、正規乱数、2値乱数などがある。真性乱数、一様乱数、正規乱数、2値乱数等は乱数の特徴を示す呼称である。真性乱数は乱数の定義に従う理想的な乱数、一様乱数はある区間における発生確率が等しい乱数、正規乱数は発生確率の分布が正規分布である乱数、2値乱数は2種類の値による乱数の呼称である。   Other random number names include true random numbers, uniform random numbers, normal random numbers, and binary random numbers. Intrinsic random numbers, uniform random numbers, normal random numbers, binary random numbers, and the like are names indicating characteristics of random numbers. True random numbers are ideal random numbers according to the definition of random numbers, uniform random numbers are random numbers with the same probability of occurrence in a certain interval, normal random numbers are random numbers whose distribution of occurrence probability is normal distribution, binary random numbers are random numbers with two types of values It is a designation.

計算機に関数として組み込まれる乱数は一般的に一様乱数である。一様でない確率分布が必要な場合は一様乱数から他の発生確率の分布に変換して用いることができる。   A random number incorporated as a function in a computer is generally a uniform random number. If a non-uniform probability distribution is required, it can be converted from a uniform random number into another probability distribution.

乱数を用いる場合、乱数の品質を確認することが重要である。乱数の品質が高いということは真性乱数に近いということである。統計的な理論に基づき乱数の品質を確認することを乱数の検定と言い、真性乱数であることを確認するには高次元の一様性を検定すれば良い。しかし、低次元の検定は比較的容易であるが、高次元の検定は確認の時間が膨大となり現実的ではない。   When using random numbers, it is important to check the quality of the random numbers. A high quality random number means that it is close to a true random number. Checking the quality of random numbers based on statistical theory is called random number testing, and high-dimensional uniformity can be tested to confirm that it is a true random number. However, a low-dimensional test is relatively easy, but a high-dimensional test is not practical because it takes a long time to confirm.

そこで、一般的には真性乱数が有する性質の確認は複数の目的の異なる検定手法を用いて行なわれ、例えば、一様性があること(偏りがないこと)、周期性がないこと、再現性がないことなどを評価する。   Therefore, in general, the properties of true random numbers are confirmed using multiple test methods with different purposes. For example, there is uniformity (no bias), no periodicity, and reproducibility. Evaluate that there is no.

擬似乱数は計算機アルゴリズムを用いて発生させるため、初期値が同じであれば同じ乱数列を生成(再現性)し、次の乱数を生成するときの設定値(シード)が以前に生成したシードと同じであれば、そのシード発生時から同じ乱数列を繰り返し生成(周期性)するという性質がある。   Since pseudo-random numbers are generated using a computer algorithm, if the initial values are the same, the same random number sequence is generated (reproducibility), and the setting value (seed) when generating the next random number is the same as the previously generated seed. If they are the same, there is a property that the same random number sequence is repeatedly generated (periodicity) from the generation of the seed.

この同じ乱数列の周期性の性質により原理的に擬似乱数は真性乱数とは言えない。しかし、周期が長い場合は、その周期に達するまでは乱数として使えるため計算機では関数として組み込まれる乱数として用いられる。   Due to the periodic nature of this same random number sequence, in principle, pseudo-random numbers cannot be said to be true random numbers. However, if the period is long, it can be used as a random number until the period is reached, so it is used as a random number incorporated as a function in the computer.

物理乱数は物理現象を数値化して乱数を生成するものであり、原理的に再現性や周期性は存在しない。物理乱数の場合は乱数を生成する毎に異なる乱数が生成されるので、擬似乱数のように、一度、品質を確認しても常に品質が保たれている保証にはならず、定期的な品質確認が必要である。   Physical random numbers generate physical numbers by quantifying physical phenomena, and in principle do not have reproducibility or periodicity. In the case of physical random numbers, a different random number is generated each time a random number is generated. Therefore, as with pseudo-random numbers, once the quality is confirmed, it is not guaranteed that the quality is always maintained. Confirmation is required.

物理乱数を発生させて汎用のコンピュータからパソコンやゲーム機のような民生レベルまで幅広い分野に適用される乱数取扱い技術に特許文献1(特開2000−259395号公報)や特許文献2(特開平11−85472号公報)に記載の技術がある。   Patent Document 1 (Japanese Patent Laid-Open No. 2000-259395) and Patent Document 2 (Japanese Patent Laid-Open No. Hei 11) are techniques for generating physical random numbers and applied to a wide range of fields from general-purpose computers to consumer levels such as personal computers and game machines. -85472).

一方、乱数を用いるアプリケーションによっては、たとえ乱数の品質が良くても、生成した乱数を捨てなければならないことがある。例えば、トランプのシミュレーションをする場合、ジョーカーを加えて53種類の異なる値が必要である。計算機で用いる乱数発生器が生成する乱数は、ビット単位であることが多く、区間[0,2のべき乗−1]の乱数を生成する。   On the other hand, depending on the application using random numbers, even if the quality of the random numbers is good, the generated random numbers may have to be discarded. For example, when simulating a playing card, a joker is added and 53 different values are required. The random number generated by the random number generator used in the computer is often in units of bits, and generates a random number in the interval [0, 2 to the power-1].

8ビットの乱数発生器の場合、区間[0〜255]の乱数が生成される。この256個の異なる値から53種類の異なる値を取り出す。例えば、いずれか53種類を使い、残りの203個を捨てる方法がある。しかし、53種類から残りを捨てる方法では捨てる数が多く無駄であるため、通常は生成した乱数値を53で除算した余りを用いる。しかし、この処理方法でも44個の乱数は捨てなければならない。   In the case of an 8-bit random number generator, random numbers in the interval [0 to 255] are generated. 53 different values are extracted from the 256 different values. For example, there is a method of using any 53 types and discarding the remaining 203 pieces. However, in the method of throwing away the rest from 53 types, the number to be thrown away is wasteful, and therefore the remainder obtained by dividing the generated random number value by 53 is usually used. However, even with this processing method, 44 random numbers must be discarded.

このように、乱数を用いる場合は品質の確認が必要である一方、生成した乱数の一部を破棄することがある。
特開2000−259395号公報 特開平11−85472号公報
As described above, when using a random number, quality confirmation is required, but a part of the generated random number may be discarded.
JP 2000-259395 A JP-A-11-85472

生成された乱数が真性乱数であるかどうかを確認するために、高次元の一様性の検定を行うことは理論的には可能である。高次元の一様性の検査に必要とされる計算機のメモリ容量や処理時間が膨大となり現実的ではない。   It is theoretically possible to perform a high-dimensional uniformity test to check whether the generated random number is a true random number. It is not realistic because the memory capacity and processing time of a computer required for high-dimensional uniformity inspection are enormous.

そのため、複数の検定手法をもちいて真性乱数が有する性質毎に確認する方法が用いられるが、全ての検定手法を試すには処理時間がかかり現実的ではない。さらに、少ない検定手法では乱数の品質を確認することはできない。このように、用いる乱数の品質を確認して利用するためには、膨大な処理時間がかかってしまうことが課題である。   For this reason, a method of confirming each property of the true random number using a plurality of test methods is used, but it takes a processing time to try all the test methods and is not practical. Furthermore, the quality of random numbers cannot be confirmed with a small number of test methods. Thus, in order to confirm and use the quality of the random numbers to be used, it is a problem that it takes a huge amount of processing time.

本発明は、上述した事情を考慮してなされたもので、アプリケーションに必要な乱数の品質を簡単かつ短時間に確認することができる乱数検査装置およびその検査方法を提供することを目的とする。   The present invention has been made in consideration of the above-described circumstances, and an object of the present invention is to provide a random number inspection apparatus and an inspection method thereof that can confirm the quality of random numbers required for an application easily and in a short time.

本発明に係る乱数検査装置は、上述した課題を解決するために、乱数発生手段で生成された乱数を保存する乱数保存手段と、この乱数保存手段から出力される乱数の統計量を計算する統計量計算手段と、計算された統計量を判定する統計量判定手段と、この統計量判定手段からの判定結果に応じて前記乱数保存手段に保存された乱数をアプリケーションに出力する出力制御手段とを備え、前記出力制御手段は、前記アプリケーションが必要とする乱数を出力するものである。   In order to solve the above-described problem, a random number inspection device according to the present invention stores a random number storing unit that stores a random number generated by a random number generating unit, and a statistic that calculates a statistical amount of a random number output from the random number storing unit. A quantity calculating means; a statistic judging means for judging a calculated statistic; and an output control means for outputting a random number stored in the random number storing means to an application in accordance with a judgment result from the statistic judging means. The output control means outputs a random number required by the application.

本発明に係る乱数検査方法は、上述した課題を解決するために、生成された物理乱数あるいは擬似乱数の乱数を保存し、計算された乱数の統計量を判定し、前記乱数の統計量からアプリケーションが必要とする乱数を出力する方法である。   In order to solve the above-described problem, the random number inspection method according to the present invention stores a generated physical random number or a pseudo-random number, determines a calculated random number statistic, and determines an application from the random statistic. Is a method to output the random numbers required by.

本発明に係る乱数検査装置およびその検査方法においては、アプリケーションに必要な乱数の品質を簡単かつ短時間に確認することができる。   In the random number inspection apparatus and the inspection method according to the present invention, the quality of random numbers required for an application can be confirmed easily and in a short time.

本発明に係る乱数検査装置およびその検査方法の実施の形態について添付図面を参照して説明する。   Embodiments of a random number inspection apparatus and an inspection method thereof according to the present invention will be described with reference to the accompanying drawings.

図1は、本発明に係る乱数検査装置の第1実施形態を示す構成図である。   FIG. 1 is a block diagram showing a first embodiment of a random number inspection apparatus according to the present invention.

この乱数検査装置10は、汎用コンピュータからパソコンやゲーム機のような民生レベルまで幅広い分野に適用される乱数検査技術に適用される。この乱数検査装置10は発生器11、乱数保存手段12、統計量計算手段13、総計量判定手段14、出力制御手段15および計算機アプリケーション16を備える。   This random number inspection device 10 is applied to random number inspection technology applied to a wide range of fields from general-purpose computers to consumer levels such as personal computers and game machines. The random number inspection device 10 includes a generator 11, a random number storage unit 12, a statistic calculation unit 13, a total metric determination unit 14, an output control unit 15, and a computer application 16.

乱数発生器11は、種々のアプリケーション用の乱数である物理乱数または擬似乱数を生成する乱数発生手段として機能する。乱数発生器11で生成された乱数aは、乱数保存手段12に送られて保存される。生成された乱数aの分布形状は、種々の確率分布が考えられるが、この確率分布は、統計的な理論に基づき検査が可能な乱数である。   The random number generator 11 functions as a random number generating means for generating a physical random number or a pseudo random number that is a random number for various applications. The random number a generated by the random number generator 11 is sent to and stored in the random number storage unit 12. The distribution shape of the generated random number a may be various probability distributions. This probability distribution is a random number that can be inspected based on a statistical theory.

また、乱数保存手段12はメモリ、ハードディスクなどの記憶装置である。乱数保存手段12は、物理乱数発生器に内蔵のメモリやFD,MO,CD,DVDなどの記憶媒体でもよい。さらに、乱数保存手段12は、ハードディスクなどの大容量記憶装置に一旦蓄えておいて、計算機アプリケーション16が必要とする数の乱数を使うようにしてもよい。   The random number storage unit 12 is a storage device such as a memory or a hard disk. The random number storage means 12 may be a memory built in the physical random number generator or a storage medium such as FD, MO, CD, DVD. Further, the random number storage means 12 may be temporarily stored in a large-capacity storage device such as a hard disk and used as many random numbers as the computer application 16 requires.

さらに、統計量計算手段13は、検定方法により計算対象が異なる。検定方法には、カイ二乗検定、KS(Kolmogorov−Smirnov)検定、一様分布検定(頻度検定)、系列検定(serial test)、間隔検定(gap test)、ポーカー検定(poker test)、分割検定(partition test)、札集め検定(coupon collection test)、順列検定(permutation test)、連検定(run test)、t個の数の最大値検定(maximum−of−t test)、衝突検定(collision test)、系列相関検定(serial correlation test)など、幾つもの種類がある。   Furthermore, the calculation target of the statistic calculation means 13 differs depending on the test method. The test methods include chi-square test, KS (Kolmogorov-Smirnov) test, uniform distribution test (frequency test), series test (serial test), interval test (gap test), poker test (poker test), split test ( partition test, bill collection test, permutation test, run test, maximum number of t-number test (maximum-of-t test), collision test There are several types, such as a serial correlation test.

検定方法の選択は、計算機アプリケーション16がどのような乱数を必要とし、どのような乱数を不要とするのかによって決定され、検査される。   The selection of the verification method is determined and checked according to what random number the computer application 16 requires and what random number is unnecessary.

例えば、背景技術で述べたトランプの例のように一様乱数の中から不要な乱数を抽出する必要がある場合には、生成した乱数の数に対して使った乱数の割合が4×53/256になっているか、捨てた乱数の割合が(256−4×53)/256になっているかを統計的に検定することで、必要な乱数を抽出する機能、または不要な乱数を捨てる機能を利用することができ、アプリケーション16が必要とする品質の確認、検査も同時に行うことができる。   For example, when it is necessary to extract an unnecessary random number from uniform random numbers as in the example of the playing card described in the background art, the ratio of the random number used to the generated random number is 4 × 53 / The function of extracting necessary random numbers or the function of discarding unnecessary random numbers by statistically testing whether it is 256 or the ratio of discarded random numbers is (256-4 × 53) / 256 It can be used, and quality confirmation and inspection required by the application 16 can be performed simultaneously.

統計量判定手段14は、有意水準を決めて乱数発生器11が生成した乱数aが起こるものであるか否かを検定する。判定水準は計算機アプリケーション16の要求により決定し、判定条件は統計量判定手段14が有する判定値保持機能に保持される。判定値保持機能は、記憶装置や記憶媒体に保持しても良いし、判定を行なう前にその都度計算機アプリケーション16から判定値保持機能に記憶させる方法でも良い。   The statistic determination means 14 determines a significance level and tests whether or not the random number a generated by the random number generator 11 occurs. The determination level is determined by a request from the computer application 16, and the determination condition is held in the determination value holding function of the statistic determination means 14. The determination value holding function may be held in a storage device or a storage medium, or may be stored in the determination value holding function from the computer application 16 before each determination.

出力制御手段15は、統計量判定手段14が判定した結果が、計算機アプリケーション16が要求する乱数であれば乱数保存手段12に蓄えられた乱数bを計算機アプリケーション16に出力する。このとき、乱数保存手段12に蓄えられた乱数b全体を出力するのか、統計量計算手段13が計算対象とした乱数全体を出力するのか、それぞれ一部を出力するのかは、対象とする検定手法により異なり、最適な方法を用いる必要がある。   The output control unit 15 outputs the random number b stored in the random number storage unit 12 to the computer application 16 if the result determined by the statistic determination unit 14 is a random number requested by the computer application 16. At this time, whether to output the entire random number b stored in the random number storage means 12, whether to output the entire random number for which the statistic calculation means 13 is to be calculated, or whether to output a part of each, is a target test method And it is necessary to use an optimum method.

例えば、統計量計算手段13が、平均値や分散を用いる検定手法(度数や相関の検定)では、計算の対象とした乱数(統計量v)全てを計算機アプリケーション16に出力するか否かを判定することになる。   For example, the statistic calculation means 13 determines whether or not to output all the random numbers (statistics v) to be calculated to the computer application 16 in the test method using the average value or variance (frequency or correlation test). Will do.

また、統計量計算手段13での連検定のように連の長さが長いデータ、例えば0が幾つも続く場合に計算機アプリケーション16が不要とするのであれば、長い連が検出されたときにその連だけを出力しない制御も可能である。この場合、例えば、乱数保存手段12は破棄する連の長さ程度の容量で充分であり、リアルタイムに処理することが可能である。   In addition, if the computer application 16 does not need data having a long run length, for example, 0 continues several times, as in the case of a run test in the statistic calculation means 13, when a long run is detected, Control without outputting only the ream is also possible. In this case, for example, the random number storage unit 12 has a capacity of about the length of the series to be discarded, and can be processed in real time.

図1に示した乱数検査装置10では、一旦、乱数保存手段12に乱数発生器11が生成された乱数aを蓄えておき、統計量計算手段13は乱数保存手段12に蓄えられた乱数bの統計量を計算し、統計量判定手段14は統計量計算手段13が計算した統計量vを判定する。出力制御手段15は統計量判定手段14の判定結果に応じて乱数保存手段12に蓄えられた乱数bを計算機アプリケーション16に出力する。   In the random number inspection apparatus 10 shown in FIG. 1, the random number a generated by the random number generator 11 is temporarily stored in the random number storage unit 12, and the statistic calculation unit 13 stores the random number b stored in the random number storage unit 12. The statistic is calculated, and the statistic determination unit 14 determines the statistic v calculated by the statistic calculation unit 13. The output control unit 15 outputs the random number b stored in the random number storage unit 12 to the computer application 16 according to the determination result of the statistic determination unit 14.

従来、計算機アプリケーション16は、乱数生成の関数を用いて乱数発生器11が生成した乱数aを直接利用していた。その際、必要な乱数aの区間の選別を行っていた。また、乱数aの品質を確認するためには、物理乱数の場合は定期的に検定を実施することが必要で、擬似乱数の場合は利用する乱数系列に対して検定が必要であった。   Conventionally, the computer application 16 directly uses the random number a generated by the random number generator 11 using a random number generation function. At that time, a necessary random number a section was selected. Further, in order to confirm the quality of the random number a, it is necessary to periodically perform a test in the case of a physical random number, and it is necessary to test a random number sequence to be used in the case of a pseudo random number.

本実施形態に示された乱数検査装置10においては、計算機アプリケーション16が必要とする乱数の性質や利用する区間に着目した検定や検査だけを行うことができ、統計量計算手段13および統計量判定手段14で計算対象である乱数bの統計量を計算し、計算した統計量を判定したので、リアルタイムに効率良く品質を確認しながら乱数を利用できる効果がある。   In the random number inspection device 10 shown in the present embodiment, it is possible to perform only tests and tests focusing on the properties of random numbers required by the computer application 16 and the sections to be used. Since the statistic of the random number b to be calculated is calculated by the means 14 and the calculated statistic is determined, the random number can be used while efficiently checking the quality in real time.

また、計算機アプリケーション16が必要とする乱数の区間は、乱数検査装置10が選別することができるので、計算機アプリケーション16は乱数の選別が不要となる。   In addition, since the random number inspection apparatus 10 can select a random number section required by the computer application 16, the computer application 16 does not need to select a random number.

図2は、乱数検査装置10の例えば統計量計算手段13に備えられる指数変換手段の構成例を示すものである。   FIG. 2 shows an example of the configuration of exponent conversion means provided in, for example, the statistic calculation means 13 of the random number inspection apparatus 10.

乱数検査装置10の統計量計算手段13(あるいは統計量判定手段14)には、図2に示すように、乱数を指数に変換する指数変換手段19と区間変換手段20が備えられる。指数変換手段19は、符号部21に符号を設定する符号設定手段22と、指数部23に(指数)値を設定する指数設定手段24と、仮数部25に乱数ビット列を設定する仮数設定手段26とから構成される。   The statistic calculation means 13 (or statistic determination means 14) of the random number inspection device 10 is provided with an exponent conversion means 19 and an interval conversion means 20 for converting random numbers into exponents, as shown in FIG. The exponent conversion means 19 includes a sign setting means 22 for setting a sign in the sign section 21, an exponent setting means 24 for setting an (exponential) value in the exponent section 23, and a mantissa setting means 26 for setting a random number bit string in the mantissa section 25. It consists of.

指数変換手段19は、2値の乱数や整数型の乱数を浮動小数点型に変換して演算するものである。指数変換手段19は乱数が変換されて格納される不動小数点型格納形式27を備え、この浮動小数点型格納形式27は、符号部21、指数部22および仮数部25から構成される。   The exponent conversion means 19 converts binary random numbers and integer random numbers into floating point types and performs calculations. The exponent conversion means 19 has a fixed-point type storage format 27 in which random numbers are converted and stored. The floating-point type storage format 27 includes a sign part 21, an exponent part 22, and a mantissa part 25.

浮動小数点型格納形式27は、IEEEで規格化されており、実際にはIEEE規格に合わせた型に変換される。ここでは説明の都合上、浮動小数点型格納形式27を一般化して説明する。   The floating-point type storage format 27 is standardized by IEEE, and is actually converted into a type conforming to the IEEE standard. Here, for convenience of explanation, the floating-point storage format 27 is generalized and described.

指数変換手段19は、符号設定手段22、指数設定手段23および仮数設定手段24より構成され、符号設定手段22での符号を設定する。符号部21は通常1ビットで、例えば0ならば正、1ならば負を表す。符号部21に乱数を入力すればランダムに正負を発生させることができる。また、指数部23は2のべき乗を表し、べき値がeであれば2であることを表す。 The exponent conversion unit 19 includes a sign setting unit 22, an exponent setting unit 23, and a mantissa setting unit 24, and sets a code in the sign setting unit 22. The sign part 21 is usually 1 bit, for example, 0 indicates positive and 1 indicates negative. If a random number is input to the encoding unit 21, it is possible to generate positive / negative at random. The exponent part 23 represents a power of 2, and if the power value is e, it represents 2 e .

通常は、符号なし整数演算で指数部23を扱えるようにバイアスが用いられるが、本実施形態の乱数検査装置10では、バイアスがないものとして説明する。仮数部25は、1.0以上2.0未満の値を表す。   Normally, a bias is used so that the exponent part 23 can be handled by unsigned integer arithmetic. However, the random number inspection device 10 of the present embodiment will be described as having no bias. The mantissa part 25 represents a value of 1.0 or more and less than 2.0.

例えば、仮数部25に2値乱数を設定することにより、2値乱数を1.0×2以上で2.0×2未満の任意の浮動小数点型乱数に変換することができる。浮動小数点で表現できる精度は仮数部25のビット数に依存する。 For example, by setting a binary random number mantissa 25, it is possible to convert the binary random number to any floating point random number of 2.0 × less than 2 e at 1.0 × 2 e or more. The precision that can be expressed in floating point depends on the number of bits of the mantissa part 25.

仮数部25の最上位ビットは常に1であるため、通常、最上位ビットは浮動小数点格納形式27には含まず、仮数部25の有効桁数を1ビット分向上させている。このビットを暗黙ビットと呼ぶ。例えば、仮数部25が2ビットの場合、仮数部25は100、101、110、111の4種類の値の表現が可能である。   Since the most significant bit of the mantissa part 25 is always 1, normally, the most significant bit is not included in the floating-point storage format 27, and the number of significant digits of the mantissa part 25 is improved by one bit. This bit is called an implicit bit. For example, when the mantissa part 25 is 2 bits, the mantissa part 25 can express four types of values of 100, 101, 110, and 111.

この例で暗黙ビットの3ビットをそれぞれb0、b1、b2としてb0×2+b0×2−1+b0×2−2を計算すると、仮数部25に表現される具体的な数値として、1;1.25;1.5;1.75の4種類の値が得られる。このように2値乱数を任意の浮動小数点型乱数に変換することができるが、計算機アプリケーション16では、通常0.0以上1.0未満の乱数を用いることが多いため区間の変更が必要である。 In this example, when b0 × 2 0 + b0 × 2 −1 + b0 × 2 −2 is calculated by setting 3 implicit bits as b0, b1, and b2, respectively, as a specific numerical value expressed in the mantissa part 25, 1; 1 Four values of .25; 1.5; 1.75 are obtained. In this way, binary random numbers can be converted into arbitrary floating-point random numbers. However, since the computer application 16 usually uses random numbers of 0.0 or more and less than 1.0, it is necessary to change the interval. .

次に、指数変換手段19の仮数部25に表現される、1.0以上2.0未満の値を0.0以上1.0未満の値に変換する方法について仮数部25が2ビットの例で説明する。   Next, an example in which the mantissa part 25 is 2 bits is represented in the method of converting the value of 1.0 or more and less than 2.0 expressed in the mantissa part 25 of the exponent conversion means 19 to a value of 0.0 or more and less than 1.0 I will explain it.

まず、指数変換手段19の符号部21を0(正)に、指数部23を0に、仮数部25の2ビットに2値乱数を設定する。設定された2値乱数の値は1以上2未満であるから、1を減算することにより0以上1未満の乱数を生成することができるように変換することは容易に類推できる。しかし、具体的な演算処理は整数演算のように単純ではない。   First, the sign part 21 of the exponent conversion means 19 is set to 0 (positive), the exponent part 23 is set to 0, and a binary random number is set to 2 bits of the mantissa part 25. Since the value of the set binary random number is 1 or more and less than 2, conversion can be easily made by subtracting 1 so that a random number of 0 or more and less than 1 can be generated. However, specific arithmetic processing is not as simple as integer arithmetic.

具体的には、暗黙ビットを含む仮数部25の3ビットにおいて、1を減算するということは上位のビットを0と考える。すなわち、仮数部25は000、001、010、011の4種類の値と考える。浮動小数点型格納形式27では、最上位が1であるから、仮数部25の左シフト操作と指数部23のカウントダウン(デクリメント)により最上位が1となるよう修正する。   Specifically, subtracting 1 in the 3 bits of the mantissa part 25 including the implicit bits considers the upper bits to be 0. That is, the mantissa part 25 is considered to be four types of values of 000, 001, 010, and 011. In the floating-point type storage format 27, since the most significant is 1, correction is made so that the most significant becomes 1 by the left shift operation of the mantissa part 25 and the countdown (decrement) of the exponent part 23.

なお、ここでは指数変換手段19の説明のためにシフト操作と指数部23の減算を用いるが、高速化のために予めシフト量を求め指数部23を設定する方法もある。仮数部25が000の場合、指数部23を最小値に設定する。   Here, a shift operation and subtraction of the exponent part 23 are used for explaining the exponent conversion means 19, but there is also a method of obtaining the shift amount in advance and setting the exponent part 23 for speeding up. When the mantissa part 25 is 000, the exponent part 23 is set to the minimum value.

指数変換手段19の浮動小数点型格納形式27を構成する仮数部25が001の場合2回左シフトし、指数部23を2回カウントダウンする。仮数部25が010の場合1回左シフトして指数部を1回カウントダウンする。仮数部25が011の場合、1回左シフトして指数部23を1回カウントダウンする。この結果、0.0;1.0×2−2;1.0×2−1;1.5×2−1となり、それぞれ0.0;0.25;0.5;0.75の値が得られる。 When the mantissa part 25 constituting the floating point type storage format 27 of the exponent conversion means 19 is 001, the mantissa part 25 is shifted left twice, and the exponent part 23 is counted down twice. When the mantissa part 25 is 010, it shifts left once and counts down the exponent part once. When the mantissa part 25 is 011, the exponent part 23 is counted down once by shifting once to the left. As a result, 0.0; 1.0 × 2 −2 ; 1.0 × 2 −1 ; 1.5 × 2 −1 respectively, values of 0.0; 0.25; 0.5; 0.75 Is obtained.

また、乱数検査装置10に備えられる指数変換手段19により2値の乱数や整数型の乱数を浮動小数点型に変換した後に区間変換手段20を用いる効果について次に説明する。   The effect of using the interval conversion unit 20 after converting a binary random number or an integer type random number into a floating point type by the exponent conversion unit 19 provided in the random number inspection device 10 will be described next.

浮動小数点型格納形式27の仮数部25が、nビットの整数を0.0以上1.0未満の値の浮動小数点型に変換するには、変換対象とする値をvとすると、通常演算でv/2が実行される。例えば、32ビットの整数を、32ビット以上の仮数を有する浮動小数点型格納形式27に変換することには問題はない。しかし、整数のビット数を、そのビット数よりも小さな仮数部25に変換するときに問題があり、3ビットの整数から2ビットの仮数部に変換するときの例を説明する。 In order for the mantissa part 25 of the floating-point type storage format 27 to convert an n-bit integer to a floating-point type having a value not less than 0.0 and less than 1.0, assuming that the value to be converted is v, the normal operation is performed. v / 2 n is executed. For example, there is no problem in converting a 32-bit integer into a floating-point storage format 27 having a mantissa of 32 bits or more. However, there is a problem when converting the number of bits of an integer into a mantissa part 25 smaller than the number of bits, and an example of converting from a 3-bit integer to a 2-bit mantissa part will be described.

仮数部25で3ビットの整数が取り得る値は、000、001、010、011、100、101、110、111の8種類である。この整数値を8で割った正解は、0.000、0.125、0.250、0.375、0.500、0.625、0.750、0.875となる。しかし、2ビット精度であるため、浮動少数点型格納形式27の仮数部25に、0.0、0.0、0.25、0.25、0.5、0.5、0.75、0.75の値として格納される。   There are eight types of values that the 3-bit integer can take in the mantissa part 25: 000, 001, 010, 011, 100, 101, 110, and 111. Correct answers obtained by dividing the integer value by 8 are 0.000, 0.125, 0.250, 0.375, 0.500, 0.625, 0.750, and 0.875. However, because of the 2-bit precision, the mantissa part 25 of the floating-point type storage format 27 has 0.0, 0.0, 0.25, 0.25, 0.5, 0.5, 0.75, Stored as a value of 0.75.

浮動小数点型格納形式27の仮数部25では、0.0以上1.0未満で各値の発生割合は全て1/4である。8で割った値を2進で表すと0.000、0.001、0.010、0.011、0.100、0.101、0.110、0.111となるが2ビット精度の仮数部25に入れるために最も近い値に丸めが行われる。この丸めにより上位ビットが変化した値の右肩に1を示すと次のような演算結果となり0.000、0.01、0.01、0.10、0.10、0.11、0.11、1.00、で表わされる。 In the mantissa part 25 of the floating point type storage format 27, the generation ratio of each value is ¼ when the value is 0.0 or more and less than 1.0. When the value divided by 8 is expressed in binary, it becomes 0.000, 0.001, 0.010, 0.011, 0.100, 0.101, 0.110, 0.111, but the mantissa with 2-bit precision Rounding is performed to the nearest value for inclusion in part 25. By this rounding when shown a right shoulder value higher bit changes become operational results as follows 0.000,0.01 1, 0.01,0.10 1, 0.10,0.11 1 , 0.11, 1.00 1 .

仮数部25に入れる演算結果を10進で表すと、0.0、0.25、0.25、0.5、0.5、0.75、0.75、1.00となる。これは、0.0以上1.0未満を満足せず、各値の発生割合は0.0、1.0が1/8、その他(0.25、0.5、0.75)が1/4である。最も近い値に丸めを行うことは規格に定められたおりエラーやバグではないが、0.0以上1.0未満の乱数を期待して作成された計算機アプリケーション16で支障が生じる。   When the calculation result put into the mantissa part 25 is expressed in decimal, it becomes 0.0, 0.25, 0.25, 0.5, 0.5, 0.75, 0.75, 1.00. This does not satisfy 0.0 or more and less than 1.0, and the generation ratio of each value is 0.0, 1.0 is 1/8, and other (0.25, 0.5, 0.75) is 1. / 4. Although rounding to the nearest value is defined in the standard and is not an error or a bug, there is a problem in the computer application 16 that is created expecting a random number of 0.0 or more and less than 1.0.

また、乱数を用いる計算機アプリケーション16は、0.0以上1.0未満の区間における一様性を期待して作成されることが多く一様性を満足しない。これに対し、一旦、浮動小数点型の仮数部に乱数を設定することにより、下位ビットからの丸めを回避し、0.0以上1.0未満の区間における一様性を満足するという効果が得られるものである。   In addition, the computer application 16 using random numbers is often created in expectation of uniformity in a section of 0.0 or more and less than 1.0, and does not satisfy the uniformity. On the other hand, once the random number is set in the mantissa part of the floating-point type, rounding from the lower bits is avoided, and the uniformity in the interval of 0.0 or more and less than 1.0 is obtained. It is what

図3は、乱数検査装置10に備えられる指数変換手段19の具体例を示すものである。   FIG. 3 shows a specific example of the exponent conversion means 19 provided in the random number inspection device 10.

指数変換手段19を構成する浮動小数点型格納形式27はIEEEで規格化された単精度浮動小数点型である。具体例の構成は図2に示されたものと異ならないので、同じ構成には同一符号を付して説明する。   The floating point type storage format 27 constituting the exponent conversion means 19 is a single precision floating point type standardized by IEEE. Since the configuration of the specific example is not different from that shown in FIG. 2, the same components will be described with the same reference numerals.

符号設定手段22を正、負、2値乱数に変えるセレクタ回路や、指数設定手段24を他の区間へ変換するセレクタ回路や、仮数設定手段20の乱数が2値乱数の場合はシフトレジスタ回路(共に図示せず)の追加などとすることも可能である。   A selector circuit that changes the sign setting means 22 to positive, negative, binary random numbers, a selector circuit that converts the exponent setting means 24 to another section, and a shift register circuit (when the random number of the mantissa setting means 20 is a binary random number ( It is also possible to add (not shown).

指数変換手段19を構成する浮動小数点型格納形式27の符号部21は1ビットであり、符号設定手段22としてLレベルの信号線を接続する。指数部23は8ビットであり、指数設定手段24として最上位ビットにLレベル、他のビットにHレベルの信号線を接続する。仮数部25は23ビットであり、仮数設定手段26として32ビット整数型乱数のうち23ビットを接続する。   The sign portion 21 of the floating point type storage format 27 constituting the exponent conversion means 19 is 1 bit, and an L level signal line is connected as the sign setting means 22. The exponent part 23 has 8 bits, and as the exponent setting means 24, an L level signal line is connected to the most significant bit and an H level signal line is connected to the other bits. The mantissa part 25 is 23 bits, and the mantissa setting means 26 connects 23 bits of a 32-bit integer random number.

指数変換手段19を用いて、整数型から浮動小数点型への変換は信号線を接続するだけで具体化でき、信号処理を行わないため、乱数が生成された瞬間に変換が完了する。区間変換手段20としては減算器やシフトレジスタを用いてもよいが、現状においては、ハードウェアロジックを用いるよりも、一旦乱数をCPUに読み込みCPU内蔵のコプロセッサを使用することが安価で変換処理の高速性を満足できるので好ましい。また、コプロセッサを単独に入手またはボードで提供されているコプロセッサを用いることも可能である。   The conversion from the integer type to the floating-point type using the exponent conversion means 19 can be realized simply by connecting a signal line, and since signal processing is not performed, the conversion is completed at the moment when a random number is generated. A subtractor or a shift register may be used as the section conversion means 20, but at present, it is cheaper to read a random number into the CPU and use a coprocessor built in the CPU than using hardware logic. This is preferable because it can satisfy the high speed. It is also possible to use a coprocessor obtained separately or provided on a board.

本実施形態に備えられた乱数検査装置10には、指数変換手段19が備えられ、この指数変換手段19を構成する不動小数点型形式27では、一旦、浮動小数点型に変換したデータを用いるため、コプロセッサがIEEE規格通りに丸めを行っても区間および一様性に支障が生じない。   The random number inspection device 10 provided in the present embodiment is provided with exponent conversion means 19, and in the fixed-point type format 27 constituting the exponent conversion means 19, since data once converted into a floating-point type is used, Even if the coprocessor performs rounding according to the IEEE standard, the section and uniformity are not affected.

図4は、乱数検査装置10に備えられる統計量判定手段14の構成例を示すものである。   FIG. 4 shows a configuration example of the statistic determination means 14 provided in the random number inspection device 10.

統計量判定手段14は、M個の測定手段30と、自由度を1に変換する自由度変換手段31と、必要に応じて設けられる統計量計算手段32と、測定値と判定値を直接比較する測定値判定手段33とから構成される。   The statistic determination unit 14 directly compares the measurement value and the determination value with M measurement units 30, a degree-of-freedom conversion unit 31 that converts the degree of freedom into 1, and a statistic calculation unit 32 that is provided as necessary. And a measured value determining means 33.

M個の測定手段30は、M個の測定値s(s,s,…s)を求める。M個の測定値s(s,s,…s)に対応してそれぞれM個の期待値k(k,k,…k)が統計的に得られているものとする。自由度変換手段31は、M個の測定手段30から自由度1の測定値s(s,s,…s)に変換する。統計量計算手段32は、自由度1の2つの測定値sと2つの期待値kから統計量vを計算するものであるが、自由度1の測定値sに変換することにより不要となり、必ずしも必要としない。 M measuring means 30 obtain M measured values s (s 1 , s 2 ,... S m ). Assume that M expected values k (k 1 , k,... K M ) are statistically obtained corresponding to M measured values s (s 1 , s 2 ,... S M ), respectively. The degree-of-freedom conversion means 31 converts the M measurement means 30 into measurement values s (s 1 , s 2 ,... S M ) with one degree of freedom. The statistic calculation means 32 calculates the statistic v from the two measured values s with one degree of freedom and the two expected values k. However, the statistic calculating means 32 becomes unnecessary by converting it into the measured value s with one degree of freedom. do not need.

図4では、統計量判定手段14の処理の手順を示している。測定値判定手段33は、測定値sと予め設定された判定値とを比較し判定を行う。   FIG. 4 shows a processing procedure of the statistic determination means 14. The measurement value determination means 33 compares the measurement value s with a preset determination value to make a determination.

次に、統計量判定手段14の処理例を、カイニ乗検定の場合について数式を用いて原理を説明する。   Next, the principle of the processing example of the statistic determination means 14 will be described using mathematical formulas in the case of the Kini power test.

統計量判定手段14のM個の判定手段30により、N回の試行を行いM種類の測定対象x(x,x,…x)に対して測定値s(s,s,…s)を得たとする。測定対象xの個々の発生確率をρ(ρ,ρ,…ρ)とし次式に示す統計量vがカイ二乗分布に従うとき、カイ二乗検定により測定値sの妥当性を判定することができる。 The M determination means 30 of the statistic determination means 14 perform N trials and measure the measurement values s (s 1 , s 2 ,...) For M types of measurement objects x (x 1 , x 2 ,... X). s M ) is obtained. When the occurrence probability of each measurement object x is ρ (ρ 1 , ρ 2 ,... Ρ M ), and the statistic v shown in the following equation follows a chi-square distribution, the validity of the measurement value s is determined by chi-square test. Can do.

妥当性とは、測定値s(s,s,…s)が滅多に起こらないものであるかどうかを判定し、起こりやすいものであれば、測定値sは妥当であると判定する。但し、次式では説明のため測定対象毎の発生確率ρと試行回数Nの積が期待値になるよう示しているが、検定する統計量vにより異なることがある。 Validity determines whether or not the measured value s (s 1 , s 2 ,... S M ) rarely occurs. If it is likely to occur, the measured value s is determined to be valid. . However, in the following equation, for the sake of explanation, the product of the occurrence probability ρ i for each measurement object and the number of trials N is shown to be an expected value, but it may differ depending on the statistic v to be tested.

Figure 2008197847
Figure 2008197847

ここで、M個の測定値sはs,s,…s、M個の期待値k(k,k,…k)はe(ρN,ρN,ρN,…,ρN)に対応する。測定値s(s,s,…s)の各要素が独立であれば自由度はMであるが、例えばM−1個の測定値sから残りの値が分かる場合には自由度がひとつ減ってM−1となる。 Here, M measurement values s are s 1 , s 2 ,... S M , and M expected values k (k 1 , k 2 ,... K M ) are e (ρ 1 N, ρ 2 N, ρ 3. N, ..., corresponding to ρ M N). If each element of the measurement value s (s 1 , s 2 ,... S M ) is independent, the degree of freedom is M. For example, when the remaining values are known from M−1 measurement values s, the degree of freedom is obtained. Decreases by one to M-1.

次に、自由度変換手段32により測定値sをグループA、グループBの2つに分け自由度1の統計量vが得られるとすると(1)式は(2)式となる。

Figure 2008197847
Next, assuming that the measurement value s is divided into two groups A and B by the degree-of-freedom conversion means 32 and a statistic v 2 with one degree of freedom is obtained, equation (1) becomes equation (2).
Figure 2008197847

全ての測定値sの合計はN、測定対象個々の確率の合計が1であるから、

Figure 2008197847
Figure 2008197847
Since the total of all measured values s is N, and the total probability of each measurement object is 1,
Figure 2008197847
Figure 2008197847

統計量判定手段14は、(4)式より得られた測定値判定手段34で統計量vを判定するものである。統計量vが大きい場合は期待値kに対する差が大きいことを示し、小さい場合は期待値kに近いことを示している。 The statistic determination means 14 determines the statistic v 2 by the measurement value determination means 34 obtained from the equation (4). If statistics v 2 is large indicates that the large difference from the expected value k, is smaller indicates that close to the expected value k.

通常は、期待値kからかけ離れた事象や期待値kに近すぎる事象は起こり難いとし、判定は、(5)式に示すように、統計量

Figure 2008197847


が自由度1のカイ二乗分布の下限値Xと上限値Xの間に入っているか否かを用いて行う。
Figure 2008197847
Normally, an event that is far from the expected value k or an event that is too close to the expected value k is unlikely to occur, and the determination is based on a statistical quantity as shown in equation (5).
Figure 2008197847


It is performed using whether enters between the lower limit value X L and the upper limit value X H of the chi-square distribution with one degree of freedom.
Figure 2008197847

Figure 2008197847
Figure 2008197847
Figure 2008197847
Figure 2008197847

乱数検査装置10における統計量判定手段14としてサイコロを用いた例を説明する。   An example in which a dice is used as the statistic determination means 14 in the random number inspection device 10 will be described.

サイコロをふって出た目の回数を観測する行為は、統計量判定手段34のM個の測定手段30による6値の乱数の生成とそれらの度数の測定に対応する。乱数として発生する値は1から6の数値であり、各数値の回数を測定する6個の測定手段が必要である。例えば、乱数の計算機アプリケーション16は1または6の目が出たときに当り、2、3、4、5の目が出たときにはずれを出力するように設定し、当選を判定する装置だとする。   The act of observing the number of eyes that have passed through the dice corresponds to the generation of 6-value random numbers and the measurement of their frequencies by the M measuring means 30 of the statistic determining means 34. The value generated as a random number is a numerical value from 1 to 6, and six measuring means for measuring the number of times of each numerical value are required. For example, it is assumed that the random number computer application 16 is set to output a shift when the 1st or 6th eye comes out, and outputs a deviation when the 2nd, 3rd, 4th, or 5th eye comes out, and determines the winning. .

計算機計算機アプリケーション16には、サイコロをふって得られる1から6の数値のうち1または6を選別する機能が必要である。通常はサイコロをふる行為が正しいだろうと期待してサイコロをふる。不安があれば、予めサイコロを何度もふって、サイコロが正しいことを複数の検定手法を用いて統計的に確認しておく。   The computer application 16 needs to have a function of selecting 1 or 6 from 1 to 6 obtained by rolling the dice. Usually, the dice is rolled in the hope that the act of rolling the dice will be correct. If there is anxiety, roll the dice many times in advance and statistically confirm that the dice are correct using multiple test methods.

しかし、当選を判定する装置を実際に運用する際には、当りが多いのではないかとか少ないのではないかと疑問が生じる場合がある。サイコロをふる行為を一旦止めて、時間のかかる複数の検定を行うことは現実的ではない。このような場合に、試行した回数と当りの出た回数の2つのデータから、当りが統計的に正しいか否かを判定することができるのが判定条件Jであり、統計量の判定を整数で行なうことができるためハードウェアで実現するときの回路構成が簡単になる。   However, when actually operating a device that determines winning, a question may arise whether there are many wins or not. It is not practical to temporarily stop the act of dice and perform multiple time-consuming tests. In such a case, it is judgment condition J that can judge whether or not the hit is statistically correct from two data of the number of trials and the number of hits, and the determination of the statistic is an integer. Therefore, the circuit configuration when realized by hardware is simplified.

M種類の測定対象から、計算機アプリケーション16が必要とするか否かの2つに分類する場合や計算機アプリケーション16の内部で複数、例えば2つのグループに分類する場合などにおいては、分類結果の一方を用いて自由度1のカイ二乗検定に変換することができる。この変換により統計量vを算出する必要がないことが理解できる。これにより、ハードウェアにおいては整数の比較回路でカイ二乗検定が可能となり、ソフトウェアにおいては短時間にカイ二乗検定を実行することができる効果がある。 When classifying M types of measurement objects into two, whether or not the computer application 16 requires them, or when classifying them into a plurality of, for example, two groups within the computer application 16, one of the classification results is used. Can be converted to a chi-square test with one degree of freedom. It can be understood that it is not necessary to calculate the statistic v 2 by this conversion. As a result, the chi-square test can be performed by an integer comparison circuit in hardware, and the chi-square test can be executed in a short time in software.

図5は、乱数検査装置10の統計量判定手段14に備えられる乱数変換手段の例を示すものである。   FIG. 5 shows an example of random number conversion means provided in the statistic determination means 14 of the random number inspection device 10.

乱数検査装置10の統計量判定手段14には、整数乱数を自由度1の乱数に変換する乱数変換手段35が備えられる。この乱数変換手段35は、Nビット整数乱数Aとi番目のビットBまたはNビット整数乱数Aがシフトレジスタで構成される。乱数検査装置10の統計量判定手段14における乱数変換手段35には、測定値s(s,s,…,s)と判定値Jを直接比較する図示しない判定手段が必要となる。この判定手段には、図4に説明された統計量判定手段14が用いられる。 The statistic determination unit 14 of the random number inspection device 10 includes a random number conversion unit 35 that converts an integer random number into a random number having one degree of freedom. In this random number conversion means 35, an N-bit integer random number A and an i-th bit B or an N-bit integer random number A are constituted by shift registers. The random number conversion means 35 in the statistic determination means 14 of the random number inspection device 10 requires a determination means (not shown) that directly compares the measurement values s (s 1 , s 2 ,..., S M ) with the determination value J v. . As this determination means, the statistic determination means 14 described in FIG. 4 is used.

乱数変換手段35は、整数乱数を自由度1の乱数(情報)に変換する手段である。図4に示された統計量判定手段14では、M種類の測定値s(s,s,…,s)から自由度1の測定値sに変換する具体的方法を説明し、M種類の測定対象を、例えば、2つのグループA,Bに分類することができる。 The random number conversion means 35 is a means for converting an integer random number into a random number (information) having one degree of freedom. In the statistic determination means 14 shown in FIG. 4, a specific method for converting M types of measurement values s (s 1 , s 2 ,..., S M ) into measurement values s with one degree of freedom will be described. For example, the types of measurement objects can be classified into two groups A and B.

M種類の測定値s(s,s,…,s)が2のべき乗である場合、Mを表現する各ビットが2値乱数である。また、Mを構成するビットの列も2値乱数である。計算機内部は2進数であり、整数は8ビット、16ビット、32ビット、64ビットなどの所要単位で格納されており、Mは2のべき乗である。 When M types of measurement values s (s 1 , s 2 ,..., S M ) are powers of 2, each bit representing M is a binary random number. Further, the sequence of bits constituting M is also a binary random number. Inside the computer is a binary number, integers are stored in required units such as 8 bits, 16 bits, 32 bits, 64 bits, etc., and M is a power of 2.

乱数変換手段35では、乱数の生成範囲が整数のビット数である場合、Nビット整数乱数Aのi番目の1ビットBは2値の乱数である。但し、Nビットのうち1ビットしか乱数として使用しないので無駄が多い。この場合、Nビット整数乱数Aの格納機能がシフトレジスタであればNビット分の2値乱数を生成することもできる。LSB(Least Significant Bit)側にシフトして得たシフト2値乱数Bを図5に示した。図示しないがMSB(Most Significant Bit)側にシフトして2値乱数を得ることも可能である。この場合、生成した全ての乱数を2値乱数に変換することができる。   In the random number conversion means 35, when the generation range of the random number is an integer number of bits, the i-th 1-bit B of the N-bit integer random number A is a binary random number. However, since only 1 bit out of N bits is used as a random number, there is a lot of waste. In this case, if the storage function of the N-bit integer random number A is a shift register, N-bit binary random numbers can be generated. FIG. 5 shows a shifted binary random number B obtained by shifting to the LSB (Least Significant Bit) side. Although not shown, it is also possible to obtain a binary random number by shifting to the MSB (Most Significant Bit) side. In this case, all the generated random numbers can be converted into binary random numbers.

i番目の1ビットBまたはシフトで得られる2値乱数Cいずれかの2値乱数を用いる計算機アプリケーション16であれば、自由度を変換することなく直接自由度1の1ビットの乱数が得られる。これにより、図4に説明した統計量判定手段14の構成と同様の作用効果を奏することができる。   If the computer application 16 uses a binary random number of either the i-th 1-bit B or a binary random number C obtained by shifting, a 1-bit random number of 1 degree of freedom can be obtained directly without converting the degrees of freedom. Thereby, there can exist an effect similar to the structure of the statistic determination means 14 demonstrated in FIG.

さらに、乱数検査装置10の統計量判定手段14(または統計量計算手段13)は、統計量としてN次元空間の一部の度数分布を測定(計算)する度数分布測定手段を有する。度数分布測定手段は、図4に示すように、例えば、統計量計算手段32を構成しており、統計量としてN次の度数分布を計算している。度数分布測定手段36A,36Bは、M通りの乱数をN回発生させてN次元の度数分布を求める場合、M種類の度数を求めることになる。高次元の度数分布を求める場合、MやNが大きくなると膨大な処理時間が掛かり全ての度数を検定することは実際には難しい。そこで、度数分布測定手段36A,36Bは、N次元空間の一部で自由度が1となる領域についてのみ検定の対象とする監視(検査)や判定を行なっている。 Further, the statistic determination unit 14 (or the statistic calculation unit 13) of the random number inspection device 10 includes a frequency distribution measurement unit that measures (calculates) a partial frequency distribution in the N-dimensional space as a statistic. As shown in FIG. 4, the frequency distribution measuring unit constitutes, for example, a statistic calculating unit 32 and calculates an Nth-order frequency distribution as a statistic. When the frequency distribution measuring means 36A and 36B generate M random numbers N times to determine an N-dimensional frequency distribution, the frequency distribution measuring means 36A and 36B calculate MN types of frequencies. When obtaining a high-dimensional frequency distribution, if M and N are large, it takes a huge amount of processing time and it is actually difficult to test all frequencies. Therefore, the frequency distribution measuring means 36A and 36B perform monitoring (inspection) and determination that are subject to verification only for a region where the degree of freedom is 1 in a part of the N-dimensional space.

度数分布測定手段36A,36Bは、計算機の主記憶内で度数を求めることにより、一様性の検定を行う次元を大きくしても度数を求めることができる。   The frequency distribution measuring means 36A and 36B can obtain the frequency even if the dimension for performing the uniformity test is increased by obtaining the frequency in the main memory of the computer.

一方、乱数検査装置10は、統計量判定手段14が図6(A)および(B)に示すように、連の度数分布を測定する度数分布測定手段36A,36Bを有する。   On the other hand, the random number inspection device 10 includes frequency distribution measuring means 36A and 36B for measuring the continuous frequency distribution, as shown in FIGS.

この度数分布測定手段36A,36Bは、図6(A)および(B)に示すように、2値乱数測定手段あるいはカウンタ37で測定された2値乱数から連の長さをカウントするカウンタ38またはシフトレジスタ39と、連の長さ毎の度数40a,40bをカウントするカウンタ40とから構成される。   As shown in FIGS. 6 (A) and 6 (B), the frequency distribution measuring means 36A and 36B are either a binary random number measuring means or a counter 38 that counts the length of a series from binary random numbers measured by a counter 37. The shift register 39 includes a counter 40 that counts the frequencies 40a and 40b for each length of the run.

度数分布測定手段36A,36Bは、連の長さを測定する連検査には2値乱数を取り扱う他、幾つかの種類がある。連の長さとしては、0の連の長さ、1の連の長さ、0や1に拘らず別の連の長さを求める方法がある。ここでは、ビット1の長さを求める方法について説明する。   The frequency distribution measuring means 36A and 36B have several types in addition to handling binary random numbers for continuous inspection for measuring the length of the series. As the length of a series, there is a method of obtaining a length of a series of 0, a length of a series of 1, a length of another series regardless of 0 or 1. Here, a method for obtaining the length of bit 1 will be described.

図6(A)に示される度数分布測定手段36Aでは、最初にカウンタ38およびカウンタ40の連の長さ毎の度数40aは0にクリアされている。2値乱数37が順次カウンタ38に入力される。カウンタ38は1が連続する間カウントを続け、0が入力されたとき、カウンタ38には1の連の長さが記録されている。連の長さ毎の度数40はカウンタ40により構成され、カウンタ38のカウント結果に応じた連の長さの回数をカウントする。   In the frequency distribution measuring means 36A shown in FIG. 6A, the frequency 40a for each length of the counter 38 and the counter 40 is first cleared to zero. A binary random number 37 is sequentially input to the counter 38. The counter 38 continues counting while 1 continues, and when 0 is input, the counter 38 records the length of a series of 1s. The frequency 40 for each run length is constituted by a counter 40 and counts the number of run lengths corresponding to the count result of the counter 38.

その後、カウンタ38はカウント値をクリアして2値乱数37が次に1になるまでカウントを停止する。この動作を、N個の2値乱数37が入力されるまで繰り返すことにより、連の長さ毎の度数40aにはN個の乱数に対する連の長さ毎の発生回数が記録される。   Thereafter, the counter 38 clears the count value and stops counting until the binary random number 37 becomes 1 next. By repeating this operation until N binary random numbers 37 are input, the frequency 40a for each run length records the number of occurrences for each run length for the N random numbers.

次に、図6(B)について説明する。図6(B)の度数分布測定手段36Bは、カウンタ38をシフトレジスタ39に置き換えたものである。   Next, FIG. 6B will be described. The frequency distribution measuring means 36 </ b> B in FIG. 6B is obtained by replacing the counter 38 with a shift register 39.

この度数分布測定手段36Bは、最初にシフトレジスタ39および連の長さ毎の度数40bは0にクリアされている。2値乱数37の値が1のときに値1のシフトを行ない、2値乱数37が0になったらシフトを停止する。この結果、シフトレジスタ39には連の数に対応した位置のビットが1となる。連の長さ毎の度数40bはカウンタ40で構成され、シフトレジスタ39のビットが値1になっているカウンタ40を選択してカウントする。   In the frequency distribution measuring means 36B, the shift register 39 and the frequency 40b for each run length are cleared to zero. When the value of the binary random number 37 is 1, the value 1 is shifted. When the binary random number 37 becomes 0, the shift is stopped. As a result, the bit in the position corresponding to the number of runs is 1 in the shift register 39. The frequency 40b for each run length is constituted by a counter 40, and the counter 40 whose bit of the shift register 39 is 1 is selected and counted.

連の長さ毎の度数40bのカウントが行われた後、シフトレジスタ39をクリアして2値乱数37が次に1になるまでカウントを停止させる。この動作を、N個の2値乱数37が入力されるまで繰り返すことにより、連の長さ毎の度数40bにはN個の乱数に対する連の長さ毎の発生回数が記録される。   After the count of the frequency 40b is performed for each run length, the shift register 39 is cleared and the count is stopped until the binary random number 37 becomes 1 next. By repeating this operation until N binary random numbers 37 are input, the frequency 40b for each run length records the number of occurrences for each run length for the N random numbers.

シフトレジスタ39を用いる図6(B)に示される方法では、連の長さの度数40bに対応したビット位置で直接連の長さ毎の度数40bを構成するカウンタ40を選択することができる利点があるが、長さRの連の度数40bを測定するためにはRビットのシフトレジスタ39が必要であるため、長い連の度数40bを扱う場合はカウンタ38を用いる方が好ましい。   In the method shown in FIG. 6B using the shift register 39, it is possible to select the counter 40 constituting the frequency 40b for each run length directly at the bit position corresponding to the run length frequency 40b. However, since the R-bit shift register 39 is necessary to measure the frequency R of the series having the length R, it is preferable to use the counter 38 when handling the frequency 40b of the long series.

図6(A)および(B)に示された度数分布(連の長さ毎の分布)測定手段36A,36Bにより、測定した連の長さ毎の発生回数から(1)式を用いてカイ二乗統計量vを計算することができる。但し、期待値Eは一様分布の統計量を求めるときのようにρNのような形にはならず、乱数の発生回数Nや0の連の数や1の連の数に依存したものとなる。 The frequency distribution (distribution for each run length) measuring means 36A and 36B shown in FIGS. 6 (A) and 6 (B) is used to calculate the chirp using the formula (1) from the number of occurrences for each run length. A square statistic v can be calculated. However, the expected value E v does not take the form of ρ i N as in the case of obtaining a uniform distribution statistic, and depends on the number N of random numbers generated, the number of runs of 0, and the number of runs of 1 Will be.

度数分布測定手段36A,36Bは、0または1が連続する度数を検定する場合はカイ二乗検定となるので、自由度1への変換を行い統計量判定手段14で得られた効果と同等の効果が得られる。   The frequency distribution measuring means 36A, 36B is a chi-square test when testing a frequency with continuous 0 or 1, so that the effect equivalent to the effect obtained by the statistic determination means 14 after conversion to the degree of freedom 1 is obtained. Is obtained.

次に、乱数検査装置10の、例えば統計量判定状態14に備えられる度数分布測定手段36A,36Bの具体例を、図1および図6を参照して説明する。   Next, a specific example of the frequency distribution measuring means 36A, 36B provided in, for example, the statistic determination state 14 of the random number inspection device 10 will be described with reference to FIG. 1 and FIG.

計算機アプリケーション16は、1または0が連続する乱数を不要とする場合がある。例えば、通信に乱数を用いて変調を行う場合に不都合である。また、暗号に使う場合、0または1が連続する部分は元の平文が見えてしまう可能性もあり不都合が生じる。このような計算機アプリケーション16は、例えば、所要の長さr以上の連を使わずに破棄する。   The computer application 16 may not require a random number in which 1 or 0 continues. For example, it is inconvenient when modulation is performed using random numbers for communication. In addition, when used for encryption, there is a possibility that the original plaintext may be seen at a portion where 0 or 1 continues, resulting in inconvenience. Such a computer application 16 discards, for example, without using a series having a required length r or more.

この場合、図6(A)および(B)に示す連の長さ毎の度数40aまたは40bは、長さr(任意の整数)よりも小さい長さの連が発生した回数をカウントする手段と、r以上の長さの連が発生する回数をカウントする手段があれば良い。これにより、度数分布測定手段36A,36Bの測定対象は2種類となり、自由度1の統計量vとなり判定条件Jの形の判定手段(図示せず)を使うことができ、統計量判定手段14で示した効果と同様の効果が得られる。 In this case, the frequency 40a or 40b for each run length shown in FIGS. 6A and 6B is a means for counting the number of times a run having a length smaller than the length r (an arbitrary integer) is generated. It is sufficient if there is a means for counting the number of times that a series having a length of r or more occurs. As a result, the frequency distribution measuring means 36A and 36B have two types of measurement objects, the statistic v 2 having one degree of freedom, and the determination means (not shown) in the form of the determination condition J can be used. The effect similar to the effect shown by 14 is acquired.

また、乱数検査装置10を構成する統計量判定手段14に、整数型ディジタル比較回路44を備えた例を、図7を参照して説明する。   An example in which the statistic determination means 14 constituting the random number inspection apparatus 10 is provided with an integer type digital comparison circuit 44 will be described with reference to FIG.

この整数型ディジタル比較回路44は、nビットの整数型の判定値保持回路45とnビットの整数型の測定値用カウンタ46とnビットのディジタル比較回路47とから構成される。   The integer type digital comparison circuit 44 includes an n-bit integer type determination value holding circuit 45, an n-bit integer type measurement value counter 46, and an n-bit digital comparison circuit 47.

整数型の判定値保持回路45には、判定条件Jに基づく判定値Jが保持される。 The integer type determination value holding circuit 45, the determination value J v based on the determination condition J is maintained.

統計量判定手段14に備えられる整数型ディジタル比較回路44で行なわれる判定値Jの設定方法は、次のようにして行なわれる。 The determination value Jv setting method performed by the integer type digital comparison circuit 44 provided in the statistic determination means 14 is performed as follows.

整数型ディジタル比較回路44の判定値保持回路45において、判定値が固定の場合、判定値保持回路45の出力信号線は判定値になるよう各ビットをGNDまたは電源に接続する。判定値が半固定の場合、各ビットにスイッチやプルアップ抵抗等を用いて設定を変更する。判定値の変更頻度が多い場合、判定値保持回路45をレジスタやラッチやDタイプフリップフロップなどの記憶素子を用い、計算機アプリケーション16(図1参照)との通信手段を設け設定する。   In the determination value holding circuit 45 of the integer type digital comparison circuit 44, when the determination value is fixed, each bit is connected to GND or a power source so that the output signal line of the determination value holding circuit 45 becomes the determination value. When the determination value is semi-fixed, the setting is changed using a switch, a pull-up resistor, or the like for each bit. When the determination value is frequently changed, a storage unit such as a register, a latch, or a D-type flip-flop is used as the determination value holding circuit 45 and communication means with the computer application 16 (see FIG. 1) is provided and set.

Figure 2008197847
Figure 2008197847

この整数型ディジタル比較回路44では判定結果は整数で実現できる。カウンタ46での測定値46(s)は測定対象の度数を求めたものであり整数である。また、(1)式に示すカイ二乗検定においては、検定の精度を考慮し、個々の期待値kが5以上であることが必要である。そのため、測定値sについても5以上となる測定条件を設定する必要がある。具体的な測定条件の設定方法としては試行回数Nを増やす方法や自由度を小さくする方法による。 In this integer type digital comparison circuit 44, the determination result can be realized by an integer. The measured value 46 (s i ) at the counter 46 is an integer obtained by calculating the frequency of the measurement object. In the chi-square test shown in the equation (1), each expected value k i needs to be 5 or more in consideration of the accuracy of the test. For this reason, it is necessary to set a measurement condition for the measured value s i to be 5 or more. Specific measurement condition setting methods include a method of increasing the number of trials N and a method of reducing the degree of freedom.

整数型ディジタル比較回路44においては、測定値sと判定値Jを比較する方法を具体的に記述したものであり、乱数検査装置10の統計量判定手段14、乱数変換手段35および度数分布測定手段36A,36Bに示された効果と同等の作用効果を奏することができる。 The integer type digital comparison circuit 44 specifically describes a method of comparing the measured value s i and the judgment value J v , and includes the statistic judgment means 14, the random number conversion means 35, and the frequency distribution of the random number inspection device 10. The same effects as those shown in the measuring means 36A and 36B can be obtained.

次に、統計量判定状態14に備えられる整数型ディジタル比較回路44における判定条件を、図8を参照して説明する。   Next, determination conditions in the integer type digital comparison circuit 44 provided in the statistic determination state 14 will be described with reference to FIG.

この統計量判定手段14には、1ないし4種類の比較を行なう比較判定手段49を構成要素として備えられる。比較判定手段49の判定条件には4つの条件が示されており、図8の横軸xは測定値sを、縦軸yは期待値をそれぞれ示す。 The statistic determination means 14 is provided with a comparison determination means 49 for performing one to four types of comparison as a constituent element. Four conditions are shown as the judgment conditions of the comparison judgment means 49. In FIG. 8, the horizontal axis x represents the measured value s i and the vertical axis y represents the expected value.

乱数検査装置10の統計量判定手段14における判定条件Jには、個別の判定条件J〜Jが存在する。図8には、各判定条件J〜Jに対応する(7)式が(7−1)式〜(7−4)式に表わされるように、それぞれ個別に存在し、次式で表わされる。

Figure 2008197847
The determination condition J in the statistic determination means 14 of the random number inspection device 10 includes individual determination conditions J 1 to J 4 . In FIG. 8, the expressions (7) corresponding to the respective determination conditions J 1 to J 4 exist individually as represented by the expressions (7-1) to (7-4), respectively, and are represented by the following expressions. It is.
Figure 2008197847

(7−1)式は、図8に示された最下限判定値Aに対応し、(7−2)式は図8の上限判定値Bに、(7−3)式は図8の下限判定値Cに、(7−4)式は図8の最上限判定値Dに、それぞれ対応する。また、(7−5)式は、図8に示す期待値Eの判定値Jである。 (7-1) equation, corresponding to the lower limit determination value A v shown in FIG. 8, (7-2) where the upper threshold value B v 8, (7-3) equation 8 the lower limit determination value C v, (7-4) equation is the lowest upper threshold value D v of Figure 8, the corresponding. Furthermore, (7-5) equation is the determination value J v expected value E v shown in FIG.

統計量判定手段14の比較判定手段49では、例えば、カイ二乗分布の下限値Xと上限値Xをそれぞれ有意水準1%、5%における判定値とする。比較判定手段49のx軸方向の期待値Eは、複数、例えば6つの領域A〜Fに分けられる。 In comparison determination unit 49 of the statistic determining means 14, for example, the lower limit value of the chi-square distribution X L and the upper limit value X H of the 1% significance level, respectively, and the determination value at 5%. Expected value E v in the x axis direction of the comparing and determining means 49, a plurality, for example, is divided into six regions to F.

統計量判定手段14の比較判定手段49では、領域Aおよび領域Fは、測定値siが期待値Eに対してかけ離れているために起こり難い領域であり、測定値siがこれらの領域に入る確率は5%である。領域Cおよび領域Eは、測定値siが期待値Eに近すぎているために起こり難い領域であり、測定値siがこれらの領域C,Eに入る確率は1%である。残りの94%は、領域Bおよび領域Eに入る。計算機アプリケーション16(図1参照)がどの領域A〜Fを使用するかにより、以上の5種類の判定条件から選択される。 In comparison determination unit 49 of the statistic determining means 14, the regions A and F are difficult to occur region for measurement values si are far against the expected value E v, the measured value si enters these areas The probability is 5%. Region C and region E are difficult to occur region for measurement values si are too close to the expected value E v, the probability measure si is entering these areas C, E is 1%. The remaining 94% falls into region B and region E. Depending on which areas A to F the computer application 16 (see FIG. 1) uses, the above five types of determination conditions are selected.

統計量判定手段14の中から比較判定手段49に1つの判定条件を用いる例として、期待値Eに対してかけ離れている測定値siを破棄するが、大きい方にかけ離れている場合は採用するときには最下限判定値Aだけを用いて領域Aを破棄する。この場合、生成した乱数のうち97.5%が採用される。 As an example of using one determination condition to the comparison determination unit 49 from the statistic determining means 14 discards the measured value si which are far against the expected value E v is, if you are far the larger adopted sometimes discard area a by using only the lower limit determination value a v. In this case, 97.5% of the generated random numbers is used.

統計量判定手段14の中から比較判定手段49に2つの判定条件を用いる例として、期待値Eに対してかけ離れた測定値を棄却するが、期待値Eに近い測定値siを採用したいときには、上限判定値Bと下限判定値Cとの判定を行わず最上限判定値Dと最下限判定値Aとを用いて領域Aおよび領域Fを破棄する。この場合、生成した乱数のうち99%が採用される。 As an example of using two determination conditions to the comparison determination unit 49 from the statistic determining means 14, but rejects the measurements far against the expected value E v, I want to adopt a measured value si close to the expected value E v Sometimes, the upper limit determination value B v and the lower limit determination value C v are not determined, and the region A and the region F are discarded using the upper limit determination value D v and the lower limit determination value A v . In this case, 99% of the generated random numbers is adopted.

統計量判定手段14の中から比較判定手段49に3つの比較判定条件を用いる例として、当選を判定する場合のように少ない発生確率で発生する領域のみ採用するとき、例えば、領域Dと領域Fを採用する場合、期待値Eと下限判定値Cと最上限判定値Dとを用いる。この場合、生成した乱数のうち3%が採用される。比較判定条件49に4つの判定条件を用いる例として、領域Bと領域Eを採用する場合、すなわち判定条件Jを用いる。この場合、生成した乱数のうち94%が採用される。 As an example in which three comparison determination conditions are used for the comparison determination means 49 from among the statistic determination means 14, when only regions that occur with a low probability of occurrence are employed as in the case of determining winning, for example, the regions D and F Is used, the expected value Ev , the lower limit determination value Cv, and the maximum upper limit determination value Dv are used. In this case, 3% of the generated random numbers is adopted. As an example of using four determination conditions for the comparison determination condition 49, the case where the region B and the region E are employed, that is, the determination condition J is used. In this case, 94% of the generated random numbers is adopted.

統計量判定手段14に用いられる判定値は下限値Xと上限値Xの2種類であるが、計算機アプリケーション16の採用/不採用の条件を考慮し、(6−1)式から(6−4)式に対応した4種類の判定値A〜Dを用いても良い。 Determination value used for statistic determining means 14 but is two lower limit X L and the upper limit value X H, considering conditions of the adoption / non-adoption of the calculator application 16, from (6-1) (6 -4) Four types of determination values A v to D v corresponding to the equation may be used.

また、統計量判定手段14は、比較判定手段49を用いて、有意水準を1%の判定を行って99%を採用した場合、100回の試行のうち1回は不採用となるが、この割合に疑問が生じるときは、KS検査などで統計量の分布を検定するとよい。   In addition, when the statistic determination unit 14 uses the comparison determination unit 49 to determine 1% as the significance level and adopts 99%, the statistic determination unit 14 is not adopted once out of 100 trials. If you have any doubts about the ratio, you should test the distribution of statistics using a KS test.

この統計量判定手段14に備えられる比較判定手段49では、判定条件として測定値と判定値を比較する方法を具体的に用いることにより、図1ないし図7に示された乱数検査装置10や、この乱数検査装置10に統計量変換手段14、整数乱数変換手段35、度数分布測定手段36A,36Bに示された効果と同等の作用効果を奏する。   In the comparison / determination unit 49 provided in the statistic determination unit 14, the random number test apparatus 10 shown in FIGS. This random number inspection apparatus 10 has the same effects as those shown in the statistic conversion means 14, the integer random number conversion means 35, and the frequency distribution measurement means 36A and 36B.

本発明に係る乱数検査装置の実施形態を示す構成図。The block diagram which shows embodiment of the random number inspection apparatus which concerns on this invention. 図1の乱数検査装置に備えられる指数変換手段を示す構成図。The block diagram which shows the exponent conversion means with which the random number inspection apparatus of FIG. 1 is equipped. 前記乱数検査装置に備えられる具体的な指数変換手段を示す図。The figure which shows the concrete index conversion means with which the said random number test | inspection apparatus is equipped. 前記乱数検査装置に備えられる統計量判定手段を示す構成図。The block diagram which shows the statistic determination means with which the said random number inspection apparatus is equipped. 前記乱数検査装置に備えられる整数乱数変換手段を示す図。The figure which shows the integer random number conversion means with which the said random number test | inspection apparatus is equipped. (A)および(B)は、異なるタイプの度数分布測定手段をそれぞれ示す図。(A) And (B) is a figure which shows a frequency distribution measurement means of a different type, respectively. 前記乱数検査装置の統計量判定手段に備えられる整数型ディジタル比較回路を示す構成図。The block diagram which shows the integer type digital comparison circuit with which the statistic determination means of the said random number test | inspection apparatus is equipped. 前記整数型ディジタル比較回路の判定条件を励磁する図。The figure which excites the determination conditions of the said integer type digital comparison circuit.

符号の説明Explanation of symbols

10 乱数検査装置
11 乱数発生器
12 乱数保存手段
13 統計量計算手段
14 統計量判定手段
15 出力制御手段
16 計算機アプリケーション
19 指数変換手段
20 区間変換手段
21 符号部
22 符号設定手段
23 指数部
24 指数設定手段
25 仮数部
26 仮数設定手段
27 浮動小数点型格納形式
30 測定手段
31 自由度変換手段
32 統計量計算手段
33 測定値判定手段
35 乱数変換手段
36A,36B 度数分布測定手段
37 2値乱数測定手段(カウンタ)
38 カウンタ
39 シフトレジスタ
40 カウンタ
44 整数型ディジタル比較回路
45 判定値保持回路
46 測定値カウンタ
47 ディジタル比較回路
49 比較判定手段
DESCRIPTION OF SYMBOLS 10 Random number inspection apparatus 11 Random number generator 12 Random number preservation | save means 13 Statistics calculation means 14 Statistics determination means 15 Output control means 16 Computer application 19 Exponential conversion means 20 Section conversion means 21 Encoding part 22 Encoding part 23 Exponential part 24 Exponential setting Means 25 Mantissa part 26 Mantissa setting means 27 Floating point type storage format 30 Measuring means 31 Degree of freedom converting means 32 Statistics calculating means 33 Measured value determining means 35 Random number converting means 36A, 36B Frequency distribution measuring means 37 Binary random number measuring means ( counter)
38 counter 39 shift register 40 counter 44 integer type digital comparison circuit 45 judgment value holding circuit 46 measurement value counter 47 digital comparison circuit 49 comparison judgment means

Claims (9)

乱数発生手段で生成された乱数を保存する乱数保存手段と、
この乱数保存手段から出力される乱数の統計量を計算する統計量計算手段と、
計算された統計量を判定する統計量判定手段と、
この統計量判定手段からの判定結果に応じて前記乱数保存手段に保存された乱数をアプリケーションに出力する出力制御手段とを備え、
前記出力制御手段は、前記アプリケーションが必要とする乱数を出力することを特徴とする乱数検査装置。
Random number storage means for storing random numbers generated by the random number generation means;
A statistic calculating means for calculating a statistic of random numbers output from the random number storing means;
A statistic determination means for determining the calculated statistic;
Output control means for outputting the random number stored in the random number storage means to the application according to the determination result from the statistic determination means,
The random number inspection apparatus, wherein the output control means outputs a random number required by the application.
前記統計量計算手段は、
符号部に符号を設定する符号設定手段、指数部に値を設定する指数設定手段および仮数部に乱数ビット列を設定する仮数設定手段から乱数を指数に変換する指数変換手段と、
この指数変換手段からの出力を前記アプリケーションが必要とする乱数の性質および利用区間に変換する区間変換手段とを備えた請求項1記載の乱数検査装置。
The statistic calculation means includes:
A sign setting means for setting a sign in the sign part, an exponent setting means for setting a value in the exponent part, and an exponent conversion means for converting a random number into an exponent from a mantissa setting means for setting a random number bit string in the mantissa part;
2. The random number inspection device according to claim 1, further comprising: interval conversion means for converting an output from the exponent conversion means into a property of random numbers required by the application and a use interval.
前記統計量判定手段は、M個の測定値を求める測定手段と、
自由度を1の測定値に変換する自由度変換手段と、
前記測定値を複数のグループに分けて測定値と予め設定された判定値とを比較する判定手段とを備えたことを特徴とする請求項1記載の乱数検査装置。
The statistic determination means includes measurement means for obtaining M measurement values;
Degree-of-freedom conversion means for converting the degree of freedom into a measured value of 1,
The random number inspection device according to claim 1, further comprising a determination unit that divides the measurement value into a plurality of groups and compares the measurement value with a predetermined determination value.
前記統計量判定手段は、
整数乱数を自由度1の乱数に変換する乱数変換手段と、
前記測定値と予め設定された判定値を直接比較する判定手段とを備えたことを特徴とする請求項1記載の乱数検査装置。
The statistic determination means includes
Random number conversion means for converting an integer random number into a random number of degrees of freedom;
The random number inspection device according to claim 1, further comprising a determination unit that directly compares the measured value with a predetermined determination value.
前記統計量判定手段は、統計量としてN次元空間の一部の度数分布を測定する度数分布測定手段を備えた請求項3または4記載の乱数検査装置。 5. The random number inspection device according to claim 3, wherein the statistic determination unit includes a frequency distribution measurement unit that measures a frequency distribution of a part of the N-dimensional space as a statistic. 前記統計量判定手段は、統計量として連の度数分布を測定する度数分布測定手段を備えたことを特徴とする請求項3乃至請求項4記載の乱数検査装置。 5. The random number inspection device according to claim 3, wherein the statistic determination unit includes a frequency distribution measurement unit that measures a continuous frequency distribution as a statistic. 前記統計量判定手段は、判定値の保存機能と測定値とを比較する整数型ディジタル比較回路を判定手段として備えた請求項1,3または6記載の乱数検査装置。 7. The random number inspection device according to claim 1, wherein said statistic determination means comprises an integer type digital comparison circuit for comparing a determination value storage function and a measured value as determination means. 前記統計量判定手段は、判定手段として1乃至4種類の比較を行なうように構成した請求項1または7記載の乱数検査装置。 The random number inspection device according to claim 1, wherein the statistic determination unit is configured to perform one to four types of comparisons as the determination unit. 生成された物理乱数あるいは擬似乱数の乱数を保存し、
保存された乱数の統計量を計算し、
計算された乱数の統計量を判定し、
前記乱数の統計量からアプリケーションが必要とする乱数を出力することを特徴とする乱数検査方法。
Save the generated physical random number or pseudo-random number,
Calculate the statistics of the stored random numbers,
Determine the statistic of the calculated random number,
A random number inspection method, comprising: outputting a random number required by an application from the random number statistics.
JP2007031305A 2007-02-09 2007-02-09 Random number inspection device and inspection method thereof Expired - Fee Related JP4762166B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007031305A JP4762166B2 (en) 2007-02-09 2007-02-09 Random number inspection device and inspection method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007031305A JP4762166B2 (en) 2007-02-09 2007-02-09 Random number inspection device and inspection method thereof

Publications (2)

Publication Number Publication Date
JP2008197847A true JP2008197847A (en) 2008-08-28
JP4762166B2 JP4762166B2 (en) 2011-08-31

Family

ID=39756742

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007031305A Expired - Fee Related JP4762166B2 (en) 2007-02-09 2007-02-09 Random number inspection device and inspection method thereof

Country Status (1)

Country Link
JP (1) JP4762166B2 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010161775A (en) * 2009-01-06 2010-07-22 Safenet Inc System and method for detecting fro locking
JP2012141774A (en) * 2010-12-28 2012-07-26 Iwate Univ Pseudo random number generation device, pseudo random number generation method and its program
JP2014075082A (en) * 2012-10-05 2014-04-24 Renesas Electronics Corp Random number generator and random number generation method
KR101583471B1 (en) * 2014-12-31 2016-01-08 고려대학교 산학협력단 Apparatus and method for providing random numbers using statistical test of randomness
KR101590473B1 (en) 2009-12-15 2016-02-02 한국전자통신연구원 Apparatus for generating satellite navigation signal
JP2016038469A (en) * 2014-08-07 2016-03-22 日本電信電話株式会社 Hash evaluation server, hash evaluation system and hash evaluation method
WO2020158539A1 (en) * 2019-01-30 2020-08-06 ソニー株式会社 Encryption device, encryption method
CN114462350A (en) * 2021-12-21 2022-05-10 北京百度网讯科技有限公司 Integrated circuit chip verification method and device, electronic equipment and storage medium
CN117290674A (en) * 2023-11-23 2023-12-26 浙江九州量子信息技术股份有限公司 Method and system for counting and positioning repeated codes of large-data-volume random bit sequence
CN117827147A (en) * 2023-12-07 2024-04-05 北京海泰方圆科技股份有限公司 Bit frequency screening method and device, electronic equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003044269A (en) * 2001-07-31 2003-02-14 Anritsu Corp Random number generator and data generator
JP2004310314A (en) * 2003-04-04 2004-11-04 Fdk Corp Physical random number generating device
JP2006318091A (en) * 2005-05-11 2006-11-24 Canon Inc Random number generation device
JP2006318092A (en) * 2005-05-11 2006-11-24 Canon Inc Random number generation agent

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003044269A (en) * 2001-07-31 2003-02-14 Anritsu Corp Random number generator and data generator
JP2004310314A (en) * 2003-04-04 2004-11-04 Fdk Corp Physical random number generating device
JP2006318091A (en) * 2005-05-11 2006-11-24 Canon Inc Random number generation device
JP2006318092A (en) * 2005-05-11 2006-11-24 Canon Inc Random number generation agent

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9594541B2 (en) 2009-01-06 2017-03-14 Inside Secure System and method for detecting FRO locking
JP2010161775A (en) * 2009-01-06 2010-07-22 Safenet Inc System and method for detecting fro locking
KR101590473B1 (en) 2009-12-15 2016-02-02 한국전자통신연구원 Apparatus for generating satellite navigation signal
JP2012141774A (en) * 2010-12-28 2012-07-26 Iwate Univ Pseudo random number generation device, pseudo random number generation method and its program
JP2014075082A (en) * 2012-10-05 2014-04-24 Renesas Electronics Corp Random number generator and random number generation method
JP2016038469A (en) * 2014-08-07 2016-03-22 日本電信電話株式会社 Hash evaluation server, hash evaluation system and hash evaluation method
KR101583471B1 (en) * 2014-12-31 2016-01-08 고려대학교 산학협력단 Apparatus and method for providing random numbers using statistical test of randomness
WO2020158539A1 (en) * 2019-01-30 2020-08-06 ソニー株式会社 Encryption device, encryption method
CN114462350A (en) * 2021-12-21 2022-05-10 北京百度网讯科技有限公司 Integrated circuit chip verification method and device, electronic equipment and storage medium
CN114462350B (en) * 2021-12-21 2022-11-15 北京百度网讯科技有限公司 Integrated circuit chip verification method and device, electronic equipment and storage medium
CN117290674A (en) * 2023-11-23 2023-12-26 浙江九州量子信息技术股份有限公司 Method and system for counting and positioning repeated codes of large-data-volume random bit sequence
CN117290674B (en) * 2023-11-23 2024-04-05 浙江九州量子信息技术股份有限公司 Method and system for counting and positioning repeated codes of large-data-volume random bit sequence
CN117827147A (en) * 2023-12-07 2024-04-05 北京海泰方圆科技股份有限公司 Bit frequency screening method and device, electronic equipment and medium

Also Published As

Publication number Publication date
JP4762166B2 (en) 2011-08-31

Similar Documents

Publication Publication Date Title
JP4762166B2 (en) Random number inspection device and inspection method thereof
JP4263623B2 (en) Monobit run frequency online randomness test
CN104182603A (en) Reliability evaluation method for long-service-life and high-reliability electronic product
KR101733708B1 (en) Method and system for rating measured values taken from a system
JP7294369B2 (en) Methods, devices, electronic devices and programs used for information processing
JP4220398B2 (en) Hadamard transform online irregularity test
CN102945222A (en) Poor information measurement data gross error discrimination method based on Grey System Theory
Li et al. Lithium-ion battery state of health estimation based on multi-source health indicators extraction and sparse Bayesian learning
US20030200239A1 (en) Gap histogram on-line randomness test
CN112307827B (en) Object recognition apparatus, system and method
CN106023231A (en) Method for automatically detecting cattle and sheep in high resolution image
CN116467677A (en) Random number entropy source quality measurement method and device, electronic equipment and storage medium
Fog Chaotic random number generators with random cycle lengths
US20190058578A1 (en) Encryption system including an online tester
CN114764600A (en) Service life prediction method and device for new energy vehicle battery pack and electronic equipment
JP2014085854A (en) Similarity evaluation system, similarity evaluation device, user terminal, similarity evaluation method, and program
CN113919691A (en) Frequency modulation service index measuring and calculating method and related device
JP5122348B2 (en) Random error evaluation method and evaluation apparatus
CN113326256A (en) Processing method for grading early warning
CN117216454B (en) Reliability assessment method and device based on fuzzy non-probability, terminal and storage medium
JP5308133B2 (en) Measurement data transfer control device and method
Fuliang et al. Evaluation of blasting effect based on analytic hierarchy process and cloud model in open-pit mines
CN115618206B (en) Interference data determining method and device, electronic equipment and storage medium
CN112966885B (en) Slope failure mode probability prediction method, device, equipment and readable storage medium
Hallberg et al. Exploring the impact of economic and social factors on stock market performance

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090403

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20100426

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101228

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110225

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110510

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110607

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140617

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140617

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees