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

Size: px
Start display at page:

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

Transcription

1 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 is adequate as a random number generator. To our eyes we tend to avoid sequences that seem non-random such as pairs of equal adjacent digits Even a random sequence will start appearing to have patterns after a while Consider π repeats after a while and the second appearance is in the middle of another pattern. In fact Dr. Matrix found dozens of properties that were observed on π We also notice patterns in numbers used in every day life to aid our memory, thus human judgment is not very good to analyse random number generators. We thus rely on a number of statistical tests. If a random number generator succeeds to pass a number of tests, it might still fail on the next test. Yet each success gives us more confidence on its randomness. Joseph Cordina

2 There are two kinds of tests: Empirical Tests where a generated sequence is analysed and one derives a statistical score for the sequence; Theoretical Tests where certain properties are derived on the recurrence rule used to form the sequence. Let us examine the most basic of statistical tests, the Chi-Square test (χ 2 test) Assume two fair dices, we can get the following totals s with certain probabilities value of s= probability p s = If we throw the dice n times we should get the value of s approximately np s times on average. 9 In 44 throws one expects to get the value 4 about 2 times. Let us assume we throw the dice 44 times and record the outcome value of s= observed Y s = expected np s = As expected, the observed values are different from the expected. In fact if one gets 44 throws with s = 2 one would be convinced the dice are not fair even though this is still probable. Using these values one can devise a probabilistic test, i.e. how probable are certain throws on average. Joseph Cordina

3 One can look at the difference between the expected value of throws and the actual throws, thus V = (Y 2 np 2 ) 2 +(Y 3 np 3 ) (Y 2 np 2 ) 2 () A high value of V would indicate something is wrong. Note that V can still be high for a fair set of dice, and thus we ask how probable a certain value of V is. In (3) we give equal weight to each of the addition parts, even though (Y 7 np 7 ) 2 is likely to be higher than (Y 2 np 2 ) 2. Thus we weight each component to give V = (Y 2 np 2 ) 2 np (Y 2 np 2 ) 2 np 2 (2) This is known as the Chi-Square Test (χ 2 ) For the experiment shown previously we find that V = Yet is this value high or low? Joseph Cordina 3

4 In general we take n independent observations. Let p s be the probability that each observation falls into category s, and let Y s be the number of observations that actually do fall into category s. Then we have V = k s= (Y s np s ) 2 np s (3) In our previous example we had possible outcomes, so k =. Expanding (Y s np s ) 2 = Y 2 s 2np s Y s +n 2 p 2 s and knowing that we get Y + Y Y k = n p + p p k = V = n k s= ( Y s 2 ) n (4) p s Yet what makes a reasonable value for V? We make use of tables that give the chi-square distribution with n degrees of freedom for various values of v. Note that the value n = k should be used since as seen before one can calculate the value of Y k if one knows all other values. Thus one only has k independent values. Joseph Cordina 4

5 If the table entry in row n under column p is x, then the quantity V in Eq. (4) will be less than or equal to x with approximate probability p, if n is large enough. Thus if row 0 under 95 percent is 8.3, then we will have V > 8.3 only about 5 percent of the time. Assume we have two random number generators for 0 degrees of freedom, with V = 29.5 and V 2 =.2 then referring to the table we see that V is way too high, since V will be larger than 25.2 less than 0.05 percent of the time. On the other hand, V 2 is quite low meaning that the resulting value are too close to the expected. In fact we cannot consider these values to be random at all. For the previous experiment with V = we see that the value falls in between 25 and 50 percent, which is a mid-range value thus satisfactory. It is surprising that the same table is used regardless of the number of observations and regardless of p s. Only n seems to matter. This table is valid only for large number of observations. A common rule of thumb is to take as many observations as possible such that each np s is 5 or more. Joseph Cordina 5

6 In fact the proper choice of n, the number of observations, is somewhat obscure A bias will be detected as n gets larger. Yet large values of n will smooth out locally non-random behaviour, when a series of numbers towards a certain bias are followed by a series of numbers with an opposite bias. Best way to use the chi-square test is to run the test at least three times, and if at least two are suspect, the generator is considered as not sufficiently random. Exercise: Apply the chi-square test to random number generators mentioned previously. The Chi-Square Test is adequate when the number of categories is known. Yet one can have an infinite number of categories such as a random fraction. A general notation for specifying probability distributions is to use the distribution function F(x) on a random quantity X, where F(x) = Pr(X x) = probability (X x) Figure 3 shows the distribution function for (a) a random bit, (b) a uniformly distributed random real number and (c) the limiting distribution of the value V in the chi-square test. Joseph Cordina 6

