Title:Varies statistical test of pseudorandom number generator

Size: px
Start display at page:

Download "Title:Varies statistical test of pseudorandom number generator"

Transcription

1 Master Project Title:Varies statistical test of pseudorandom number generator Mohammad shafiqul haque Subject: Mathematics Level: Advance Course code: 4MA11E

2

3 Abstract This thesis is related to varies statistical test of pseudorandom number generator. In this thesis I have tried to discuss some aspects of selecting and testing Pseudorandom number generators. The outputs of such generators may be used in many cryptographic applications, such as the generation of key material. After statistical test I have tried to compaire the test value of every generator and have discussed which one is producing good sequences and which one is a good generator. Key-words: Pseudorandom number generator (PRNG), Statistical test,test value, Acknowledgments I would like to thank my supervisor Marcus Nilsson for accepting and giving chance and encourage to do my thesis under his kind supervision. I also want to thank of my head of department and teachers who helped us in different ways. I am also thankfull to my parents and friends who suported and encourage during my study. I am also giving thanks to the university library and university lab for their excellent support. At last I am giving thanks to the swedish government for giving excellent oppertunity for study in sweden. iii

4 Contents 1 Introduction Aim of the Project Random and pseudorandom number generators (RNGs and PRNG) Need for statistical test and why? Applications of PRNG Simulation Cryptography Some Types of PRNGs Linear Congruential Generator How to produce a bit sequence Probability Distribution Gamma distribution chi-square (χ 2 ) distribution chi-square tests 8 6 statistical test Monobit test Twobit test Threebit test Subsequences of length t General discussion about testvalues percentage Investigates of some pseudo random number generators Generator Generator Generator Generator Generator Conclusion 16 References 16 9 appendix 17 iv

5 1 Introduction There are two basic types of generators for creating random sequences. One is random numbar generator (RNG) and another is pseudorandom number generator (PRNG). Generally, a random number generator uses a non-deterministic source i.e. unpredictable source along with some processing function to generate random sequence. The outputs of an RNG may be used directly as a random number or may be fed into a pseudorandom number generator (PRNG) and, the pseudorandom number generator creates a sequence of random bits from an initial value called a seed by using known algorithm. Random numbers play an important role in the field of network security applicaitons. The need for random and pseudorandom numbers arises in many cryptographic applications. Cryptographic protocols require random or pseudorandom inputs at various points, and also for auxiliary quantaties used in generating digital signatures of the employes authenticaiton. We can generate random number by spinning wheels or rolling dice or card shuffling. Nowadays we can produce a pseudorandom number sequence by using the latest computer technology. Pseudorandom numbers sequences are very useful for different types of applications. Let suppose simulation, sampling, numerical analysis and computer programming see [1]. By using PRNG with one or more inputs we can generate a lots of "pseudorandom" numbers. A random number seems to be more random and we can obtain it through natural sources of the random numbers. We can choose an example from a semiconductor resistor that is thermal noise. It is a good source of randomness. On the other hand, just as flipping coins to generate random bits would not be practical for cryptographic applications, most natural conditions are not practical due to the natural slowness in sampling the procedure and the complexity of ensuring that an opponent does not examine the process see [2]. There are many types of methods to create a pseudo random number and we have read that the Linear Congruential method and the Blum Blum Shub method are widely used to create a pseudorandom number. 1.1 Aim of the Project The aim of the project is by using pseudorandom number generators in Mathematica we will do various statistical tests of various kinds of generators and after getting these statistical test values we will discuss the randomness of the sequences. 1.2 Random and pseudorandom number generators (RNGs and PRNG) At the heart of simulations of random models is a method for producing random numbersa procedure or function that will churn out number after number uniformly distributed in the interval [0,1]. The method explained in this section is the method used by most programming languages which have built in random number generators. Actually, the random number generator will be a specific formula that produces random numbers in a completely deterministic way. This is a contradiction to the very idea of randomness. Consequently, the numbers produced by the random number generator are often called pseudorandom because, although they have a very definite pattern, they appear to have no discernible pattern detectable without knowing the exact formula used. The fact that the same sequence of pseudorandom numbers is generated each time the generator is used even useful in helping debug programs and understanding the results of the simulation. The second type of generator is pseudorandom number generator (PRNG). A PRNG uses one or more inputs and generates multiple pseudorandom numbers. Inputs to PRNGs are called seeds. In contexts in which unpredictability is needed, the seed itself must be random and unpredictable. Hence, by default, a PRNG should obtain its seeds from the 1

6 outputs of an RNG, so a PRNG requires a RNG as a companion. The outputs of a PRNG are typically deterministic functions of the seed, so all true randomness is confined to seed generation. The deterministic nature of the process leads to the term pseudorandom. Since each element of a pseudorandom sequence is reproducible from its seed, only the seed needs to be saved if reproduction or validation of the pseudorandom sequence is required. Ironically, pseudorandom numbers often appear to be more random than random numbers obtained from physical sources. If a pseudorandom sequence is properly constructed, each value in the sequence is produced from the previous value via transformations that appear to introduce additional randomness. A series of such transformations can eliminate statistical auto correlations between input and output. Thus, the outputs of a PRNG may have better statistical properties and be produced faster than an RNG. Randomness means "no pattern", pseudorandomness means "no apparent pattern". Start with positive integers MULT(for multiplier), ADDR(for adder), and NORM(for normalizer). SEED is to be a pseudorandom number satisfying 0 SEED < NORM Each time a new random number is needed, it is produced from the previous value of SEED by the formula SEED :=(MULT SEED + ADDR)modNORM That is, first SEED gets multiplied by MULT, then ADDR is added on, and finally the remainder upon division by Norm is the new value of SEED. Example 1.1. Use these values MULT := 6 ADDR := 5 NORM := 11 What values of SEED will be produced if the initial value of SEED is 0? if the initial value is 4? Each time the new value of SEED is SEED :=(6 SEED+ 5)mod11. With SEED initially 0 this sequence is generated With SEED initially 4 this sequence is generated From Example 1 two facts are apparent: First, since the next number in the sequence is generated from only the value of the previous number, if any number is generated again, the entire list is a repetition from that point on. Second, the "cycle length"- the number of distinct numbers before repetition occurs-can be at most of length equal to the value of NORM. This is so since the mod function produces the remainder upon division by NORM, which necessarily is a number between 0 and NORM-1; thus there are NORM many possible remainders-norm many possible values of the random number SEED, that is; and as soon as one is repeated, repetition of the entire list occurs. A good random number generator would use values of MULT, ADDR, and NORM so that the cycle length is large. 2

7 Example 1.2. Consider the generator SEED :=(6 SEED+ 3)mod7 Then with different initial values of SEED, these sequences are generated: Although the value of NORM= 7 suggests that the cycle length might be the maximum value of 7, the actual cycle lengths are small; if SEED is initially 5, then the random number generator is quite useless. The theory of what values of the parameters result in good random number generators is complicated and more a subject of abstract algebra than of probability see [3]. 1.3 Need for statistical test and why? My thesis is related to statistical test and I have to do statistical test in mathematica. Without statistical test it is not possible to get the test value sequence and without sequence it is also not possible to justify randomness of sequences. After doing statistical test we will check the randomness of the sequences. [4]. 2 Applications of PRNG 2.1 Simulation Simulation is essentially a technique of statistical sampling control. Used in combination with a model to obtain approximate answers to questions about complex, multifactorial probalistic problems. It is very useful when the numerical and analytical techniques can not answer. Simulation is infact a statistical experiment, performed in a digital computer see [5]. Statistical models for estimating the characteristics of the distributions as a means of functions, quantiles and other functions that can not be calculated in closed form. Using a simulation estimator, it is good for calculating a measure of how accurate the estimate, plus the estimate itself see [6]. Simulation is a technique that can be used to shed light on how a complex system as well as a thorough analysis is not available. Example 2.1. Engineers can simulate traffic models in the surrounding area of a construction plan to use what the effects may have different limitations. A physicist can simulate the activities of gas molecules under conditions that are enclosed by no known assumptions. Statistical models used to estimate the probability of the type of our models can not be considered logically. Simulation, because it includes and ingredients of randomness in an analysis, it is occasionally the Monte Carlo analysis, the name of the famour European gambling see [6]. 3

