A particular type of lamp filament is known to have a life time that is a random quantity with an exponential distribution. The true mean lifetime of the filaments is known to be 1,000 hours.
Simulate a random sample of 100 such lamp filaments by placing
100 values, drawn randomly from an exponential distribution of
mean
Unlike Minitab, Excel lacks the direct ability to populate a column with values drawn randomly from an exponential distribution.
However, we can build on the Excel function that generates random numbers from the standard continuous uniform distribution U(0,1).
In a new workbook, enter names for the first two columns.
On the main menu bar, click on 'Data', then 'Data Analysis' (if it is there).
In the new pop-up box, 'Analysis ToolPak' and and click 'OK'. |
![]() |
Having clicked on 'Data', then 'Data Analysis', |
![]() |
In the new dialog box, Number of variables: set to 1 Use the pull down menu to set the Accept the default parameters 0 and 1. In the output options group, Click 'OK'. |
![]() |
![]() |
A set of random numbers appears in cells 'A2' to 'A101'. Note that your values will be different from the ones you see here. |
To generate random values from the exponential distribution with mean (and standard deviation) = 1000, we need to take the natural logarithm of these uniform random values and scale by ‐1000.
In cell 'B2', enter the formula |
![]() |
![]() |
Click and hold on the bottom right corner of cell 'B2', Copy-drag the formula down to cell 'B101' and release. Column 'B' now contains a random sample of 100 values drawn from an exponential distribution of mean 1000. |
Although this step is not required by the problem specification, let us sort the data into ascending order.
![]() |
Click on the grey corner
On the main menu bar, click on 'Data'. Then click on 'Sort'. |
![]() |
In the 'Sort' dialog box, In the 'Column' – 'Sort by' box, Then click on 'OK'. |
![]() |
The sorted version of your data should now be in the second column of the workbook. [Again, your values won’t match the values that you see here!] |
As we did in the first tutorial, we will extend this workbook to calculate some of the summary statistics, create a boxplot and find the values necessary to create a true histogram.
Unfortunately Excel cannot generate a histogram for unequal bar widths.
Begin by entering text as shown.
I have chosen to change the format to centre for row 1 and right-adjusted for
columns 'I' and 'L'.
The formulas for the summary statistics are:
'J2' (n) | = COUNT(B:B) | ![]() | |
'J3' (Sum) | = SUM(B:B) | ||
'J4' (Mean) | = J3 / J2 | ||
'J6' (s.d.) | = STDEV.S(B:B) | ||
'J8' (min) | = MIN(B:B) | ||
'J9' (Q1) | = QUARTILE.EXC(B:B, 1) | ||
'J10' (median) | = QUARTILE.EXC(B:B, 2) | ||
'J11' (Q3) | = QUARTILE.EXC(B:B, 3) | ||
'J12' (max) | = MAX(B:B) | ||
'M5' (IQR) | = J11 - J9 | ||
'M6' (SIQR) | = M5 / 2 | ||
'M8' (UOF) | = J11 + 3*M5 | ||
'M9' (UIF) | = J11 + 3*M6 | ||
'M11' (LIF) | = J9 - 3*M6 | ||
'M12' (LOF) | = J9 - 3*M5 |
![]() |
With column 'B' selected, |
Again one may customize this chart. | ![]() |
The random sample illustrated here came from an exponentially distributed population with a true mean and standard deviation of 1,000 hours. The sample mean is somewhat greater, at 1,022 hours, while the sample standard deviation is somewhat less, at 922 hours. A good batch, perhaps, but not that unlikely to have occurred by chance, (as we shall be able to prove, after we have studied continuous probability distributions).
The positive skew is so strong that, although the sample mean lamp filament lifetime is about 1,022 hours, half of all of the lamp filaments in this sample burned out in less than 679 hours!
![]() |
Enter the bins as shown You may need to change the '5000' Then set the bin width formula in 'D2' |
Select the eight values of frequency Type Instead press 'Shift+Ctrl+Enter'. |
![]() |
![]() |
Enter the total frequency (relative frequency) = freq. / (total freq.) density = (rel. freq.) / (bin width) |
Drag-copy the formulae The values in column 'C' (bins) The values in column 'G' (density) You can import these values into | ![]() |
As noted before, Minitab can generate a true histogram:
We shall use Excel to simulate flipping a fair coin repeatedly and keeping track of the proportion of heads observed. In this way we can see how the empirical probability usually converges on the classical probability. Obviously, for a fair coin, the probability of a head should be 0.5 .
Enter text in the You can adjust the fonts as desired. |
![]() |
![]() |
Freeze the top three rows, Click the cursor on cell 'A4'. Click on the 'View' menu, Click on the first option All rows above and columns to the left |
Column 'A' will keep track of the number of coin tosses so far.
Column 'B' is a random number in (0,1), drawn from the continuous uniform
distribution.
Column 'C' simulates whether that coin flip is a head or a tail.
With equal probability for each, a value in column 'B' less than 0.5 will
be interpreted as a 'head', represented by '1', otherwise it’s a tail,
represented by '0'.
Column 'D' keeps track of the number of heads so far (the cumulative frequency).
Each entry in column 'D' is the entry above it plus the new entry to the left,
(0 if a tail, 1 if a head).
Column 'E' keeps track of the relative frequency of heads.
The relative frequency is just the frequency so far, divided by the number of
coin flips so far.
Enter formulas in row 5: Cell 'A5': |
![]() |
![]() |
Select cells 'A5' to 'E5' Drag the cursor all the way down |
![]() |
The formulae in row 5 should now |
Column 'E' now holds the history of the evolution of the relative frequency, which is also the empirical probability (our estimate of the true probability).
Select all of column 'E' In the main menu bar, |
![]() |
![]() |
The first chart will do. Just click 'OK'. Note that the chart will the values in column 'B' are random ! |
Move the chart to a separate tab. Right-click on the chart On the pop-up menu, |
![]() |
![]() |
In the 'Move Chart' dialog box, Click the radio button for 'New sheet" and rename the new sheet to which |
We can tidy this graph up. In the 'Graph" sheet, |
![]() |
![]() |
In the 'Change Chart Type' dialog box, |
We are interested in values near 0.5. We should also rescale the horizontal axis A better title is needed. |
![]() |
![]() |
Double-click on the vertical axis. A new pane opens to the right of the worksheet. Change the numbers in the 'Bounds' boxes: Further down, expand 'Number', By double clicking on the other axis |
![]() |
Here is the result of another run.
Pressing 'F9' generates a new simulation.
The font size is much too small. Excel hides the method of Place the cursor on an axis value On the pop-up menu, select 'Font...' |
![]() |
![]() |
In the pop-up dialog box, adjust the font as you see fit. Repeat for the other axis and the title. |