Exercise 1 - General PDF

Uniform Distribution:
  1. Write a program that generates 100 real random numbers in the range [-10,10].
  2. Write a program that generates 100 integer random numbers in the range [-10,10].
Transformation Method:
  1. For the following transformation functions transforming uniform distributions of random numbers Px(x) in the range 0 < x < 1 into non-uniform distributions Py(y):

    (a) y = SQRT(3+x)
    (b) y = ArcCosine(1-2x)
    (c) y = 1/(x+0.5)

    • Determine the transformed probability density functions Py(y).
    • Write down the range of y values.
    • Sketch the distribution Py(y).
    • Show that the integral of the transformed distribution is equal to the integral of the original uniform distribution.

  2. For each the following target distribution functions, Py(y):

    (a) Py = 2y2
    (b) Py = ln(y)
    (c) Py = sin(y)

    • Determine the transformation functions y=f(x).
    • Sketch the distribution Py(y) and f(x).
    • Write a program to view function Py.
Rejection Method:

  1. For each the following target distribution functions, Py(y), (for given ranges in the square brakets) :

    (a) Py = pi+cos(y)    [-pi,3pi]
    (b) Py = exp(-y2)    [-10,10]
    (c) Py = 1-x2    [-1,1]

    • Sketch the distribution Py(y).
    • Write a program to view function Py.