8 2.2 Cryptography Cryptography means hiding information. We can see the use of cryptography in the field of mathematics, computer science and engineering. We are using cryptography in the advanced applications for example ATM (automated teller machine) Cards, computer passwords, and the electronic commerce Pseudorandom number generator is related to cryptography the degine of Pseudorandom number generators is one of the main issues in stream ciphering, where Pseudorandom number sequences are often employed as keystreams see [7]. Example 2.2. In cryptograph to encrypt a plaintext we can use a pseudorandom number as a key stream and to decrypt the ciphertext also use pseudorandom number then we get our plaintext again. So we can see here pseudorandom number is very essential in our cryptograpic application. Our plaintext is Key stream is Add by bit wise then Our ciphertext becomes Again if we add kye stream with ciphertext by bit wise then we will get back our plaintext which is given below 3 Some Types of PRNGs 3.1 Linear Congruential Generator plus plaintext The most widely used technique for pseudorandom number generation is an algorithm, it is called linear congruential method, first introduced by D. H. Lehmer in We need to choose four parameters which are given in the table below. Parameter name m a c X 0 Range 0 < m 0 a < m 0 c < m 0 X 0 < m The sequence of random numbers (X n ) is obtained via the following equation X n+1 (ax n + c) (mod m),0 X n+1 < m. (3.1) This will produce a sequence of integers with each integer in the range 0 X n < m, (see [4]). Example 3.1. Let us now consider the Linear Congruential Generator for the parameters m=5, a=2, X 0 = 2 and c=1. We get, X 1 2 X (mod m) (mod 5) 4

9 5 (mod 5) and, in a similar way we get, 0 (mod 5) X (mod 5) X 3 3,X 4 2,X 5 0,X 6 1. The sequence is Wecanseethat the sequence is repeating with period How to produce a bit sequence We will discuss about how to produce a bit sequence. We can consider a linear congruential equation mod m and its starting value X 0 =2. X n 3X n (mod m),x 0 = 2. (3.2) By using the above mentioned linear congruential equation we can produce a binary sequence of S m. We can also produce the binary sequence by using the last bit, last three bits and last six bits of every number in S m. Example 3.2. Let us take m=11 in our linear congruantial equation then we can produce the binary sequence by using the last bit, last three bits and last six bits of every number in S 11 our linear congruantial equation becomes If we take n=1, then our equation becomes when n=2 X n 3X n (mod 11),X 0 = 2. X 1 3X (mod 11). X (mod 11). X 1 11 (mod 11). X 1 = 0 X 2 3X (mod 11). X (mod 11). X 2 5 (mod 11). X 2 = 5 In a similar way we get the sequence Now we will make it to a binary sequence. So our binary sequence becomes Now we will produce a binary sequence by using the last three bits of every number in S 11. The binary sequence of 2 is 2 =

10 So the binary sequence of 2 is 1 0 In a similar way we get the binary sequence of 0 is 0 The binary sequence of 5 is101 The binary sequence of 9 is1001 The binary sequence of 10 is1010 Now the binary sequence by using the last bit of every number in S 11 are 0,0,1,1,0,0. The binary sequence by using the last three bits of every number in S 11 are 010,000,101,001,010. The binary sequence by using the last six bits of every number in S 11 are ,000000,000101,001001, Probability Distribution A probability distribution indicates either the probability of each value of an unidentified random variable or the probability of the value falling within a particular interval. The behavior of a random variable is characterized by its probability distribution, that is, by the way probabilities are distributed over the values it assumes. The corresponding functions for a continuous random variable are the probability distribution function, probability distributions are uses to calculate definite intervals for parameters and to calculate critical area for hypothesis tests. It is sometimes useful to identify a reasonable distributional model for the data. Statistical intervals and hypothesis tests are often based on specific distributional assumptions. Before computing an interval based on distributional assumption, we need to justify that the assumption is justified for the given data. In this case, the distribution does not need to be the best-fitting distribution for the data. But an adequate enough that the statistical technique yields valid conclusions. Also simulation studies with random numbers generated from using a specific probability distribution are often needed. That the term probability functions covers both discrete and continuous distributions. We may use the term probability density functions to mean both discrete and continuous probability functions. Given a random experiment with its associated random variable X and given a real number x, let us consider the probability of the even (s : X(s) x),or, simply, P(X x). This probability is clearly dependent on the assigned value x. The function F x (x)=p(x x), (4.1) is defined as the probability density function (PDF), or simply the distribution function, of X. In equation(4.1), subscript X identifies the random variable. This subscript is sometimes omitted when there is no risk of confusion. Let us repeat that F x (x) is simply P(A), the probability of an event A occuring, the event being X x. The PDF is thus the probability that X will assume a value lying in a subset of S, the subset being point x and all points lying to the left of x. As x increases, the subset covers more of the real line, and the value of PDF increases until it reaches 1. The PDF of a random variable thus accumulates probability as x increases, and the name cumulative distribution function (CDF) is also used for this function. In view of the definition and the discussion above, we give some of the important properties possessed by a PDF. It exists for discrete and continuous random variables and has values between 0 and 1. It is a nonnegative, continuous to the left, and nondecreasing function of the real variable x. F x ( )=0,andF x (+ )=1 (4.2) 6

11 If a and b are two real numbers such that a < b,than This relation is a direct result of the identity P(a < X b)=f x (b) F x (a). (4.3) P(X b)=p(x a)+p(a < X b). We see from equation (4.3) that the probability of X having a value in an arbitrary interval can be represented by the difference between two values of the PDF. Generalizing, probabilities associated with any sets of intervals are derivable from the PDF see [8]. 4.1 Gamma distribution A random variable X with density f (x)= 1 Γ(α)β α xα 1 e x β where x > 0, α > 0, β > 0 is said to have a gamma distribution with parameters α and β see[10], where Γ(α)= t α 1 e t dt chi-square (χ 2 ) distribution A particular type of gamma distribution known as a χ 2 distribution. This distribution is closely related to a random samples from a normal distribution, which is widely applied in the field of statistics. The gamma distribution with parameter α and β, and positive integer n, the gamma distribution for which α = n/2 and β = 1/2 is called the chi square distribution with n degrees of freedom. The chi square distribution has one parameter, Figure 4.1: chi square distribution with 6 degrees of fredom its degrees of freedom. It has a opposite skew, the skew is less with more degrees of freedom. As the degrees of fredom increase, the chi square distribution approaches a normal distribution. The mean of a chi square distribution is its degree of freedom. see [6] 7

12 Figure 4.2: chi square distribution with 3 degrees of freedom Figure 5.1: chi square distribution with 5 degrees of freedom 5 chi-square tests Any statistical test that uses the chi- square distribution can be called chi-square test. The chi square test is perhaps the best known of statistical test and it is basic method that is used in connection many other test. In a particular example of the chi square test as it might be applied to dice throwing. The chi Square distribution is a mathematical distribution that is directly in many tests of significance. The most common use of the chi square distribution is to test differences among propertions. Although this test is by no means the only test based on the chi square distribution, it has come to be known as the chi square test The chi-square test is the most commonly used method for comparing frequences or propertions. It is a statistical test used to determine if observed data deviate from those expected under a particular hypothesis. The chi-square test is also referred to as a test of a measure of "goodness of fit" between data. The χ 2 distribution with k- 1 degrees of freedom is a process for testing the null hypothes is that our data from an sample from a specific distribution against the alternative hypothesis that the data have some other distribution. The test is most natural when the specific distribution is discrete. Suppose that there are k possible values for each observation. We observe N i with value i for i = 1,...,k. Suppose that the null hypothesis says that the probability of the ith possible value is p i for i = 1,...,k. Then we compute k (N i np i ) Q = 2 (5.1) i=1 np i Where n = k i=1 N i is a simpel size. When the null hypothesis says that the data have a continuous distribution, then one must first create a corresponding discrete distribution. One does this by dividing the real line into finitely many intervals, calculating the probability of each interval p 1,...p k, and then pretending as we learned from the data 8

13 were into which intervals each obserbation fell. This converts the original data into discrete data with k possible values. All the χ 2 test statistics in this text have the form, where "observed" stands for an observed count, and "expected" stands for the expected value of the observed count under the assumption that the null hypothesis is true. In 1900, Karl Pearson showed that if the hypothesis H 0 is true, then as the sample size n, the degrees of freedom of Q converges to the degrees of freedom of the χ 2 distribution with k-1 degrees of freedom. Thus if H 0 is true, and the sample size n is large, the distribution of Q will be approximately a χ 2 distribution with k-1 degrees of freedom the discussion that we have presented indicates that H 0 should be rejected when Q C, where C is an appropriate constant. If it is desired to carry out the at the level of significance o, then C should be chosen to be the 1 o quantity of the χ 2 distribution with k-1 degrees of freedom. This is called the χ 2 test of goodness-of-fit. see [6] The chi-square analysis is used to test the null hypothesis H 0, which is the hypothesis that states there is no significant difference between expected and observed data. Investigators either accept or reject H 0, after compairing the value of chi-square to a probability distribution. Chi-square values with low probability lead to the rejection of H 0 and it is assumed that a factor other than chance creates a large deviation between expected and observed results. (observed expected)2 expected Example 5.1. If we flip a coin 200 times the probability of flipping heads is 0.5, and the probability of flipping tails is 0.5 this means that we are predicting that half of the time the coin will come up heads, and half of the time the coin will come up tails. then our hypothesis predicts. Expected; Heads-100, Tails-100, total- 200 to test hypothesis, we are flipping our penny 200 times. Observed: Heads- 108, Tails- 92, total- 200 our chi-square formula is k (N i np i ) Q = 2 (5.2) i=1 np i For heads, (N i np i ) 2 =( ) 2 =(8) 2 = 64 For tails, (N i np i ) 2 =(92 100) 2 =( 8) 2 = 64 The number of trails is very important. A particular deviation from perfect means a lot more if there are only a few trials then it would if there were many trials, this is done by dividing our (N i np i ) 2 values by the expected values For heads, (N i np i ) 2 np i = = 0.64 For tails, (N i np i ) 2 np i = =0.64 To calculate the chi-square value for our experiment, we add together all of the (N i np i ) 2 values sum of χ 2 = = 1.28 We can descrive all information by the following table. data observed expected (O E) (O E) 2 (O E) 2 E heads tails total sum χ 2 = np i

