Docsity

Solved Problems on Simulation in Introduction to Statistics | MATH 102, Assignments of Statistics

Toggle sidebar
bg1
Classroom Exercises — Simulations
Reminder: We have chosen to use Excel because it is easily available on campus and because the data
is easily visible on the screen as you use it. But it has errors (different versions have different errors)
in its statistical functions, so for any serious purpose we urge you to learn and use a real statistical
package, such as SPSS, SAS, Minitab, etc., etc.
Exercise A:
1. Create 10 random numbers between one and ten with a uniform distribution.
[To create random integers of this type, use =RANDBETWEEN(1,10) . If your computer does not
recognize the RANDBETWEEN command, use “Tools→Add-Ins” to add the Analysis Toolpaks,
probably first and second in the list of available toolpaks. If this does not work, the following
formula will have the same effect: =TRUNC(10*RAND())+1 ]
2. Find the average and standard deviation of the numbers.
3. Use the FREQUENCY command to find out how many are within one SD of the average. [Create a
column with the edges of the “bins” you wish to sort the random numbers into — the first bin might
end at the average minus the SD and the second at the average plus the SD — then highlight the
cells to the right of your “bin range”, plus one more below, and (assuming your random numbers
are in A1 through A10 and your bin range is B1 through B2) type =FREQUENCY(A1:A10,B1:B2) ,
then, while holding down the Control and Shift keys, type Enter.]
4. Check your results by counting by hand.
5. For 1000 random numbers, find out how many are within one SD of the average.
6. Does this match what we expect for a normal distribution?
Exercise B:
1. Simulate two people picking numbers 1, 2 or 3. [Use =RANDBETWEEN(1,3) in two columns.] If
they match, person A wins. If they do not match, person B wins. With 100 games in a single
spreadsheet, determine how many times A wins.
[Use =IF(A1=B1,1,0) to determine whether A won, then sum the column to see how many times.]
Exercise C:
1. Simulate 50 coins being tossed and count how many times a head comes up.
[Use =IF(RAND()>.5,1,0) or =RANDBETWEEN(0,1) to flip a fair coin. Create a single column
with 50 cells, one for each flip of a coin. Label a cell above or below the data for the number of
heads. Sum the column to find the number of heads.]
2. Set up 30 of these simulations in a single spreadsheet.
[Copy the column thirty times. Remember to copy the row with the sum, too.]
3. Determine how many simulations have (a) 10 or fewer heads, (b) 40 or more heads, and (c) more
than half heads.
[Below or above or to the side of the data, create a list of “bin” edges — 10, 25, 39 — to help you
count the requested values. The input data should be the number of heads on each simulation (a
row of thirty numbers). The bin range is wherever you entered the 10, 25, 39.]

Partial preview of the text

Download Solved Problems on Simulation in Introduction to Statistics | MATH 102 and more Assignments Statistics in PDF only on Docsity!

Classroom Exercises — Simulations

Reminder: We have chosen to use Excel because it is easily available on campus and because the data is easily visible on the screen as you use it. But it has errors (different versions have different errors) in its statistical functions, so for any serious purpose we urge you to learn and use a real statistical package, such as SPSS, SAS, Minitab, etc., etc.

Exercise A:

  1. Create 10 random numbers between one and ten with a uniform distribution. [To create random integers of this type, use =RANDBETWEEN(1,10). If your computer does not recognize the RANDBETWEEN command, use “Tools→Add-Ins” to add the Analysis Toolpaks, probably first and second in the list of available toolpaks. If this does not work, the following formula will have the same effect: =TRUNC(10*RAND())+1 ]
  2. Find the average and standard deviation of the numbers.
  3. Use the FREQUENCY command to find out how many are within one SD of the average. [Create a column with the edges of the “bins” you wish to sort the random numbers into — the first bin might end at the average minus the SD and the second at the average plus the SD — then highlight the cells to the right of your “bin range”, plus one more below, and (assuming your random numbers are in A1 through A10 and your bin range is B1 through B2) type =FREQUENCY(A1:A10,B1:B2) , then, while holding down the Control and Shift keys, type Enter.]
  4. Check your results by counting by hand.
  5. For 1000 random numbers, find out how many are within one SD of the average.
  6. Does this match what we expect for a normal distribution?

Exercise B:

  1. Simulate two people picking numbers 1, 2 or 3. [Use =RANDBETWEEN(1,3) in two columns.] If they match, person A wins. If they do not match, person B wins. With 100 games in a single spreadsheet, determine how many times A wins. [Use =IF(A1=B1,1,0) to determine whether A won, then sum the column to see how many times.]

Exercise C:

  1. Simulate 50 coins being tossed and count how many times a head comes up. [Use =IF(RAND()>.5,1,0) or =RANDBETWEEN(0,1) to flip a fair coin. Create a single column with 50 cells, one for each flip of a coin. Label a cell above or below the data for the number of heads. Sum the column to find the number of heads.]
  2. Set up 30 of these simulations in a single spreadsheet. [Copy the column thirty times. Remember to copy the row with the sum, too.]
  3. Determine how many simulations have (a) 10 or fewer heads, (b) 40 or more heads, and (c) more than half heads. [Below or above or to the side of the data, create a list of “bin” edges — 10, 25, 39 — to help you count the requested values. The input data should be the number of heads on each simulation (a row of thirty numbers). The bin range is wherever you entered the 10, 25, 39.]