7 If we make n independent observations of the random quantity X, thus getting X, X 2,..., X n we can form the empirical distribution function F n (x) where F n (x) = number of X, X 2,..., X n that are x n (5) Figure 4 shows examples of empirical distributions. Note that with a finite number of samples, one is bound to get jumps in the curve. The smooth curve is the distribution function. The Kolmogorov-Smirnov Test (KS test) measures the difference between F(x) and F n (x). A bad random number generator will give an empirical distribution function that does not approach F(x) sufficiently well. To make the KS-test we use the following K + n = n K n = n max (F n(x) F(x)) (6) <x<+ max (F(x) F n(x)) (7) <x<+ The K + n measures the greatest amount of deviation when F n is greater than F and vice versa. Joseph Cordina 7

8 The statistics of Fig 4 are K 20 + K20 Fig 4(a) Fig 4(b) Fig. 4(c) As in the Chi-Square Test we make use of tables to determine the probability of obtaining certain values of K. We see that the probability of obtaining K20 is or less is 75 percent. Note that the KS test is exact to the number of observations, unlike the Chi-Square Test. Equations 6 and 7 are not adequate for computer calculation since they vary over infinite values. Since F(x) is increasing and F n (x) also increases in finite steps, we can use the following procedure to obtain the KS-test values.. Obtain independent observations X,..., X n 2. Sort the observations in ascending order X... X n. 3. The desired statistics are now given by K + n = n max j n (j n F(X j)) (8) K n = n max j n (F(X j) j n ) (9) Joseph Cordina 8

9 Exercise Perform the KS Test on several random number generators mentioned previously and compare their corresponding Chi-Square Test. Exercise Make use of your preferred programming language random number generator for a finite number of degrees of freedom and perform the Chi-square and the KS Test on them Exercise Some dice were loaded such that on one die the value will appear twice as often as other numbers and the other die is similarly biased towards 6. The following values were obtained: value of s= observed Y s = Apply the Chi-Square test to determine if the chi-square test can detect the bad dice. If not, give indications why not. Exercise: Let F(x) be the uniform distribution given in Fig 3(b). Find K 20 + and k 20 for the following 20 observations 0.44, 0.732, 0.236, 0.62, 0.259, 0.442, 0.89, 0.693, 0.098, 0.302, 0.442, 0.434, 0.4, 0.07, 0.38, 0.869, 0.772, 0.678, 0.354, 0.78 and state if these values are to be expected. Joseph Cordina 9

10 The KS-Test and the Chi-Square Test are not normally used in isolation but in a number of empirical tests that evaluate random number sequences. What follows is a list of these tests. More details can be found in pages 6 to 75. Equidistribution Test: This tests that a series from 0 to is uniformly distributed. Serial Test: This tests that pairs of successive numbers is uniformly distributed in the sequence in an independent manner. This test can also be applied to triples, quadruples, etc. Gap Test: This examines the length of gaps between the occurrence of the same number. Poker Test: This test examines groups of five successive integers and observes the pattern they form. Coupon Collection Test: We see the length of numbers required to obtain a particular range of values. Permutation Test: This examines the possible relative ordering of generated sequences Run Test: This test examines if the numbers are increasing or decreasing and partitions them into groups. Maximum of t-test: This applies another test and selects the largest score on the sequences. Joseph Cordina 0

11 Collision Test: This is a test very similar to bucketing in hashing techniques. Birthday Spacing Test: This is similar to the above yet one applies an ordering sequence to the numbers Serial Correlation Test: This calculates the degree of dependency between one number and its predecessor. Exercise: Read about these tests and experiment with their implementation for your preferred random number generator. Joseph Cordina

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

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

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

H 2 : otherwise. that is simply the proportion of the sample points below level x. For any fixed point x the law of large numbers gives that

H 2 : otherwise. that is simply the proportion of the sample points below level x. For any fixed point x the law of large numbers gives that Lecture 28 28.1 Kolmogorov-Smirnov test. Suppose that we have an i.i.d. sample X 1,..., X n with some unknown distribution and we would like to test the hypothesis that is equal to a particular distribution

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

Module 8 Probability

Module 8 Probability Module 8 Probability Probability is an important part of modern mathematics and modern life, since so many things involve randomness. The ClassWiz is helpful for calculating probabilities, especially those

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

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

Overview. CSE 21 Day 5. Image/Coimage. Monotonic Lists. Functions Probabilistic analysis

Overview. CSE 21 Day 5. Image/Coimage. Monotonic Lists. Functions Probabilistic analysis Day 5 Functions/Probability Overview Functions Probabilistic analysis Neil Rhodes UC San Diego Image/Coimage The image of f is the set of values f actually takes on (a subset of the codomain) The inverse

More information

Topic 3 Random variables, expectation, and variance, II