14 Nowwehavetofindχ 2 (v) (degrees of freedom ). To calculate the χ 2 (v) we need to know the numbers of classes of data. In the case of this example that number would be two ("Heads" or "Tails") so, this degree of freedom is, χ 2 (v) = (2-1)=1. If we were dealing with dice rather then coins then df would be (6-1)=5. Now we have the sum of χ 2 and the χ 2 (v) 1.28 and 1 respectively. According to chi-square distribution table, 1.28 falls between the numbers 1.07 and 1.64 which represents 0.30 and 0.20 respectively. So, we could say, that probability of our chi-square falls between 0.20 and A probability of 0.20 corresponds to a "chance" of 20%, and 0.30 to a chance of 30%, this chi- square result means that, If our hypothesis is correct, then our results would be at least this far from what we predited or the probability that we would get results at least as bad as these, even though our hypothetsis is correct is between 0.20 and 0.30.in bilogically applications, a probability 5% is usually adopted as the standard. This values means that the chances of an observed value arising by chance is only 1 in 20, beacause the chi squared value we obtained in the coin exemple is greater then 0.05, we accept the null hypothesis as true and conclud that our coin is fair[10] 6 statistical test Now we are going to define a couple of tests to use on our mathamatica file. Note that we will be dealing with binary sequence. We will use n=100 as a sample size. 6.1 Monobit test Here the focuse of the test is the proportion of zeroes and ones for the entire sequence. The purpose of this test is to determine whether the number of zeros in a sequence are approximately the same as would be expected for a truly random sequence. All subsequence tests depend on the passing of this test. Now we will derive the statistic for the monobit test from our chi square formula see(6.4). In our statistical test for monobit test we can take the length of the subsequence is 1, The number of different outcomes k is 2 and the degree of fredom is k-1=2-1=1. p i =1/2 is the probability for monobit test and n=100, is the number of samples. Now our chi square formula becomes Q 1 = 2 (N i np i ) 2 i=1 np i = (N 1 np 1 ) 2 + (N 2 np 2 ) 2 np 1 np 2 = (N 1 50) (N 2 50) (6.1) 6.2 Twobit test Now we will derive the statistic for the twobit test from our chi square formula see (6.4). In our statistical test for monobit sequence we can take the length of the subsequence is 2, The number of different outcomes k is 4 and the degrees of fredom is k-1=4-1=3. p i =1/4 is the probability for twobit test and n is the number of samples. Now our chi square 10

15 formula becomes 4 (N i np i ) Q 2 = 2 i=1 np i = (N 1 np 1 ) 2 + (N 2 np 2 ) 2 + (N 3 np 3 ) 2 + (N 4 np 4 ) 2 np 1 np 2 np 3 np 4 = (N 1 25) 2 + (N 2 25) 2 + (N 3 25) 2 + (N 4 25) So outcomes of two bits sequences are (00,10,01,11) (6.2) 6.3 Threebit test Now we will derive the statistic for the threebit test from our chi square formula see (6.4). In our statistical test for threebit sequence we can take the length of the subsequence is 3, then the number of different outcomes k is 8 and the degree of fredom is k-1=8-1=7. p i =1/8 is the probability for threebit test and n is the number of samples. Now our chi square formula becomes, 8 (N i np i ) Q 3 = 2. (6.3) i=1 np i And outcomes of three bits sequences are (000,100,010,001,110,101,011,111) 6.4 Subsequences of length t Now we are going to discuss the subsequence of length t. Let t be a positive integer. The number of different outcomes is 2 t and the probability of subsequence of length t is 1/2 t and the chi square formula becomes Q t = 6.5 General discussion about testvalues percentage 2 t (N i n/2 t ) i=1 n/2 t (6.4) From probability distribution function we can say that our test values must be between 0 and 1 (see4.3) Figure 6.1: chi square distribution with 6 degrees of fredom In the figure right sight area is significant level of α, which is 5% area of whole figure. If our test values V lies in the area of α then we can say that our test value is not good About test values percentage see the percent table. 11

16 7 Investigates of some pseudo random number generators The sequence of random numbers (X n ) is obtained via the following equation X n+1 (ax n + b) (mod m),0 X n+1 < m, X 0 = S. Which is called a linear congruential equation. Where m is the modulus, a is the multiplier, b is the increment and X 0 = 0 is a starting value. Now we will choose the values of m, a, b and s, and investigate different generators by doing statistical test. There are five generators taken with different values and we will observe after statistical test what kind of sequences the values of different generators produces and we will justify that the values are random or not random. The values for generators which we will use to investigate the pseudorandom number generators is presented in the table below. generators m a b s genetator generator generator generator generator Given the above mentioned 5 generators and its values we can do statistical test for last one bit test, last 3 bit test and last 6 bit test (see 6) and in each bit we can change the value of t suppose for last 1 bit test for generator 1, we do the statistical test when t=1, 2 and 3 one after another. After each statistical test we will get different test values of sequences and after analyzing these test values we will discuss which sequence is random and which one is not random. We can now discuss the statistical test value V, if V is less then the 1% entry or greater than the 99% entry, we can reject the numbers as a not sufficiently random, and according to our percentage table (see :percentage table)we can say that the number is "very bad". If v lies between the 1% and 5% entries or between the 95% and 99% entries, then we can see in table (see:percentage table), the numbers are "bad".if V lies between the 5% and 25% entries, or the 75% and 95% entries, then according to your percentage table we can say that the number is "not so good" but the number will be "good" when the number lies between 25% and 75%.We can describes the percentage of the test values in a easy way in a table below. percentage scores 0%-1% very bad 1%-5% bad 5%-25% not so good 25%-75% good 75%-95% not so good 95%-99% bad 99%-100% very bad 12

17 After statistical test we get the sequences. The chi-square test is often done at least three times on different sets of data which is test1, test2 and test3, and if at least two of the three tests are "not good" the results are suspect the numbers are regarded as not sufficiently random. Now we will discuss about generator Generator generator 1 for last 1 bit monobit test very bad very bad very bad 2 sequence test very bad very bad very bad 3 sequence test very bad very bad very bad generator 1 for last 3 bit monobit test bad very bad very bad 2 sequence test very bad very bad very bad 3 sequence test very bad very bad very bad generator 1 for last 6 bit test test1 test 2 test 3 monobit test not so good Good Good 2 sequence test bad bad very bad 3 sequence test not so good not so Good good general discussion In our generator 1 for 1 bit we can see that mono bit, two bits and three bits tests values all are "very bad" and when we change the bits from 1 to 3 bits then the values of the tests are very similler to 1 bit tests when we change the bit from 3 to 6 bits then we can see that in monobit test three of the two values are "good" and in two sequences test we can see that three of the two tests are "bad" and one is "very bad" and in three sequences test two tests are "not so good" and one is "good". So we can say that in generator 1, one bit and three bits test are not good but 6 bits test are better than other two. 7.2 Generator generator 2 for last 1 bit monobit test Good Good Good 2 sequence test very bad very bad very bad 3 sequence test not so good Good Not so good generator 2 for last 3 bits monobit test Very bad Good not so good 2 sequence test good good not so good 3 sequence test not so good not so good not so good 13

