П-test and Monte Carlo optimization of pseudo-random sequence generators

We consider the formulation of the problem in which Monte Carlo methods are used to assess the quality of pseudo-random sequence generators. A criterion is formulated for optimizing pseudo-random sequence generators with a uniform distribution law.

Рубрика Физика и энергетика
Вид статья
Язык английский
Дата добавления 07.11.2018
Размер файла 255,6 K

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

Размещено на http://www.allbest.ru/

Р-TEST AND MONTE CARLO OPTIMIZATION OF PSEUDO-RANDOM SEQUENCE GENERATORS

Soutchilin Vladimir

Transoffice-Information GbR

PhD, Chief Technology, Filderstadt (Germany)

Abstract

A formulation of the problem is considered, in which Monte Carlo methods are used to evaluate the quality of pseudo-random sequence generators. Within the framework of this formulation of the problem, a so-called р-Test is proposed that can be used to test any pseudo-random sequence generators with the uniform distribution law. By means of р-Test, a criterion is formulated to optimize the generators of pseudo-random sequences with the uniform distribution law. The results of computer simulation are presented.

Keywords: linear congruence method, Monte Carlo methods, optimization of the pseudo-random sequence generator, test, uniform distribution law

Introduction

Pseudo-random sequence generators (PRSG) today are an integral part of fast any application software [1]. Among them, an important role is played by PRSGs with the uniform distribution law from which PRSGs with any other distribution law can be obtained through a transform. In this regard, it is important to be ensured what is about a good quality of the uniform distribution to be used. To do this, there are various methods for PRSG testing [2].

In this paper, we offer the simple to implement test, as well as a method based on Monte Carlo methods for optimizing PRSGs with the uniform distribution law [3].

monte carlo methods pseudorandom

Using Monte Carlo methods

In Monte Carlo methods, a PRSG is usually first selected, and on its basis the required estimation of the object under study is formed. We will proceed, on the contrary, from the reference value of the required evaluation, in order to estimate on its basis the real quality of PRSG. To do this, we consider a definite integral:

S = (1)

Note that since this integral is a well-known one (namely, S = р/2 [4]), it can be just used as the required reference value.

Calculation of the integral (1) by Monte Carlo methods has to do with the well-known mathematical model [3]. In this model, points within a unit square in which the unit circle is inscribed are randomly sampled, and then the ratio of the number of points M being sampled in the unit circle to the total number of selected points N is determined. In this case, it can be obtained:

р ? 4?M / N (2)

In the case of an ideal PRSG, the calculation accuracy through this model increases in proportion to the number of sampled points. However, real PRSGs (for example, due to the pseudo-random sequence generation method being used) often do not provide the desired quality of uniform distribution [5].

In this case, the quality of a PRSG estimated by means of how accurately the number р is determined. This procedure, which we call then “р-Test”, can be used to evaluate the quality of any PRSG with the uniform distribution law. Below we provide two modules the first of which implements the р-Test (specifically using the function Math. GetRandomNumber [6]), and the second provides a pseudo-random sequence based on the linear congruential method (LCM) [2].

Notes:

1. The program modules presented below are intellectual property, and their use requires a reference to this article.

2. The values of Par1, Par2, Par3 by the second module are part of the author's know-how and can be provided upon request.

Table 1 - Module р-Test

`GetRandomNumber Pi-Test by Method Monte-CarloN=Math.Power(10,5)

z=Math.Power(10,7)

CycleNumber =0

Wid:

CycleNumber= CycleNumber+1

M=0

For i = 1 to N

x=Math.GetRandomNumber(z)/z-0.5

y=Math.GetRandomNumber(z)/z-0.5

If (x*x+y*y) <= 0.25 Then

M=M+1

EndIf

Endfor

PiValue=4*M/N

`Determination of mean of the sample

MeanPiValue=(MeanPiValue*(CycleNumber-1)+PiValue)/CycleNumber

textwindow.Write(” “+MeanPiValue)

If CycleNumber < 25 Then

Goto Wid

EndIf

`End of program

Table 2 - Module LCM

`Modificated LCG {0,1}Sub LCG

g1=Par1*RandValue

g2=Math.Floor(g1)

g3=g1-g2

ga=g3*Par2

gb=g3*Par3

RandValue=gb-ga

ODV:

