131A_1_Wed_May_21_lecture

131A_1_Wed_May_21_lecture - Wed. May 21st Lecture Providing...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
UCLA EE131A (KY) 1 Wed. May 21 st Lecture Providing All the Background Materials for the Class Project Randomness of a sequence of numbers Pseudo-random number generation Monte Carlo (MC) simulations PR generation of a rv with as arbitrary F(x) Background materials for class project
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
UCLA EE131A (KY) 2 Randomness of a sequence of numbers (1) Introduction - Given a sequence of number, how can we tell if it is random? Ex. 1. Given {4, 14, 23, 34}, can we “predict” the next integer? No, the next number is “42”, since these numbers are the North-South subway train station in NYC. Clearly, this sequence of no. is not random. Suppose we toss a coin and denote an “1” for a “head” and “0” for a “tail.” Then the i-th rv X i has the sample space S = {0, 1}. If given a sequence of 1’s and 0’s, from the toss of a coin, why do we believe the outcomes are “random?” In other words, what characterizes a “random sequence?”
Background image of page 2
UCLA EE131A (KY) 3 Randomness of a sequence of numbers (2) Given a coin toss of length n, we can find P(“1”) and P(“0”) by using P(“1”) = Number of “1” s / n, P(“0”) = Number of “0” s / n. The coin is “fair” if P(“1”) = P(“0”) = 1/2. In other words, we use the “relative frequency concept” to obtain the “probability” of an event. Various algorithms have been proposed to perform testing for “randomness.”
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
UCLA EE131A (KY) 4 Randomness of a sequence of numbers (3) Testing for randomness of a binary {0, 1} sequence 1. Test for randomness of order 1. Count the number of “1”s and number of “0”s. If their relative frequencies are equal (or close) to ½, the sequence passes the “test for order 1.” 2. Test for randomness of order 2. Check the relative frequencies of blocks of length 2 of the form “00”, :”01”, “10”, and “11”. If they are all equal (or close) to ¼, then it passes the test of order 2.
Background image of page 4
UCLA EE131A (KY) 5 .. k. Test for randomness of order k. Check for relative frequencies of blocks of lengths k. There are 2 k such blocks and their relative frequencies should be 1/2 k . If they are all equal (or close) to 1/2 k , then it passes the test of order k. Clearly, we need a more systematic ways to generate “random sequences” then flipping coins. Randomness of a sequence of numbers (4)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
UCLA EE131A (KY) 6 Pseudo-random number generation (1) We want to have fixed (deterministic) algorithms that can generate “random sequences” that pass the “test for randomness of order k,” for k = 1, 2, …. For non-binary sequences, it can be generalized. The John von Neumann (a famous mathematician and the originator of the programmable digital computer) proposed the “middle square” method. Ex. 1. Start with a three digit number, say “157”. After squaring, take “464” out of 157 2 = 2 464 9. Then take “573” in 24649 2 = 607 573 201, and so on, etc.
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 30

131A_1_Wed_May_21_lecture - Wed. May 21st Lecture Providing...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online