18 7.2.3 generator 2 for last 6 bits monobit test not so good good good 2 sequence test bad not so good not so good 3 sequence test not so good not so good good general discussion In generator 2 for last 1 bit we can see three test values are "good" but in 2 sequences test all test values are "very bad" and in 3 sequences test two values "are not so good" and one is "good". If we change the bit from 1 bit to 3 bit then we can see that in monobit test one value is "good" and other two is "very bad" and "not so good" but in 2 sequence test two values are "good" and one is "not so good". Unfortunately in 3 sequence test all values are "not so good". Now in 6 bit test we can see that two tests are "good" and one is "not so good" but in 2 sequences test two values are "not so good" and one is "bad" also for 3 sequences test we get two of the three test values are "not so good" values and one is "good". In generator 2 we can see that for 1 bit test we get 4 "good" sequences, for 3 bit sequences we get 3 "good" sequences and for 6 bits test we get 3 "good" sequences. So we can say that in generator 2 we get more "good" sequences in one bit test, so generator 2 for one bit test is batter than other two. 7.3 Generator generator 3 for last 1 bit monobit test very bad very bad very bad 2 sequence test very bad very bad very bad 3 sequence test very bad very bad very bad generator 3 for last 3 bits monobit test not so good not so good not so good 2 sequence test very bad very bad very bad 3 sequence test not so good good very bad generator 3 for last 6 bits monobit test not so good good good 2 sequence test not so good good not so good 3 sequence test not so good good bad general discussion In generator 3 for last 1 bit we can see that monobit, twobits and three bits test values all are "very bad". In 3 bit test, all three test values are "not so good" in monobit test and 2 sequence test all test values are "very bad", in 3 sequence test the test values are "not so good", "good" and "very bad". In 6 bit test, for monobit test we get two "good" and one "not so good" test values, for 2 sequence test we get two "not so good" and one "good" test values and for 3 sequences test we get "not so good", "good" and "bad" test values. We are looking here that, generator 3 for last one bit generates all "very bad" sequences but 6 bits test makes some good sequences. So we can say that generator 3 is good for last 6 bits. 14

19 7.4 Generator generator 4 for last 1 bit monobit test very bad very bad very bad 2 sequence test very bad very bad very bad 3 sequence test very bad very bad very bad generator 4 for last 3 bits monobit test very bad not so good not so good 2 sequence test very bad very bad very bad 3 sequence test very bad very bad very bad generator 4 for last 6 bits monobit test good not so good good 2 sequence test good not so good good 3 sequence test not so good not so good bad general discussion In generator 4 for last 1 bit we can see that mono bit, two bits and three bits test values all are "very bad". Generator 3 for last 3 bits test, we get two "not so good" and one is "very bad" in monobit test. In 2 sequence and 3 sequence test we get all test values are "very bad", In generator 4 for 6 bits, for monobit test we get two "good" and one "not so good" test values, for 2 sequence test we get one "not so good" and two "good" test values and for 3 sequence test we get two "not so good", and one "bad" test values. Now we can say that generator 4 for last bit sequences is not producing the good sequences but only generator 4 for last 6 bits producing few good sequences. So generator 4 is better for more bits. 7.5 Generator generator 5 for last 1 bit monobit test very bad very bad very bad 2 sequence test very bad very bad very bad 3 sequence test very bad very bad very bad generator 5 for last 3 bits monobit test very bad very bad very bad 2 sequence test very bad very bad very bad 3 sequence test very bad very bad very bad generator 5 for last 6 bits monobit test good bad not so good 2 sequence test bad very bad very bad 3 sequence test very bad very bad very bad 15

20 7.5.4 general discussion In generator 5 for last 1 bit we can see that monobit, twobits and three bits test values all are "very bad". Generator 5 for last 3 bits,we get also all values are "very bad", but In 6 bit test, for monobit test we get "good", "bad" and "not so good", for 2 sequence test we get two "very bad" and one "bad" test values and for 3 sequence test we get all test values are "very bad". So we can say that generator 5 is not good to produce good sequences. 8 Conclusion After statistical test we get the test values and according to our percentage table we mark the test values as a "good", "not so good", "bad" and "very bad". Now we will compaire the values from generator to generator. In generator 1, 3, 4 and 5 for last 1 bit test we can see that all the test values are "very bad but" in generator 2 we can see that all monobit test are "good" but two sequence test value are "very bad". In generator 1 for last 3 bit we can see that almost all sequences test value are "very bad", but in generator 2 for last 3 bit, maximum test values are "not so good". In generator 3 we can see that the number of test values "not so good" and "very bad" are equal, but in generator 4 maximum values are "very bad" and in generator 5 all values are "very bad". We can observe that in every generator last 6 bits creating some "good" sequences. In generator 2 and 3 for last 3 bits also produces some "good" sequences but maximum are "not so good" sequences. Generator 1 and 5 are very simillar because 1 bit and 3 bits test results are very simillar in both generators, but in generator 3 we can see that maximum are "good" and "not so good". Now in generator 5 we can see that maximum are "very bad". Compairing all five generators we can find many "good" test values for last 6 bits except generator five, and i can say that generator 2 is the best generator to produce "good" sequences. References [1] Sheldom M.Ross simulation, [2] [3] Frederick Solomon Probability and Stochastic Processes [4] Knuth, The art of computer programming, volume 2, [5] P.A.W.Lewis and E.J.Orav, Simulation methodology for statisticians,operation analysts, and engineers [6] Morris H. DeGroot, Mark J.Schervish, Probability and statistics [7] Wade Trappe and Lawrence C. Washington Introduction to Cryptography with Coding Theory [8] T.T. Soong Fundamentals of Probability And Statistics For E ngineers [9] Jay L.Devore Probability and Statistics for Engineering and the Sciences [10] J. Susan Milton, Jesse C.Arnold Introduction to Probability and Statistics [11] science.jrank.org/pages/1401/chi square- test.html [12] Kenneth H. Rosen, Elementary number theory and its application. 16

21 9 appendix generator 1 for last 1 bits test when t=1, now for generator 2,when t=1 when, n=100, test value is 0,1 n=200, test value is 0,1 n=300, test value is 0,1 when, n=100, test value is 0.36, n=200, test value is 0.36, n=300, test value is 0.36, now adding last 1 bits test when t=2, for generator 1. now last 1 bit test when t=2, for generator 2, when, n=100, test value is 300, 0 n=200, test value is 300, 0 n=300, test value is 300, 0 when, n=100, test value is 11.44, n=200, test value is 11.92, n=300, test value is 11.44, now last 1 bit test when t=3 for generator 1. now last 1 bit test when t=3 for generator 2. when, n=100, test value is 300, 0 n=200, test value is 77.6, n=300, test value is 100, 0 when, n=100, test value is 10.08, n=200, test value is 8.8, n=300, test value is 9.76, now last 3 bit test when t=1 for generator 1. now last 3 bit test when t=1 for generator 2. now last 3 bit test when t=2 for generator 1. when, n=100, test value is 4.84, n=200, test value is 7.84, n=300, test value is 9, when, n=100, test value is 0,1 n=200, test value is 0.64, n=300, test value is 1.44, when, n=100, test value is 21.84, n=200, test value is 21.84, n=300, test value is 23.12,

22 now last 3 bit test when t=2 for generator 2. now last 3 bit test when t=3 for generator 1. now last 3 bit test when t=3 for generator 2. now last 6 bit test when t=1 for generator 1. now last 6 bit test when t=1 for generator 2. now last 6 bit test when t=2 for generator 1. now last 6 bit test when t=2 for generator 2. now last 6 bit test when t=3 for generator 1. now last 6 bit test when t=3 for generator 2. when, n=100, test value is 3.76, n=200, test value is 1.76, n=300, test value is 0.56, when, n=100, test value is 0.16, n=200, test value is 0.16, n=300, test value is 0.16, when, n=100, test value is 3.36, n=200, test value is 2.4, n=300, test value is 2.88, when, n=100, test value is 0.04, n=200, test value is 0.16, n=300, test value is 0.16, when, n=100, test value is 1.44, n=200, test value is 1.16, n=300, test value is 0.36, when, n=100, test value is 9.36, n=200, test value is 7.84, n=300, test value is 14.48, when, n=100, test value is 0.32, n=200, test value is 0.72, n=300, test value is 0.96, when, n=100, test value is 3.04, n=200, test value is 3.04, n=300, test value is 4.68, when, n=100, test value is 9.32, n=200, test value is 3.2, n=300, test value is 8, if we organize avobe information into a table then it becomes generator:1 for last 1 bit 18

23 generator:2 for last 1 bit generator:3 for last 1 bit test test1 test2 test3 monobit test sequence test sequence test test test1 test2 test3. monobit test sequence test sequence test generator:4 for last 1 bit generator:5 for last 1 bit generator:1 for last 3 bits test test1 test2 test3. monobit test sequence test sequence test test test1 test2 test3. monobit test sequence test sequence test test test1 test2 test3. monobit test sequence test sequence test test test1 test2 test3. monobit test sequence test sequence test generator:2 for last 3 bits generator:3 for last 3 bits test test1 test2 test3. monobit test sequence test sequence test test test1 test2 test3. monobit test sequence test sequence test generator:4 for last 3 bits 19