Topic 3 Random variables, expectation, and variance, II CSE 103: Probability and statistics Fall 2010 Topic 3 Random variables, expectation, and variance, II 3.1 Linearity of expectation If you double each value of X, then you also double its average; that

More information

Theorem 1.7 [Bayes' Law]: Assume that,,, are mutually disjoint events in the sample space s.t.. Then Pr( )

Theorem 1.7 [Bayes' Law]: Assume that,,, are mutually disjoint events in the sample space s.t.. Then Pr( ) Theorem 1.7 [Bayes' Law]: Assume that,,, are mutually disjoint events in the sample space s.t.. Then Pr Pr = Pr Pr Pr() Pr Pr. We are given three coins and are told that two of the coins are fair and the

More information

1. Discrete Distributions

1. Discrete Distributions Virtual Laboratories > 2. Distributions > 1 2 3 4 5 6 7 8 1. Discrete Distributions Basic Theory As usual, we start with a random experiment with probability measure P on an underlying sample space Ω.

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

Discrete Mathematics for CS Spring 2006 Vazirani Lecture 22

Discrete Mathematics for CS Spring 2006 Vazirani Lecture 22 CS 70 Discrete Mathematics for CS Spring 2006 Vazirani Lecture 22 Random Variables and Expectation Question: The homeworks of 20 students are collected in, randomly shuffled and returned to the students.

More information

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 12. Random Variables: Distribution and Expectation

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 12. Random Variables: Distribution and Expectation CS 70 Discrete Mathematics and Probability Theory Fall 203 Vazirani Note 2 Random Variables: Distribution and Expectation We will now return once again to the question of how many heads in a typical sequence

More information

Non-Interactive Zero Knowledge (II)

Non-Interactive Zero Knowledge (II) Non-Interactive Zero Knowledge (II) CS 601.442/642 Modern Cryptography Fall 2017 S 601.442/642 Modern CryptographyNon-Interactive Zero Knowledge (II) Fall 2017 1 / 18 NIZKs for NP: Roadmap Last-time: Transformation

More information

Computing Probability

Computing Probability Computing Probability James H. Steiger October 22, 2003 1 Goals for this Module In this module, we will 1. Develop a general rule for computing probability, and a special case rule applicable when elementary

More information

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 16. Random Variables: Distribution and Expectation

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 16. Random Variables: Distribution and Expectation CS 70 Discrete Mathematics and Probability Theory Spring 206 Rao and Walrand Note 6 Random Variables: Distribution and Expectation Example: Coin Flips Recall our setup of a probabilistic experiment as

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

Lecture 22: Counting

Lecture 22: Counting CS 710: Complexity Theory 4/8/2010 Lecture 22: Counting Instructor: Dieter van Melkebeek Scribe: Phil Rydzewski & Chi Man Liu Last time we introduced extractors and discussed two methods to construct them.

More information

Review of Basic Probability Theory

Review of Basic Probability Theory Review of Basic Probability Theory James H. Steiger Department of Psychology and Human Development Vanderbilt University James H. Steiger (Vanderbilt University) 1 / 35 Review of Basic Probability Theory

More information

1 Probability Review. CS 124 Section #8 Hashing, Skip Lists 3/20/17. Expectation (weighted average): the expectation of a random quantity X is:

1 Probability Review. CS 124 Section #8 Hashing, Skip Lists 3/20/17. Expectation (weighted average): the expectation of a random quantity X is: CS 24 Section #8 Hashing, Skip Lists 3/20/7 Probability Review Expectation (weighted average): the expectation of a random quantity X is: x= x P (X = x) For each value x that X can take on, we look at

More information

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 15. Random Variables: Distributions, Independence, and Expectations

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 15. Random Variables: Distributions, Independence, and Expectations EECS 70 Discrete Mathematics and Probability Theory Fall 204 Anant Sahai Note 5 Random Variables: Distributions, Independence, and Expectations In the last note, we saw how useful it is to have a way of

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

Exam 1. Problem 1: True or false

Exam 1. Problem 1: True or false Exam 1 Problem 1: True or false We are told that events A and B are conditionally independent, given a third event C, and that P(B C) > 0. For each one of the following statements, decide whether the statement

More information

PHYS 275 Experiment 2 Of Dice and Distributions

PHYS 275 Experiment 2 Of Dice and Distributions PHYS 275 Experiment 2 Of Dice and Distributions Experiment Summary Today we will study the distribution of dice rolling results Two types of measurement, not to be confused: frequency with which we obtain

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

Discrete Mathematics and Probability Theory Fall 2012 Vazirani Note 14. Random Variables: Distribution and Expectation

Discrete Mathematics and Probability Theory Fall 2012 Vazirani Note 14. Random Variables: Distribution and Expectation CS 70 Discrete Mathematics and Probability Theory Fall 202 Vazirani Note 4 Random Variables: Distribution and Expectation Random Variables Question: The homeworks of 20 students are collected in, randomly

More information

Contingency Tables. Safety equipment in use Fatal Non-fatal Total. None 1, , ,128 Seat belt , ,878

Contingency Tables. Safety equipment in use Fatal Non-fatal Total. None 1, , ,128 Seat belt , ,878 Contingency Tables I. Definition & Examples. A) Contingency tables are tables where we are looking at two (or more - but we won t cover three or more way tables, it s way too complicated) factors, each