`Normalisation

If RandValue > 1 Then

RandValue=RandValue/10

Goto ODV

EndIf

EndSub

The results of the р-Test with Math.GetRandomNumber are shown in the diagram below. For comparison, here are also the results based on the LCM. The reference points on the diagram correspond to the average estimation for р as the number of cycle's increases.

Fig. 1 Results of the р-Test

Series1 - Based on Math.GetRandomNumber

Series2 - Based on the LCM

Series3 - Level of р

This diagram clearly shows that the quality of the standard PRSG generator leaves much to be desired. Here, indeed, compared to the LCM, the standard PRSG has two disadvantages.

First, it has a relatively large variance, which is indicated by the phase of “acceleration” (the first 10 points of the diagram).

Secondly, at the stationary section (points 11 to 23), the accuracy of approximation р does not exceed the 2nd decimal place, while in the case of the LCM it is provided by 4 decimal place.

This can be explained by the fact that in this model the generated points are distributed unevenly in the unit square. At the same time, their density in the unit circle occurs to be higher.

In addition, the results of the р-Test illustrate the fact that the quality of different PRSG can vary significantly [5].

Optimization of PRSG

To optimize a PRSG with the uniform distribution law, one can use the quadratic criterion [7]:

E => min (? - a)2 (3)

Ф(м,y))

where

? -sample mean

а -reference value

Note, the function Ф(м,y) has a similarity to the functions that are used to the pseudo-random sequence, for example, to a normal distribution (Box-Muller transform [2]). However, in this mathematical model, this function serves only to correct the distribution law in order to improve the quality of PRSG.

We consider the above formulation of the problem as applied to a correcting function of the form:

Ф(м,y) =(y +м?sin(yр)) (4)

where y is a random variable in the {0,1} interval formed by the standard PRSG generator and м is a small parameter (| м | << 1), since, as a rule, only an insignificant correction of the distribution law of the PRSG is required for optimization. Note, with this definition, in addition, the following necessary relations are satisfied:

0 > Ф(м, y) < 1 (5)

Ф(0, y) = y

Below are the configurations of the function (5) for the three main cases of the parameter м.

Fig. 2 Configurations of the function by different м

Series1 - м < 0

Series2 - м > 0

Series3 - м = 0

Discussion

In computer simulation, as a result of optimization of the standard PRSG, the value of м is obtained by the above-described scheme, which provides a better approximation of р and thus a higher quality of the implementation with the standard function Math.GetRandomNumber after its correction. We note that in this case the parameter м turned out to be greater than zero, i.e. the configuration of the function (4) corresponds to the red curve in Fig. 2. The average estimations obtained in the Monte Carlo model with optimized PRSG are presented in the diagram below, together with the estimation for the standard PRSG from the diagram in Fig. 2.

Fig. 3 Results of optimization

Series1 - Before optimization

Series2 - After optimization

Series3 - Level of р

From this diagram, it can be seen that the Monte Carlo model with an optimized PRSG generator has a smaller dispersion and improves the approximation of the р (according to the results - up to the third decimal place).

Conclusion

Above, we considered the formulation of a problem in which the Monte Carlo methods are used to evaluate the quality PRSG with the uniform distribution law. In the framework of this problem formulation, a р-Test with a simple implementation considered above is proposed that can be used to verify the quality of any PRSG with the uniform distribution law. Therefore, this test should be a good supplement to existing testing methods. In addition, it has been shown that this р-Test can be successfully used to optimize PRSG with the uniform distribution law. Performance of the proposed approach is confirmed by the results of computer simulation.

References

1. Intel Digital Random Number Generator (DRNG): Software Implementation Guide. [Электронный ресурс] https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide

2. Soto Juan. Statistical Testing of Random Number Generators. Proceedings of the 22nd National Information Systems Security Conference. - 10/99

3. James E. Gentle. Random Number Generation and Monte Carlo Methods. - Springer Science & Business Media. 2013: 247 с.

4. Бронштейн И.Н., Семендяев К. А. Справочник по математике для инженеров и учащихся втузов - М.: Изд-во. Наука. 1967: 608 с.

5. Stephen K. Park and Keith W. Miller (1988). Random Number Generators: Good Ones Are Hard To Find. Communications of the ACM 31 (10): 1192 - 1201[4]

6. Small Basic - The Programmer's Guide. [Электронный ресурс]. https://www.i-programmer.info/programming/other-languages/5196-small-basic-the-programmers-guide.html

7. Сучилин В.А. Вычислительная схема квадратичной оптимизации. Изв. ВУЗов. «Радиоэлектроника», Вып. 6, 1990.

Размещено на Allbest.ru

...

Подобные документы

  • The Rational Dynamics. The Classification of Shannon Isomorphisms. Problems in Parabolic Dynamics. Fundamental Properties of Hulls. An Application to the Invertibility of Ultra-Continuously Meager Random Variables. Fundamental Properties of Invariant.

    диссертация [1,6 M], добавлен 24.10.2012

  • The basic principles and the protection of power lines patterns used in this process methods. Physical basics of high-power transformers in substations. Justification of the information received. Diagram illustrating the operation of the protection.

    презентация [628,0 K], добавлен 18.02.2016

  • Stress in beams. Thin walled beams. Mechanical beam quality depends on several of its characteristics. The size and shape of its cross-section. Determining the size and shape of the cross section peppered. Сlosed or open cross sections of a beam.

    презентация [100,6 K], добавлен 30.11.2013

  • Frequency of distribution of a pseudo erosion of neck of uterus. Stydying of clinico–morphological types of pseudo erosion of neck of uterus. Stydying of a age features. Damages at abortion or at the time of delivery, infections transmittable sexual ways.

    реферат [2,5 M], добавлен 13.10.2013

  • Using constructions "There is/ There are". Form "to be going to" sentences, meaning. Test exercises with pronouns. The Future Indefinite Tense. Modal verbs, the articles, noun. Past Tenses, passive voice, the Sequence of Tenses, prepositions in English.

    тест [49,6 K], добавлен 10.12.2011

  • История исследования возможности получения потомков с точной генетической копией организма. Описание методов трансплантации ядер, генетического перепрограммирования клеток кожи и SLIC (sequence and ligation-independent cloning) способа клонирования.

    реферат [113,1 K], добавлен 15.06.2010

  • Основы работы в среде LabView. Разработка виртуального измерительного прибора, который будет преобразовывать значение температуры из градусов Цельсия (°С) в температуру по Фаренгейту (°F). Блок-диаграмма и элемент управления термометра на основе random.

    контрольная работа [461,4 K], добавлен 20.10.2015

  • Protein and energy storage. Fatty acid biosynthesis. Formation of malonyl-CoA. The pantothenate group of ACP. Two-step sequence of the oxaloacetate. Synthesis of triacylglycerols. Cholesterol biosynthesis and its control. The alcohol groups of mevalonate.

    лекция [15,3 K], добавлен 08.05.2010

  • Структурне проектування: data flow та entity-relation diagram. Об’єктно-орієнтоване проектування: use case, class, statechart, activity та sequence diagram. Верифікація та консолідація даних. Реалізація інформаційної системи для рекламного агентства.

    курсовая работа [3,4 M], добавлен 25.12.2013

  • Оперативна пам'ять як один з найважливіших елементів комп'ютера. Історія, розвиток та принцип функціонування пам'яті з довільним доступом (RAM - Random Access Memory). Будова, принцип організації, функціонування. Аналіз процесорів MMX, їх продуктивність.

    курсовая работа [176,6 K], добавлен 31.10.2014

  • Виды и внешние устройство системных блоков. Вывод звукового сигнала на акустическую систему. Оперативная память (Random Access Memory - память с произвольным доступом). Системная плата компьютера. Дисководы для работы со сменными носителями информации.

    презентация [1,8 M], добавлен 20.09.2013

  • Проектирование схемы реляционной базы данных торговой компании. Создание диаграмм последовательности (Sequence Diagram) и кооперативных диаграмм (Collaboration diagram). Автоматическая генерация кода нескольких компонентов средствами Rational Rose.

    курсовая работа [2,0 M], добавлен 26.06.2015

  • Составление программы для нахождения минимального и максимального элементов массива. Программа вычисления корней квадратных алгебраических уравнений. Ранжирование одномерного массива по заданному признаку. Формирование массивов с помощью функции random.

    контрольная работа [1,0 M], добавлен 30.04.2013

  • Розрахунок формуючого фільтра, ітераційна коригування його параметрів. Моделювання СП методом формуючого фільтра (ФФ2),), якщо базовим генератором є блок Band Limited White Noise, Random Number. Моделювання та аналіз частотних характеристик ФФ1 і ФФ2.

    курсовая работа [461,9 K], добавлен 08.04.2013

  • Central Processing Unit. Controls timing of all computer operations. Types of adapter card. Provides quick access to data. Uses devices like printer. Random Access Memory. Directs and coordinates operations in computer. Control the speed of the operation.

    презентация [3,5 M], добавлен 04.05.2012

  • Моделювання стохастичних процесів методом формуючого фільтра, якщо базовим генератором є блок Band Limited White Noise. Коригування параметрів формуючого фільтра. Моделювання СП методом формуючого фільтра, якщо базовим генератором є блок Random Number.

    курсовая работа [2,9 M], добавлен 26.09.2012

  • The geographic characteristics of the Novaya Zemlya archipelago in the Arctic Ocean. The history of the test site at Novaya Zemlya. Learning the facts about the nuclear test site. Description of the scope and consequences of the explosion of King-bomb.

    презентация [1,2 M], добавлен 18.10.2015

  • Cash flow test and balance sheet test. The reasons of not having a single test. The definition and treatment of the debts and liabilities under the both tests. Some differences between Maltese law and UK law in this question.

    реферат [10,7 K], добавлен 11.09.2006

  • The modern picture of quality of goods. Role of goods in satisfaction of necessities on the basis of theory of Maslou. The conception of the society of consumption. The separate service of technical control, independent of production of Henry Ford.

    реферат [205,3 K], добавлен 23.10.2010

  • Investigation of the problem with non-local conditions on the characteristic and on the line of degeneracy . The solution of the modied Cauchy problem with initial data. The solution of singular integral equations. Calculation of the inner integral.

    статья [469,4 K], добавлен 15.06.2015

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.