24 test test1 test2 test3. monobit test sequence test sequence test generator:5 for last 3 bits test test1 test2 test3. monobit test sequence test sequence test generator:1 for last 6 bits generator:2 for last 6 bits generator:3 for last 6 bits generator:4 for last 6 bits generator:5 for last 6 bits test test1 test2 test3. monobit test sequence test sequence test test test1 test2 test3. monobit test sequence test sequence test test test1 test2 test3. monobit test sequence test sequence test test test1 test2 test3. monobit test sequence test sequence test test test1 test2 test3. monobit test sequence test sequence test Here i am giving mathematica code in below Length of subsequence to test t = 2; outputbits = 3; m = 400; 20

25 The generator lincongen[a_integer, b_integer, n_integer, x_integer] : = Mod[a*x + b, n] Generate a suequence. list1 contains numbers modulo n lis2 contains numbers modulo 2 f[x_] := lincongen[25, 5, m, x]; list1 = {}; list2 = {}; s = 2; x = s; Do[ AppendTo[list1, x]; bits = IntegerDigits[x, 2, outputbits]; list2 = Join[list2, bits]; x = f[x];, {i, 1, m}] list1; list2; list2 Create a table containing the frequences of the different subsequences totalfreq = Table[0, {i, 0, 2^t - 1}] Do[ pos = t*i + 1; test = Take[list2, {pos, pos + t - 1}]; totalfreq[[fromdigits[test, 2] + 1]]++;, {i, 0, Length[list2]/t - 1}] {0, 0, 0, 0} FromDigits[{1, 1, 1, 1}, 2] totalfreq {150, 250, 50, 150} n = 100; freq = Table[0, {i, 0, 2^t - 1}]; Do[ pos = t*i + 1; test = Take[list2, {pos, pos + t - 1}]; freq[[fromdigits[test, 2] + 1]]++;, {i, 0, n - 1}] stat = N[Sum[(freq[[i]] - n*(1/2^t))^2/(n/2^t), {i, 1, 2^t}]] testvalue = 1 - N[CDF[ChiSquareDistribution[2^t - 1], stat]] freq 21

26 {50, 50} n = 100; freq = Table[0, {i, 0, 2^t - 1}]; Do[ pos = t*i + 1; test = Take[list2, {pos, pos + t - 1}]; freq[[fromdigits[test, 2] + 1]]++;, {i, n, 2*n - 1}] stat = N[Sum[(freq[[i]] - n*(1/2^t))^2/(n/2^t), {i, 1, 2^t}]] testvalue = 1 - N[CDF[ChiSquareDistribution[2^t - 1], stat]] n = 100; freq = Table[0, {i, 0, 2^t - 1}]; Do[ pos = t*i + 1; test = Take[list2, {pos, pos + t - 1}]; freq[[fromdigits[test, 2] + 1]]++;, {i, 2*n, 3*n - 1}] stat = N[Sum[(freq[[i]] - n*(1/2^t))^2/(n/2^t), {i, 1, 2^t}]] testvalue = 1 - N[CDF[ChiSquareDistribution[2^t - 1], stat]]

27 SE Växjö / SE Kalmar Tel dfm@lnu.se Lnu.se

CPSC 531: Random Numbers. Jonathan Hudson Department of Computer Science University of Calgary

CPSC 531: Random Numbers. Jonathan Hudson Department of Computer Science University of Calgary CPSC 531: Random Numbers Jonathan Hudson Department of Computer Science University of Calgary http://www.ucalgary.ca/~hudsonj/531f17 Introduction In simulations, we generate random values for variables

More information

Random Number Generation. CS1538: Introduction to simulations

Random Number Generation. CS1538: Introduction to simulations Random Number Generation CS1538: Introduction to simulations Random Numbers Stochastic simulations require random data True random data cannot come from an algorithm We must obtain it from some process

More information

Topics in Computer Mathematics

Topics in Computer Mathematics Random Number Generation (Uniform random numbers) Introduction We frequently need some way to generate numbers that are random (by some criteria), especially in computer science. Simulations of natural

More information

Slides 3: Random Numbers

Slides 3: Random Numbers Slides 3: Random Numbers We previously considered a few examples of simulating real processes. In order to mimic real randomness of events such as arrival times we considered the use of random numbers

More information

Chair for Network Architectures and Services Institute of Informatics TU München Prof. Carle. Network Security. Chapter 2 Basics

Chair for Network Architectures and Services Institute of Informatics TU München Prof. Carle. Network Security. Chapter 2 Basics Chair for Network Architectures and Services Institute of Informatics TU München Prof. Carle Network Security Chapter 2 Basics 2.4 Random Number Generation for Cryptographic Protocols Motivation It is

More information

B.N.Bandodkar College of Science, Thane. Random-Number Generation. Mrs M.J.Gholba

B.N.Bandodkar College of Science, Thane. Random-Number Generation. Mrs M.J.Gholba B.N.Bandodkar College of Science, Thane Random-Number Generation Mrs M.J.Gholba Properties of Random Numbers A sequence of random numbers, R, R,., must have two important statistical properties, uniformity

More information

Uniform Random Number Generators

Uniform Random Number Generators JHU 553.633/433: Monte Carlo Methods J. C. Spall 25 September 2017 CHAPTER 2 RANDOM NUMBER GENERATION Motivation and criteria for generators Linear generators (e.g., linear congruential generators) Multiple

More information

Pseudo-Random Generators

Pseudo-Random Generators Pseudo-Random Generators Why do we need random numbers? Simulation Sampling Numerical analysis Computer programming (e.g. randomized algorithm) Elementary and critical element in many cryptographic protocols

More information

Pseudo-Random Generators

Pseudo-Random Generators Pseudo-Random Generators Topics Why do we need random numbers? Truly random and Pseudo-random numbers. Definition of pseudo-random-generator What do we expect from pseudorandomness? Testing for pseudo-randomness.

More information

Sources of randomness

Sources of randomness Random Number Generator Chapter 7 In simulations, we generate random values for variables with a specified distribution Ex., model service times using the exponential distribution Generation of random

More information

Random number generators

Random number generators s generators Comp Sci 1570 Introduction to Outline s 1 2 s generator s The of a sequence of s or symbols that cannot be reasonably predicted better than by a random chance, usually through a random- generator

More information

Topics. Pseudo-Random Generators. Pseudo-Random Numbers. Truly Random Numbers

Topics. Pseudo-Random Generators. Pseudo-Random Numbers. Truly Random Numbers Topics Pseudo-Random Generators Why do we need random numbers? Truly random and Pseudo-random numbers. Definition of pseudo-random-generator What do we expect from pseudorandomness? Testing for pseudo-randomness.

More information

Chapter 4: Monte Carlo Methods. Paisan Nakmahachalasint

Chapter 4: Monte Carlo Methods. Paisan Nakmahachalasint Chapter 4: Monte Carlo Methods Paisan Nakmahachalasint Introduction Monte Carlo Methods are a class of computational algorithms that rely on repeated random sampling to compute their results. Monte Carlo

More information

Pseudo-random Number Generation. Qiuliang Tang

Pseudo-random Number Generation. Qiuliang Tang Pseudo-random Number Generation Qiuliang Tang Random Numbers in Cryptography The keystream in the one-time pad The secret key in the DES encryption The prime numbers p, q in the RSA encryption The private

More information

Random number generation

Random number generation CE 391F April 4, 2013 ANNOUNCEMENTS Homework 3 due today Homework 4 coming... Announcements Webinar announcement Femke van Wageningen-Kessels from TU Delft will be giving a webinar titled Traffic Flow

More information

Computer Applications for Engineers ET 601

Computer Applications for Engineers ET 601 Computer Applications for Engineers ET 601 Asst. Prof. Dr. Prapun Suksompong prapun@siit.tu.ac.th Random Variables (Con t) 1 Office Hours: (BKD 3601-7) Wednesday 9:30-11:30 Wednesday 16:00-17:00 Thursday

More information

Systems Simulation Chapter 7: Random-Number Generation

Systems Simulation Chapter 7: Random-Number Generation Systems Simulation Chapter 7: Random-Number Generation Fatih Cavdur fatihcavdur@uludag.edu.tr April 22, 2014 Introduction Introduction Random Numbers (RNs) are a necessary basic ingredient in the simulation

More information

Random Number Generators

Random Number Generators 1/18 Random Number Generators Professor Karl Sigman Columbia University Department of IEOR New York City USA 2/18 Introduction Your computer generates" numbers U 1, U 2, U 3,... that are considered independent

More information

UNIT 5:Random number generation And Variation Generation

UNIT 5:Random number generation And Variation Generation UNIT 5:Random number generation And Variation Generation RANDOM-NUMBER GENERATION Random numbers are a necessary basic ingredient in the simulation of almost all discrete systems. Most computer languages

More information

Topics. Probability Theory. Perfect Secrecy. Information Theory