More information

Randomized Algorithms

Randomized Algorithms Randomized Algorithms Prof. Tapio Elomaa tapio.elomaa@tut.fi Course Basics A new 4 credit unit course Part of Theoretical Computer Science courses at the Department of Mathematics There will be 4 hours

More information

(x 1 +x 2 )(x 1 x 2 )+(x 2 +x 3 )(x 2 x 3 )+(x 3 +x 1 )(x 3 x 1 ).

(x 1 +x 2 )(x 1 x 2 )+(x 2 +x 3 )(x 2 x 3 )+(x 3 +x 1 )(x 3 x 1 ). CMPSCI611: Verifying Polynomial Identities Lecture 13 Here is a problem that has a polynomial-time randomized solution, but so far no poly-time deterministic solution. Let F be any field and let Q(x 1,...,

More information

Expectation, inequalities and laws of large numbers

Expectation, inequalities and laws of large numbers Chapter 3 Expectation, inequalities and laws of large numbers 3. Expectation and Variance Indicator random variable Let us suppose that the event A partitions the sample space S, i.e. A A S. The indicator

More information

Randomized algorithms. Inge Li Gørtz

Randomized algorithms. Inge Li Gørtz Randomized algorithms Inge Li Gørtz Randomized algorithms Today What are randomized algorithms? Properties of randomized algorithms Two examples: Median/Select. Quick-sort Randomized Algorithms Randomized

More information

Lecture 2: From Classical to Quantum Model of Computation

Lecture 2: From Classical to Quantum Model of Computation CS 880: Quantum Information Processing 9/7/10 Lecture : From Classical to Quantum Model of Computation Instructor: Dieter van Melkebeek Scribe: Tyson Williams Last class we introduced two models for deterministic

More information

Attempt QUESTIONS 1 and 2, and THREE other questions. penalised if you attempt additional questions.

Attempt QUESTIONS 1 and 2, and THREE other questions. penalised if you attempt additional questions. UNIVERSITY OF EAST ANGLIA School of Mathematics Main Series UG Examination 2017 18 SETS, NUMBERS AND PROBABILITY MTHA4001Y Time allowed: 2 Hours Attempt QUESTIONS 1 and 2, and THREE other questions. penalised

More information

A Collection of Dice Problems

A Collection of Dice Problems with solutions and useful appendices (a work continually in progress) version July 5, 208 doctormatt at madandmoonly dot com www.matthewconroy.com Thanks A number of people have sent corrections, comments

More information

Random Variables Example:

Random Variables Example: Random Variables Example: We roll a fair die 6 times. Suppose we are interested in the number of 5 s in the 6 rolls. Let X = number of 5 s. Then X could be 0, 1, 2, 3, 4, 5, 6. X = 0 corresponds to the

More information

CS 125 Section #12 (More) Probability and Randomized Algorithms 11/24/14. For random numbers X which only take on nonnegative integer values, E(X) =

CS 125 Section #12 (More) Probability and Randomized Algorithms 11/24/14. For random numbers X which only take on nonnegative integer values, E(X) = CS 125 Section #12 (More) Probability and Randomized Algorithms 11/24/14 1 Probability First, recall a couple useful facts from last time about probability: Linearity of expectation: E(aX + by ) = ae(x)

More information

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE THE ROYAL STATISTICAL SOCIETY 004 EXAMINATIONS SOLUTIONS HIGHER CERTIFICATE PAPER II STATISTICAL METHODS The Society provides these solutions to assist candidates preparing for the examinations in future

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

Treatment of Error in Experimental Measurements

Treatment of Error in Experimental Measurements in Experimental Measurements All measurements contain error. An experiment is truly incomplete without an evaluation of the amount of error in the results. In this course, you will learn to use some common

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

2. The Binomial Distribution

2. The Binomial Distribution 1 of 11 7/16/2009 6:39 AM Virtual Laboratories > 11. Bernoulli Trials > 1 2 3 4 5 6 2. The Binomial Distribution Basic Theory Suppose that our random experiment is to perform a sequence of Bernoulli trials

More information

More on Bayes and conjugate forms

More on Bayes and conjugate forms More on Bayes and conjugate forms Saad Mneimneh A cool function, Γ(x) (Gamma) The Gamma function is defined as follows: Γ(x) = t x e t dt For x >, if we integrate by parts ( udv = uv vdu), we have: Γ(x)

More information

Recall the Basics of Hypothesis Testing

Recall the Basics of Hypothesis Testing Recall the Basics of Hypothesis Testing The level of significance α, (size of test) is defined as the probability of X falling in w (rejecting H 0 ) when H 0 is true: P(X w H 0 ) = α. H 0 TRUE H 1 TRUE

More information

j=1 π j = 1. Let X j be the number

j=1 π j = 1. Let X j be the number THE χ 2 TEST OF SIMPLE AND COMPOSITE HYPOTHESES 1. Multinomial distributions Suppose we have a multinomial (n,π 1,...,π k ) distribution, where π j is the probability of the jth of k possible outcomes

More information

S6880 #6. Random Number Generation #2: Testing RNGs

S6880 #6. Random Number Generation #2: Testing RNGs S6880 #6 Random Number Generation #2: Testing RNGs 1 Testing Uniform RNGs Theoretical Tests Outline 2 Empirical Tests for Independence Gap Tests Runs Test Coupon Collectors Test The Poker Test 3 Other

More information

7.1 What is it and why should we care?

7.1 What is it and why should we care? Chapter 7 Probability In this section, we go over some simple concepts from probability theory. We integrate these with ideas from formal language theory in the next chapter. 7.1 What is it and why should

More information

CS5314 Randomized Algorithms. Lecture 5: Discrete Random Variables and Expectation (Conditional Expectation, Geometric RV)

CS5314 Randomized Algorithms. Lecture 5: Discrete Random Variables and Expectation (Conditional Expectation, Geometric RV) CS5314 Randomized Algorithms Lecture 5: Discrete Random Variables and Expectation (Conditional Expectation, Geometric RV) Objectives Introduce Geometric RV We then introduce Conditional Expectation Application:

More information

Practice Problems Section Problems

Practice Problems Section Problems Practice Problems Section 4-4-3 4-4 4-5 4-6 4-7 4-8 4-10 Supplemental Problems 4-1 to 4-9 4-13, 14, 15, 17, 19, 0 4-3, 34, 36, 38 4-47, 49, 5, 54, 55 4-59, 60, 63 4-66, 68, 69, 70, 74 4-79, 81, 84 4-85,

More information

Discrete Random Variable

Discrete Random Variable Discrete Random Variable Outcome of a random experiment need not to be a number. We are generally interested in some measurement or numerical attribute of the outcome, rather than the outcome itself. n

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

Math 3338: Probability (Fall 2006)

Math 3338: Probability (Fall 2006) Math 3338: Probability (Fall 2006) Jiwen He Section Number: 10853 http://math.uh.edu/ jiwenhe/math3338fall06.html Probability p.1/8 2.2 Axioms, Interpretations, and Properties of Probability Probability

More information

Review of Probability. CS1538: Introduction to Simulations

Review of Probability. CS1538: Introduction to Simulations Review of Probability CS1538: Introduction to Simulations Probability and Statistics in Simulation Why do we need probability and statistics in simulation? Needed to validate the simulation model Needed

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

SIO 221B, Rudnick adapted from Davis 1. 1 x lim. N x 2 n = 1 N. { x} 1 N. N x = 1 N. N x = 1 ( N N x ) x = 0 (3) = 1 x N 2

SIO 221B, Rudnick adapted from Davis 1. 1 x lim. N x 2 n = 1 N. { x} 1 N. N x = 1 N. N x = 1 ( N N x ) x = 0 (3) = 1 x N 2 SIO B, Rudnick adapted from Davis VII. Sampling errors We do not have access to the true statistics, so we must compute sample statistics. By this we mean that the number of realizations we average over

More information

11 CHI-SQUARED Introduction. Objectives. How random are your numbers? After studying this chapter you should

11 CHI-SQUARED Introduction. Objectives. How random are your numbers? After studying this chapter you should 11 CHI-SQUARED Chapter 11 Chi-squared Objectives After studying this chapter you should be able to use the χ 2 distribution to test if a set of observations fits an appropriate model; know how to calculate

More information

The Multinomial Model

The Multinomial Model The Multinomial Model STA 312: Fall 2012 Contents 1 Multinomial Coefficients 1 2 Multinomial Distribution 2 3 Estimation 4 4 Hypothesis tests 8 5 Power 17 1 Multinomial Coefficients Multinomial coefficient

More information

6.042/18.062J Mathematics for Computer Science November 28, 2006 Tom Leighton and Ronitt Rubinfeld. Random Variables

6.042/18.062J Mathematics for Computer Science November 28, 2006 Tom Leighton and Ronitt Rubinfeld. Random Variables 6.042/18.062J Mathematics for Computer Science November 28, 2006 Tom Leighton and Ronitt Rubinfeld Lecture Notes Random Variables We ve used probablity to model a variety of experiments, games, and tests.

More information

Chapte The McGraw-Hill Companies, Inc. All rights reserved.

Chapte The McGraw-Hill Companies, Inc. All rights reserved. er15 Chapte Chi-Square Tests d Chi-Square Tests for -Fit Uniform Goodness- Poisson Goodness- Goodness- ECDF Tests (Optional) Contingency Tables A contingency table is a cross-tabulation of n paired observations

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

Business Statistics. Lecture 3: Random Variables and the Normal Distribution

Business Statistics. Lecture 3: Random Variables and the Normal Distribution Business Statistics Lecture 3: Random Variables and the Normal Distribution 1 Goals for this Lecture A little bit of probability Random variables The normal distribution 2 Probability vs. Statistics Probability:

More information

b + O(n d ) where a 1, b > 1, then O(n d log n) if a = b d d ) if a < b d O(n log b a ) if a > b d

