Math 362 - Computer Lab #8 - Fall 2002
Introduction
to Probability Theory
Computer Lab 8: Random numbers
In this lab, we will see how to plot an approximation of the p.d.f. of a continuous
random variable, given a large random sample for this random variable. We will also
see how to generate random numbers according to a given continuous distribution.
- How to plot an approximation of the p.d.f. of a continuous random variable
- Use MINITAB to create 10000 rows of random numbers from a normal distribution with
mean 0 and variance 1. Store the data in Column C1.
- Repeat the above with 1000 rows of data, and store the results in Column C2.
- Use Graph -> Histogram... to plot a histogram of the data in Columns C1
and C2. Click on Frame -> Multiple Graphs... and choose the option Overlay
graphs on the same page, to see both graphs at the same time.
- Are the two plots similar? Why or why not? Can you see why there is a problem?
- Plot a histogram again, but now click on Options... and select Percent under
Type of Histogram. Is the result satisfactory? Why or why not?
- Repeat the above with Density selected under Type of Histogram. Is the result
satisfactory? Why or why not?
- Based on the above results, what do you think is the best way to plot an approximation of
the p.d.f. of a random variable, given a large random sample for this random variable?
- How to generate random numbers according to a given continuous distribution
Suppose we want to create random numbers according to a triangular density function, supported
on the interval [-1,1].
- Draw a picture showing the graph of the p.d.f. of the corresponding random variable (call it
X), and find a formula for this p.d.f.
- Find a formula for the c.d.f. F of X and plot this function.
- If Y = F ( X ), find X in terms of Y.
- We will see that Y has a uniform distribution on [0,1]. Use this information to generate
a random sample for X of size 10000.
- Check your result by using this random sample to plot an approximation of the p.d.f. of
X.
- Reading Assignment: Section 3.8
The macro Random.MTB creates a random sample of size 100000 for X
from a set of uniformly distributed random numbers, and uses the result to plot an approximation of
the p.d.f. of X. You may try and modify this file at your convenience.
Back to Math 362