Topics. Probability Theory. Perfect Secrecy. Information Theory Topics Probability Theory Perfect Secrecy Information Theory Some Terms (P,C,K,E,D) Computational Security Computational effort required to break cryptosystem Provable Security Relative to another, difficult

More information

Generating Uniform Random Numbers

Generating Uniform Random Numbers 1 / 43 Generating Uniform Random Numbers Christos Alexopoulos and Dave Goldsman Georgia Institute of Technology, Atlanta, GA, USA March 1, 2016 2 / 43 Outline 1 Introduction 2 Some Generators We Won t

More information

Lehmer Random Number Generators: Introduction

Lehmer Random Number Generators: Introduction Lehmer Random Number Generators: Introduction Revised version of the slides based on the book Discrete-Event Simulation: a first course LL Leemis & SK Park Section(s) 21, 22 c 2006 Pearson Ed, Inc 0-13-142917-5

More information

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers Number Theory: Applications Number Theory Applications Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Results from Number Theory have many applications

More information

The Chi-Square Distributions

The Chi-Square Distributions MATH 183 The Chi-Square Distributions Dr. Neal, WKU The chi-square distributions can be used in statistics to analyze the standard deviation σ of a normally distributed measurement and to test the goodness

More information

Review of Statistical Terminology

Review of Statistical Terminology Review of Statistical Terminology An experiment is a process whose outcome is not known with certainty. The experiment s sample space S is the set of all possible outcomes. A random variable is a function

More information

A NEW RANDOM NUMBER GENERATOR USING FIBONACCI SERIES

A NEW RANDOM NUMBER GENERATOR USING FIBONACCI SERIES International J. of Math. Sci. & Engg. Appls. (IJMSEA) ISSN 0973-9424, Vol. 11 No. I (April, 2017), pp. 185-193 A NEW RANDOM NUMBER GENERATOR USING FIBONACCI SERIES KOTTA NAGALAKSHMI RACHANA 1 AND SOUBHIK

More information

B. Maddah ENMG 622 Simulation 11/11/08