b + O(n d ) where a 1, b > 1, then O(n d log n) if a = b d d ) if a < b d O(n log b a ) if a > b d CS161, Lecture 4 Median, Selection, and the Substitution Method Scribe: Albert Chen and Juliana Cook (2015), Sam Kim (2016), Gregory Valiant (2017) Date: January 23, 2017 1 Introduction Last lecture, we

More information

Massachusetts Institute of Technology Lecture J/18.062J: Mathematics for Computer Science 2 May 2000 Professors David Karger and Nancy Lynch

Massachusetts Institute of Technology Lecture J/18.062J: Mathematics for Computer Science 2 May 2000 Professors David Karger and Nancy Lynch Massachusetts Institute of Technology Lecture 23 6.042J/18.062J: Mathematics for Computer Science 2 May 2000 Professors David Karger and Nancy Lynch Lecture Notes 1 The Expected Value of a Product This

More information

CS 124 Math Review Section January 29, 2018

CS 124 Math Review Section January 29, 2018 CS 124 Math Review Section CS 124 is more math intensive than most of the introductory courses in the department. You re going to need to be able to do two things: 1. Perform some clever calculations to

More information

Multiple Sample Categorical Data

Multiple Sample Categorical Data Multiple Sample Categorical Data paired and unpaired data, goodness-of-fit testing, testing for independence University of California, San Diego Instructor: Ery Arias-Castro http://math.ucsd.edu/~eariasca/teaching.html

