{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

815.worksheet08

# 815.worksheet08 - a Standard Trapezoidal rule with 2...

This preview shows pages 1–2. Sign up to view the full content.

Biostatistics 615 / 815 Problem Set 7 Due November 17, 2004 Random Number Generation 1. An old text book on computer simulation recommends the following sequence of pseudo-random numbers: I j+1 = a I j mod m, with a = 20,403 and m = 2 15 . What is the period of this random number generator, that is, how many numbers can be generated before the sequence repeats itself? 2. Consider the following formula for generating pseudo-random sequences: I j+1 = ( a I j + c ) mod m When c = 1 and m = 32, examine the resulting sequences when: a) a = 13 b) a = 17 c) a = 19 d) a = 10 Which of the three sequences appear random? Do all sequences have a full period (32 is the maximum period in this case)? Integration 3. Implement code to calculate the integral of the function f(x) = (1 + x)/(1 + x 2 ) in the interval (2, 4) using each of the following numerical methods:

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

View Full Document