This mathlet generates random normal data from a
\(N(\mu, \sigma^2)\). It then computes and displays both the
normal (\(\sigma\) known) and \(t\)-confidence (\(\sigma\) unknown).
Controls
\(\mu\)-slider: Sets the value of the mean \(\mu\).
\(\sigma\)-slider: Sets the value of the mean \(\sigma\).
\(n\)-slider: Sets the number of random data points to generate.
\(c\)-slider: Sets the confidence level.
Run \(N\) trials button: A single trial consists of generating \(n\)
random values from a \(N(\mu, \sigma^2)\) distribution. This runs
\(N\) trials, updates the percentage correct and displays the
confidence intervals for the last trial.
\(N\)-slider: Sets the number of trials to run for each click of
the "Run \(N\) trials" button.
Graph
Shows the plot of the normal density for the sample mean
\(\bar{x} \backsim N(\mu, \frac{\sigma^2}{n})\).
The yellow diamond marks \(\mu\), the mean of the normal
distribution.
The blue diamond marks \(\bar{x}\), the sample mean.
The orange-ish bar (above the light-orange/pinkish bar) is the
normal confidence interval.
The light-orange/pinkish bar (below the orange-ish bar) is the
\(t\)-confidence interval.
Readouts
\(\bar{x}\): the sample mean
\(s\): the sample standard deviation
\(z\): the right critical point for the standard normal, e.g.
\(z_{.025}\) is the \(.975\) quantile for the standard normal.
t: the right critical point for the student-\(t\) distribution, e.g.
\(t_{.025}\) is the \(.975\) quantile for the \(t(n-1)\).
\(Z\)-trials run: the total number of \(Z\)-trials run at the
current settings.
\(Z\) correct: the percentage of \(Z\) trials in which \(\mu\) was
truly in the confidence interval.
\(t\)-trials run: the total number of \(t\)-trials run at the
current settings. This will be different from \(Z\)-trials if
\(n = 1\).
\(t\) correct: the percentage of \(t\)-trials in which \(\mu\) was
truly in the confidence interval.
Warning
You can change the underlying parameters without generating new
data.
In this case the confidence intervals will change, but they will be
based on data that was generated from other parameters.
This is left in so it is easy to see how the parameters affect the
confidence intervals. For instance, you can see clearly that
increasing n leads to smaller confidence intervals. When this happens
a red warning will appear on the screen.