More information

Algebra I+ Pacing Guide. Days Units Notes Chapter 1 ( , )

Algebra I+ Pacing Guide. Days Units Notes Chapter 1 ( , ) Algebra I+ Pacing Guide Days Units Notes Chapter 1 (1.1-1.4, 1.6-1.7) Expressions, Equations and Functions Differentiate between and write expressions, equations and inequalities as well as applying order

More information

Randomized Load Balancing:The Power of 2 Choices

Randomized Load Balancing:The Power of 2 Choices Randomized Load Balancing: The Power of 2 Choices June 3, 2010 Balls and Bins Problem We have m balls that are thrown into n bins, the location of each ball chosen independently and uniformly at random

More information

Statistical Hypothesis Testing

Statistical Hypothesis Testing Statistical Hypothesis Testing Dr. Phillip YAM 2012/2013 Spring Semester Reference: Chapter 7 of Tests of Statistical Hypotheses by Hogg and Tanis. Section 7.1 Tests about Proportions A statistical hypothesis

More information

Introduction to discrete probability. The rules Sample space (finite except for one example)

Introduction to discrete probability. The rules Sample space (finite except for one example) Algorithms lecture notes 1 Introduction to discrete probability The rules Sample space (finite except for one example) say Ω. P (Ω) = 1, P ( ) = 0. If the items in the sample space are {x 1,..., x n }

More information

5 ProbabilisticAnalysisandRandomized Algorithms

5 ProbabilisticAnalysisandRandomized Algorithms 5 ProbabilisticAnalysisandRandomized Algorithms This chapter introduces probabilistic analysis and randomized algorithms. If you are unfamiliar with the basics of probability theory, you should read Appendix

More information

2. Probability. Chris Piech and Mehran Sahami. Oct 2017

2. Probability. Chris Piech and Mehran Sahami. Oct 2017 2. Probability Chris Piech and Mehran Sahami Oct 2017 1 Introduction It is that time in the quarter (it is still week one) when we get to talk about probability. Again we are going to build up from first

More information