B. Maddah ENMG 622 Simulation 11/11/08 B. Maddah ENMG 622 Simulation 11/11/08 Random-Number Generators (Chapter 7, Law) Overview All stochastic simulations need to generate IID uniformly distributed on (0,1), U(0,1), random numbers. 1 f X (

More information

Algorithms and Networking for Computer Games

Algorithms and Networking for Computer Games Algorithms and Networking for Computer Games Chapter 2: Random Numbers http://www.wiley.com/go/smed What are random numbers good for (according to D.E. Knuth) simulation sampling numerical analysis computer

More information

Independent Events. Two events are independent if knowing that one occurs does not change the probability of the other occurring

Independent Events. Two events are independent if knowing that one occurs does not change the probability of the other occurring Independent Events Two events are independent if knowing that one occurs does not change the probability of the other occurring Conditional probability is denoted P(A B), which is defined to be: P(A and

More information

Notes. Number Theory: Applications. Notes. Number Theory: Applications. Notes. Hash Functions I

Notes. Number Theory: Applications. Notes. Number Theory: Applications. Notes. Hash Functions I Number Theory: Applications Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Fall 2007 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 3.4 3.7 of Rosen cse235@cse.unl.edu

More information

Random Number Generation. Stephen Booth David Henty

Random Number Generation. Stephen Booth David Henty Random Number Generation Stephen Booth David Henty Introduction Random numbers are frequently used in many types of computer simulation Frequently as part of a sampling process: Generate a representative

More information

Stream Ciphers. Çetin Kaya Koç Winter / 20

Stream Ciphers. Çetin Kaya Koç   Winter / 20 Çetin Kaya Koç http://koclab.cs.ucsb.edu Winter 2016 1 / 20 Linear Congruential Generators A linear congruential generator produces a sequence of integers x i for i = 1,2,... starting with the given initial

More information

Computer Applications for Engineers ET 601

Computer Applications for Engineers ET 601 Computer Applications for Engineers ET 601 Asst. Prof. Dr. Prapun Suksompong prapun@siit.tu.ac.th Random Variables (Con t) 1 Office Hours: (BKD 3601-7) Wednesday 9:30-11:30 Wednesday 16:00-17:00 Thursday

More information

Workshop on Heterogeneous Computing, 16-20, July No Monte Carlo is safe Monte Carlo - more so parallel Monte Carlo

Workshop on Heterogeneous Computing, 16-20, July No Monte Carlo is safe Monte Carlo - more so parallel Monte Carlo Workshop on Heterogeneous Computing, 16-20, July 2012 No Monte Carlo is safe Monte Carlo - more so parallel Monte Carlo K. P. N. Murthy School of Physics, University of Hyderabad July 19, 2012 K P N Murthy

More information

Lecture Notes. Advanced Discrete Structures COT S

Lecture Notes. Advanced Discrete Structures COT S Lecture Notes Advanced Discrete Structures COT 4115.001 S15 2015-01-27 Recap ADFGX Cipher Block Cipher Modes of Operation Hill Cipher Inverting a Matrix (mod n) Encryption: Hill Cipher Example Multiple

More information

2008 Winton. Review of Statistical Terminology

2008 Winton. Review of Statistical Terminology 1 Review of Statistical Terminology 2 Formal Terminology An experiment is a process whose outcome is not known with certainty The experiment s sample space S is the set of all possible outcomes. A random

More information

Stream ciphers I. Thomas Johansson. May 16, Dept. of EIT, Lund University, P.O. Box 118, Lund, Sweden

Stream ciphers I. Thomas Johansson. May 16, Dept. of EIT, Lund University, P.O. Box 118, Lund, Sweden Dept. of EIT, Lund University, P.O. Box 118, 221 00 Lund, Sweden thomas@eit.lth.se May 16, 2011 Outline: Introduction to stream ciphers Distinguishers Basic constructions of distinguishers Various types

More information

The Chi-Square Distributions

The Chi-Square Distributions MATH 03 The Chi-Square Distributions Dr. Neal, Spring 009 The chi-square distributions can be used in statistics to analyze the standard deviation of a normally distributed measurement and to test the

More information

Tae-Soo Kim and Young-Kyun Yang

Tae-Soo Kim and Young-Kyun Yang Kangweon-Kyungki Math. Jour. 14 (2006), No. 1, pp. 85 93 ON THE INITIAL SEED OF THE RANDOM NUMBER GENERATORS Tae-Soo Kim and Young-Kyun Yang Abstract. A good arithmetic random number generator should possess

More information

Introduction to Statistical Data Analysis Lecture 7: The Chi-Square Distribution

Introduction to Statistical Data Analysis Lecture 7: The Chi-Square Distribution Introduction to Statistical Data Analysis Lecture 7: The Chi-Square Distribution James V. Lambers Department of Mathematics The University of Southern Mississippi James V. Lambers Statistical Data Analysis

More information

Generating Uniform Random Numbers

Generating Uniform Random Numbers 1 / 41 Generating Uniform Random Numbers Christos Alexopoulos and Dave Goldsman Georgia Institute of Technology, Atlanta, GA, USA 10/13/16 2 / 41 Outline 1 Introduction 2 Some Lousy Generators We Won t

More information

Preliminary statistics

Preliminary statistics 1 Preliminary statistics The solution of a geophysical inverse problem can be obtained by a combination of information from observed data, the theoretical relation between data and earth parameters (models),

More information

How does the computer generate observations from various distributions specified after input analysis?

How does the computer generate observations from various distributions specified after input analysis? 1 How does the computer generate observations from various distributions specified after input analysis? There are two main components to the generation of observations from probability distributions.

More information

Monte Carlo Techniques

Monte Carlo Techniques Physics 75.502 Part III: Monte Carlo Methods 40 Monte Carlo Techniques Monte Carlo refers to any procedure that makes use of random numbers. Monte Carlo methods are used in: Simulation of natural phenomena

More information

Lecture 20. Randomness and Monte Carlo. J. Chaudhry. Department of Mathematics and Statistics University of New Mexico

Lecture 20. Randomness and Monte Carlo. J. Chaudhry. Department of Mathematics and Statistics University of New Mexico Lecture 20 Randomness and Monte Carlo J. Chaudhry Department of Mathematics and Statistics University of New Mexico J. Chaudhry (UNM) CS 357 1 / 40 What we ll do: Random number generators Monte-Carlo integration

More information

STAT 135 Lab 6 Duality of Hypothesis Testing and Confidence Intervals, GLRT, Pearson χ 2 Tests and Q-Q plots. March 8, 2015

STAT 135 Lab 6 Duality of Hypothesis Testing and Confidence Intervals, GLRT, Pearson χ 2 Tests and Q-Q plots. March 8, 2015 STAT 135 Lab 6 Duality of Hypothesis Testing and Confidence Intervals, GLRT, Pearson χ 2 Tests and Q-Q plots March 8, 2015 The duality between CI and hypothesis testing The duality between CI and hypothesis

More information

Statistical Testing of Randomness

Statistical Testing of Randomness Statistical Testing of Randomness (Yesterday, Today, and Possibly Tomorrow) Jan Krhovják BUSLab & LaBAK Faculty of Informatics, Masaryk University, Brno LaBAK & KD Lab Seminar, Cikhákj, Spring 2007 1/26

More information

How does the computer generate observations from various distributions specified after input analysis?

How does the computer generate observations from various distributions specified after input analysis? 1 How does the computer generate observations from various distributions specified after input analysis? There are two main components to the generation of observations from probability distributions.

More information

Random numbers and random number generators

Random numbers and random number generators Random numbers and random number generators It was a very popular deterministic philosophy some 300 years ago that if we know initial conditions and solve Eqs. of motion then the future is predictable.

More information

b = 10 a, is the logarithm of b to the base 10. Changing the base to e we obtain natural logarithms, so a = ln b means that b = e a.

b = 10 a, is the logarithm of b to the base 10. Changing the base to e we obtain natural logarithms, so a = ln b means that b = e a. INTRODUCTION TO CRYPTOGRAPHY 5. Discrete Logarithms Recall the classical logarithm for real numbers: If we write b = 10 a, then a = log 10 b is the logarithm of b to the base 10. Changing the base to e

More information

Multi-Map Orbit Hopping Chaotic Stream Cipher

Multi-Map Orbit Hopping Chaotic Stream Cipher Multi-Map Orbit Hopping Chaotic Stream Cipher Xiaowen Zhang 1, Li Shu 2, Ke Tang 1 Abstract In this paper we propose a multi-map orbit hopping chaotic stream cipher that utilizes the idea of spread spectrum

More information

Generating Uniform Random Numbers

Generating Uniform Random Numbers 1 / 44 Generating Uniform Random Numbers Christos Alexopoulos and Dave Goldsman Georgia Institute of Technology, Atlanta, GA, USA 10/29/17 2 / 44 Outline 1 Introduction 2 Some Lousy Generators We Won t

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 9 February 6, 2012 CPSC 467b, Lecture 9 1/53 Euler s Theorem Generating RSA Modulus Finding primes by guess and check Density of

More information

Permutation Generators Based on Unbalanced Feistel Network: Analysis of the Conditions of Pseudorandomness 1

Permutation Generators Based on Unbalanced Feistel Network: Analysis of the Conditions of Pseudorandomness 1 Permutation Generators Based on Unbalanced Feistel Network: Analysis of the Conditions of Pseudorandomness 1 Kwangsu Lee A Thesis for the Degree of Master of Science Division of Computer Science, Department

More information

DS-GA 1002 Lecture notes 2 Fall Random variables

DS-GA 1002 Lecture notes 2 Fall Random variables DS-GA 12 Lecture notes 2 Fall 216 1 Introduction Random variables Random variables are a fundamental tool in probabilistic modeling. They allow us to model numerical quantities that are uncertain: the

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 10 February 19, 2013 CPSC 467b, Lecture 10 1/45 Primality Tests Strong primality tests Weak tests of compositeness Reformulation

More information

Pseudo-Random Numbers Generators. Anne GILLE-GENEST. March 1, Premia Introduction Definitions Good generators...

Pseudo-Random Numbers Generators. Anne GILLE-GENEST. March 1, Premia Introduction Definitions Good generators... 14 pages 1 Pseudo-Random Numbers Generators Anne GILLE-GENEST March 1, 2012 Contents Premia 14 1 Introduction 2 1.1 Definitions............................. 2 1.2 Good generators..........................

More information

CSCE 564, Fall 2001 Notes 6 Page 1 13 Random Numbers The great metaphysical truth in the generation of random numbers is this: If you want a function

CSCE 564, Fall 2001 Notes 6 Page 1 13 Random Numbers The great metaphysical truth in the generation of random numbers is this: If you want a function CSCE 564, Fall 2001 Notes 6 Page 1 13 Random Numbers The great metaphysical truth in the generation of random numbers is this: If you want a function that is reasonably random in behavior, then take any

More information

Degree project. Empirical testing of pseudo random number generators based on elliptic curves

Degree project. Empirical testing of pseudo random number generators based on elliptic curves Degree project Empirical testing of pseudo random number generators based on elliptic curves Abstract An introduction on random numbers, their history and applications is given, along with explanations

More information

Introduction to Modern Cryptography. Benny Chor

Introduction to Modern Cryptography. Benny Chor Introduction to Modern Cryptography Benny Chor RSA Public Key Encryption Factoring Algorithms Lecture 7 Tel-Aviv University Revised March 1st, 2008 Reminder: The Prime Number Theorem Let π(x) denote the

More information

NEW RESULTS CONCERNING THE POWER OF NIST RANDOMNESS TESTS

NEW RESULTS CONCERNING THE POWER OF NIST RANDOMNESS TESTS THE PUBLISHING HOUSE PROCEEDINGS OF THE ROMANIAN ACADEMY, Series A, OF THE ROMANIAN ACADEMY Volume 18, Special Issue 2017, pp 381-388 NEW RESULTS CONCERNING THE POWER OF NIST RANDOMNESS TESTS Carmina GEORGESCU,

More information

Random Number Generators - a brief assessment of those available

Random Number Generators - a brief assessment of those available Random Number Generators - a brief assessment of those available Anna Mills March 30, 2003 1 Introduction Nothing in nature is random...a thing appears random only through the incompleteness of our knowledge.

More information

2008 Winton. Statistical Testing of RNGs

2008 Winton. Statistical Testing of RNGs 1 Statistical Testing of RNGs Criteria for Randomness For a sequence of numbers to be considered a sequence of randomly acquired numbers, it must have two basic statistical properties: Uniformly distributed

More information

Solutions for week 1, Cryptography Course - TDA 352/DIT 250

Solutions for week 1, Cryptography Course - TDA 352/DIT 250 Solutions for week, Cryptography Course - TDA 352/DIT 250 In this weekly exercise sheet: you will use some historical ciphers, the OTP, the definition of semantic security and some combinatorial problems.

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer 1 Lecture 13 October 16, 2017 (notes revised 10/23/17) 1 Derived from lecture notes by Ewa Syta. CPSC 467, Lecture 13 1/57 Elliptic Curves

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Today's learning goals Determine whether a relation is an equivalence relation by determining whether it is Reflexive Symmetric

More information

1 Normal Distribution.

1 Normal Distribution. Normal Distribution.. Introduction A Bernoulli trial is simple random experiment that ends in success or failure. A Bernoulli trial can be used to make a new random experiment by repeating the Bernoulli

More information

Pseudorandom Generators

Pseudorandom Generators Outlines Saint Petersburg State University, Mathematics and Mechanics 2nd April 2005 Outlines Part I: Main Approach Part II: Blum-Blum-Shub Generator Part III: General Concepts of Pseudorandom Generator

More information

IE 303 Discrete-Event Simulation L E C T U R E 6 : R A N D O M N U M B E R G E N E R A T I O N

IE 303 Discrete-Event Simulation L E C T U R E 6 : R A N D O M N U M B E R G E N E R A T I O N IE 303 Discrete-Event Simulation L E C T U R E 6 : R A N D O M N U M B E R G E N E R A T I O N Review of the Last Lecture Continuous Distributions Uniform distributions Exponential distributions and memoryless

More information

True & Deterministic Random Number Generators

True & Deterministic Random Number Generators True & Deterministic Random Number Generators Çetin Kaya Koç http://cs.ucsb.edu/~koc koc@cs.ucsb.edu 1.0 0.5 1.0 0.5 0.5 1.0 0.5 1.0 Koç (http://cs.ucsb.edu/~koc) HRL RNG April 11, 2013 1 / 47 Random Numbers

More information

What is the Q in QRNG?

What is the Q in QRNG? What is the Q in QRNG? IN ORDER TO GUARANTEE ABSOLUTELY RANDOM NUMBERS, RNGS (RANDOM NUMBER GENERATORS) MUST NOT BE VULNERABLE TO PREDICTION OR BIAS, AND THUS DICTATED BY TRUE RANDOMNESS. BUT HOW CAN WE

More information

A novel pseudo-random number generator based on discrete chaotic iterations

A novel pseudo-random number generator based on discrete chaotic iterations A novel pseudo-random number generator based on discrete chaotic iterations Qianxue Wang, Christophe Guyeux and Jacques M. Bahi University of Franche-Comte Computer Science Laboratory LIFC, Belfort, France

More information

EXAM. Exam #1. Math 3342 Summer II, July 21, 2000 ANSWERS

EXAM. Exam #1. Math 3342 Summer II, July 21, 2000 ANSWERS EXAM Exam # Math 3342 Summer II, 2 July 2, 2 ANSWERS i pts. Problem. Consider the following data: 7, 8, 9, 2,, 7, 2, 3. Find the first quartile, the median, and the third quartile. Make a box and whisker

More information

So far we discussed random number generators that need to have the maximum length period.

So far we discussed random number generators that need to have the maximum length period. So far we discussed random number generators that need to have the maximum length period. Even the increment series has the maximum length period yet it is by no means random How do we decide if a generator

More information

18.05 Practice Final Exam

18.05 Practice Final Exam No calculators. 18.05 Practice Final Exam Number of problems 16 concept questions, 16 problems. Simplifying expressions Unless asked to explicitly, you don t need to simplify complicated expressions. For

More information

Week 1 Quantitative Analysis of Financial Markets Distributions A

Week 1 Quantitative Analysis of Financial Markets Distributions A Week 1 Quantitative Analysis of Financial Markets Distributions A Christopher Ting http://www.mysmu.edu/faculty/christophert/ Christopher Ting : christopherting@smu.edu.sg : 6828 0364 : LKCSB 5036 October

More information

STREAM CIPHER. Chapter - 3

STREAM CIPHER. Chapter - 3 STREAM CIPHER Chapter - 3 S t r e a m C i p h e r P a g e 38 S t r e a m C i p h e r P a g e 39 STREAM CIPHERS Stream cipher is a class of symmetric key algorithm that operates on individual bits or bytes.

More information

CHAPTER 3 CHAOTIC MAPS BASED PSEUDO RANDOM NUMBER GENERATORS

CHAPTER 3 CHAOTIC MAPS BASED PSEUDO RANDOM NUMBER GENERATORS 24 CHAPTER 3 CHAOTIC MAPS BASED PSEUDO RANDOM NUMBER GENERATORS 3.1 INTRODUCTION Pseudo Random Number Generators (PRNGs) are widely used in many applications, such as numerical analysis, probabilistic

More information

Randomness and non-uniformity

Randomness and non-uniformity Randomness and non-uniformity JASS 2006 Course 1: Proofs and Computers Felix Weninger TU München April 2006 Outline Randomized computation 1 Randomized computation 2 Computation with advice Non-uniform

More information

Lecture 2 : CS6205 Advanced Modeling and Simulation

Lecture 2 : CS6205 Advanced Modeling and Simulation Lecture 2 : CS6205 Advanced Modeling and Simulation Lee Hwee Kuan 21 Aug. 2013 For the purpose of learning stochastic simulations for the first time. We shall only consider probabilities on finite discrete

More information

Class 12. Random Numbers

Class 12. Random Numbers Class 12. Random Numbers NRiC 7. Frequently needed to generate initial conditions. Often used to solve problems statistically. How can a computer generate a random number? It can t! Generators are pseudo-random.

More information

Chi-square goodness-of-fit test for vague data

Chi-square goodness-of-fit test for vague data Chi-square goodness-of-fit test for vague data Przemys law Grzegorzewski Systems Research Institute Polish Academy of Sciences Newelska 6, 01-447 Warsaw, Poland and Faculty of Math. and Inform. Sci., Warsaw

More information

CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrosky. Lecture 4

CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrosky. Lecture 4 CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrosky Lecture 4 Lecture date: January 26, 2005 Scribe: Paul Ray, Mike Welch, Fernando Pereira 1 Private Key Encryption Consider a game between

More information

Uniform random numbers generators

Uniform random numbers generators Uniform random numbers generators Lecturer: Dmitri A. Moltchanov E-mail: moltchan@cs.tut.fi http://www.cs.tut.fi/kurssit/tlt-2707/ OUTLINE: The need for random numbers; Basic steps in generation; Uniformly

More information

Generating Random Variables

Generating Random Variables Generating Random Variables These slides are created by Dr. Yih Huang of George Mason University. Students registered in Dr. Huang's courses at GMU can make a single machine-readable copy and print a single

More information

Computer Science A Cryptography and Data Security. Claude Crépeau

Computer Science A Cryptography and Data Security. Claude Crépeau Computer Science 308-547A Cryptography and Data Security Claude Crépeau These notes are, largely, transcriptions by Anton Stiglic of class notes from the former course Cryptography and Data Security (308-647A)

More information

Lecture Notes 1 Basic Probability. Elements of Probability. Conditional probability. Sequential Calculation of Probability

Lecture Notes 1 Basic Probability. Elements of Probability. Conditional probability. Sequential Calculation of Probability Lecture Notes 1 Basic Probability Set Theory Elements of Probability Conditional probability Sequential Calculation of Probability Total Probability and Bayes Rule Independence Counting EE 178/278A: Basic

More information

Stochastic Simulation of

Stochastic Simulation of Stochastic Simulation of Communication Networks -WS 2014/2015 Part 2 Random Number Generation Prof. Dr. C. Görg www.comnets.uni-bremen.de VSIM 2-1 Table of Contents 1 General Introduction 2 Random Number

More information

Lecture 10: Probability distributions TUESDAY, FEBRUARY 19, 2019

Lecture 10: Probability distributions TUESDAY, FEBRUARY 19, 2019 Lecture 10: Probability distributions DANIEL WELLER TUESDAY, FEBRUARY 19, 2019 Agenda What is probability? (again) Describing probabilities (distributions) Understanding probabilities (expectation) Partial

More information

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

6.080 / Great Ideas in Theoretical Computer Science Spring 2008 MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

18.05 Final Exam. Good luck! Name. No calculators. Number of problems 16 concept questions, 16 problems, 21 pages

18.05 Final Exam. Good luck! Name. No calculators. Number of problems 16 concept questions, 16 problems, 21 pages Name No calculators. 18.05 Final Exam Number of problems 16 concept questions, 16 problems, 21 pages Extra paper If you need more space we will provide some blank paper. Indicate clearly that your solution

More information

Course: ESO-209 Home Work: 1 Instructor: Debasis Kundu

Course: ESO-209 Home Work: 1 Instructor: Debasis Kundu Home Work: 1 1. Describe the sample space when a coin is tossed (a) once, (b) three times, (c) n times, (d) an infinite number of times. 2. A coin is tossed until for the first time the same result appear

More information

4.5 Applications of Congruences

4.5 Applications of Congruences 4.5 Applications of Congruences 287 66. Find all solutions of the congruence x 2 16 (mod 105). [Hint: Find the solutions of this congruence modulo 3, modulo 5, and modulo 7, and then use the Chinese remainder

More information

Chapter 3. Chapter 3 sections

Chapter 3. Chapter 3 sections sections 3.1 Random Variables and Discrete Distributions 3.2 Continuous Distributions 3.4 Bivariate Distributions 3.5 Marginal Distributions 3.6 Conditional Distributions 3.7 Multivariate Distributions

More information

Block ciphers And modes of operation. Table of contents

Block ciphers And modes of operation. Table of contents Block ciphers And modes of operation Foundations of Cryptography Computer Science Department Wellesley College Table of contents Introduction Pseudorandom permutations Block Ciphers Modes of Operation

More information

1 What are Physical Attacks. 2 Physical Attacks on RSA. Today:

1 What are Physical Attacks. 2 Physical Attacks on RSA. Today: Today: Introduction to the class. Examples of concrete physical attacks on RSA A computational approach to cryptography Pseudorandomness 1 What are Physical Attacks Tampering/Leakage attacks Issue of how

More information

( ) ( ) Monte Carlo Methods Interested in. E f X = f x d x. Examples:

( ) ( ) Monte Carlo Methods Interested in. E f X = f x d x. Examples: Monte Carlo Methods Interested in Examples: µ E f X = f x d x Type I error rate of a hypothesis test Mean width of a confidence interval procedure Evaluating a likelihood Finding posterior mean and variance

More information

Reducibility of Polynomials over Finite Fields

Reducibility of Polynomials over Finite Fields Master Thesis Reducibility of Polynomials over Finite Fields Author: Muhammad Imran Date: 1976-06-02 Subject: Mathematics Level: Advance Course code: 5MA12E Abstract Reducibility of certain class of polynomials

More information

Introduction and Overview STAT 421, SP Course Instructor

Introduction and Overview STAT 421, SP Course Instructor Introduction and Overview STAT 421, SP 212 Prof. Prem K. Goel Mon, Wed, Fri 3:3PM 4:48PM Postle Hall 118 Course Instructor Prof. Goel, Prem E mail: goel.1@osu.edu Office: CH 24C (Cockins Hall) Phone: 614

More information

Preliminary Statistics Lecture 2: Probability Theory (Outline) prelimsoas.webs.com

Preliminary Statistics Lecture 2: Probability Theory (Outline) prelimsoas.webs.com 1 School of Oriental and African Studies September 2015 Department of Economics Preliminary Statistics Lecture 2: Probability Theory (Outline) prelimsoas.webs.com Gujarati D. Basic Econometrics, Appendix

More information