Inaccessible Entropy and its Applications. 1 Review: Psedorandom Generators from One-Way Functions

Inaccessible Entropy and its Applications. 1 Review: Psedorandom Generators from One-Way Functions Columbia University - Crypto Reading Group Apr 27, 2011 Inaccessible Entropy and its Applications Igor Carboni Oliveira We summarize the constructions of PRGs from OWFs discussed so far and introduce the

More information

Module 03 Lecture 14 Inferential Statistics ANOVA and TOI

Module 03 Lecture 14 Inferential Statistics ANOVA and TOI Introduction of Data Analytics Prof. Nandan Sudarsanam and Prof. B Ravindran Department of Management Studies and Department of Computer Science and Engineering Indian Institute of Technology, Madras Module

More information

CMPSCI 240: Reasoning Under Uncertainty

CMPSCI 240: Reasoning Under Uncertainty CMPSCI 240: Reasoning Under Uncertainty Lecture 5 Prof. Hanna Wallach wallach@cs.umass.edu February 7, 2012 Reminders Pick up a copy of B&T Check the course website: http://www.cs.umass.edu/ ~wallach/courses/s12/cmpsci240/

More information

Sampling Distributions

Sampling Distributions Sampling Error As you may remember from the first lecture, samples provide incomplete information about the population In particular, a statistic (e.g., M, s) computed on any particular sample drawn from

More information

Random Variable. Pr(X = a) = Pr(s)

Random Variable. Pr(X = a) = Pr(s) Random Variable Definition A random variable X on a sample space Ω is a real-valued function on Ω; that is, X : Ω R. A discrete random variable is a random variable that takes on only a finite or countably

More information

Lecture Notes. This lecture introduces the idea of a random variable. This name is a misnomer, since a random variable is actually a function.

Lecture Notes. This lecture introduces the idea of a random variable. This name is a misnomer, since a random variable is actually a function. Massachusetts Institute of Technology Lecture 21 6.042J/18.062J: Mathematics for Computer Science 25 April 2000 Professors David Karger and Nancy Lynch Lecture Notes 1 Random Variables This lecture introduces

More information

CS 5014: Research Methods in Computer Science. Bernoulli Distribution. Binomial Distribution. Poisson Distribution. Clifford A. Shaffer.

CS 5014: Research Methods in Computer Science. Bernoulli Distribution. Binomial Distribution. Poisson Distribution. Clifford A. Shaffer. Department of Computer Science Virginia Tech Blacksburg, Virginia Copyright c 2015 by Clifford A. Shaffer Computer Science Title page Computer Science Clifford A. Shaffer Fall 2015 Clifford A. Shaffer

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

Chapter 9. Non-Parametric Density Function Estimation

Chapter 9. Non-Parametric Density Function Estimation 9-1 Density Estimation Version 1.2 Chapter 9 Non-Parametric Density Function Estimation 9.1. Introduction We have discussed several estimation techniques: method of moments, maximum likelihood, and least

More information

CS 246 Review of Proof Techniques and Probability 01/14/19

CS 246 Review of Proof Techniques and Probability 01/14/19 Note: This document has been adapted from a similar review session for CS224W (Autumn 2018). It was originally compiled by Jessica Su, with minor edits by Jayadev Bhaskaran. 1 Proof techniques Here we

More information

Lecture 1. ABC of Probability

Lecture 1. ABC of Probability Math 408 - Mathematical Statistics Lecture 1. ABC of Probability January 16, 2013 Konstantin Zuev (USC) Math 408, Lecture 1 January 16, 2013 1 / 9 Agenda Sample Spaces Realizations, Events Axioms of Probability

More information

Single Maths B: Introduction to Probability

Single Maths B: Introduction to Probability Single Maths B: Introduction to Probability Overview Lecturer Email Office Homework Webpage Dr Jonathan Cumming j.a.cumming@durham.ac.uk CM233 None! http://maths.dur.ac.uk/stats/people/jac/singleb/ 1 Introduction

More information

Stochastic Simulation

Stochastic Simulation Stochastic Simulation APPM 7400 Lesson 3: Testing Random Number Generators Part II: Uniformity September 5, 2018 Lesson 3: Testing Random Number GeneratorsPart II: Uniformity Stochastic Simulation September

More information

Probability Rules. MATH 130, Elements of Statistics I. J. Robert Buchanan. Fall Department of Mathematics

Probability Rules. MATH 130, Elements of Statistics I. J. Robert Buchanan. Fall Department of Mathematics Probability Rules MATH 130, Elements of Statistics I J. Robert Buchanan Department of Mathematics Fall 2018 Introduction Probability is a measure of the likelihood of the occurrence of a certain behavior

More information

Carleton University. Final Examination Winter DURATION: 2 HOURS No. of students: 275

Carleton University. Final Examination Winter DURATION: 2 HOURS No. of students: 275 Carleton University Final Examination Winter 2017 DURATION: 2 HOURS No. of students: 275 Department Name & Course Number: Computer Science COMP 2804B Course Instructor: Michiel Smid Authorized memoranda:

More information

arxiv: v1 [math.gm] 23 Dec 2018

arxiv: v1 [math.gm] 23 Dec 2018 A Peculiarity in the Parity of Primes arxiv:1812.11841v1 [math.gm] 23 Dec 2018 Debayan Gupta MIT debayan@mit.edu January 1, 2019 Abstract Mayuri Sridhar MIT mayuri@mit.edu We create a simple test for distinguishing

More information

Monte Carlo Integration. Computer Graphics CMU /15-662, Fall 2016

Monte Carlo Integration. Computer Graphics CMU /15-662, Fall 2016 Monte Carlo Integration Computer Graphics CMU 15-462/15-662, Fall 2016 Talk Announcement Jovan Popovic, Senior Principal Scientist at Adobe Research will be giving a seminar on Character Animator -- Monday

More information

Notes on Mathematics Groups

Notes on Mathematics Groups EPGY Singapore Quantum Mechanics: 2007 Notes on Mathematics Groups A group, G, is defined is a set of elements G and a binary operation on G; one of the elements of G has particularly special properties

More information

" M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2

 M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2 Notation and Equations for Final Exam Symbol Definition X The variable we measure in a scientific study n The size of the sample N The size of the population M The mean of the sample µ The mean of the

More information

PRODUCTS THAT ARE POWERS. A mathematical vignette Ed Barbeau, University of Toronto

PRODUCTS THAT ARE POWERS. A mathematical vignette Ed Barbeau, University of Toronto PRODUCTS THAT ARE POWERS. A mathematical vignette Ed Barbeau, University of Toronto This investigation was originally designed for school students to gain fluency with the factoring of positive integers

More information

Contingency Tables. Contingency tables are used when we want to looking at two (or more) factors. Each factor might have two more or levels.

Contingency Tables. Contingency tables are used when we want to looking at two (or more) factors. Each factor might have two more or levels. Contingency Tables Definition & Examples. Contingency tables are used when we want to looking at two (or more) factors. Each factor might have two more or levels. (Using more than two factors gets complicated,

More information

Weldon s dice. Lecture 15 - χ 2 Tests. Labby s dice. Labby s dice (cont.)

Weldon s dice. Lecture 15 - χ 2 Tests. Labby s dice. Labby s dice (cont.) Weldon s dice Weldon s dice Lecture 15 - χ 2 Tests Sta102 / BME102 Colin Rundel March 6, 2015 Walter Frank Raphael Weldon (1860-1906), was an English evolutionary biologist and a founder of biometry. He

More information

Chapter 26: Comparing Counts (Chi Square)

Chapter 26: Comparing Counts (Chi Square) Chapter 6: Comparing Counts (Chi Square) We ve seen that you can turn a qualitative variable into a quantitative one (by counting the number of successes and failures), but that s a compromise it forces

More information

Math 461 B/C, Spring 2009 Midterm Exam 1 Solutions and Comments

Math 461 B/C, Spring 2009 Midterm Exam 1 Solutions and Comments Math 461 B/C, Spring 2009 Midterm Exam 1 Solutions and Comments 1. Suppose A, B and C are events with P (A) = P (B) = P (C) = 1/3, P (AB) = P (AC) = P (BC) = 1/4 and P (ABC) = 1/5. For each of the following

More information

Statistical Analysis for QBIC Genetics Adapted by Ellen G. Dow 2017

Statistical Analysis for QBIC Genetics Adapted by Ellen G. Dow 2017 Statistical Analysis for QBIC Genetics Adapted by Ellen G. Dow 2017 I. χ 2 or chi-square test Objectives: Compare how close an experimentally derived value agrees with an expected value. One method to

More information

i=1 Pr(X 1 = i X 2 = i). Notice each toss is independent and identical, so we can write = 1/6

i=1 Pr(X 1 = i X 2 = i). Notice each toss is independent and identical, so we can write = 1/6 Mehryar Mohri Foundations of Machine Learning Courant Institute of Mathematical Sciences Homework assignment 1 - solution Credit: Ashish Rastogi, Afshin Rostamizadeh Ameet Talwalkar, and Eugene Weinstein.

More information

STA 247 Solutions to Assignment #1

STA 247 Solutions to Assignment #1 STA 247 Solutions to Assignment #1 Question 1: Suppose you throw three six-sided dice (coloured red, green, and blue) repeatedly, until the three dice all show different numbers. Assuming that these dice

More information