Language Level: | Beginning Student |
Teachpacks: | baseball.ss |
Download the following file onto your computer.
baseball.ss
This teachpack defines two constants:
weights-1950s
, a list of numbers representing the weights in pounds of all baseball players who made their major league debut in the nineteen-fiftiesweights-1900s
, a list of numbers representing the weights in pounds of all baseball players who made their major league debut in the nineteen-ninetiesLoad this teachpack into DrScheme (using the Language > Add Teachpack … menu).
Write Scheme definitions for count
(which should answer the number of elements in a list), sum
, mean
,
variance
and stdev
(standard deviation). Provide contracts, purposes and test cases for each. These test cases should be small enough that you can check the result by hand.
Statisticians have various ways of defining variance and standard deviation. For this homework, please adhere to the following definitions:
Once all of your functions are working properly, use them to analyze the baseball data. Your results should correspond to the numbers in the Benchmarks section below.
Write median
, and test it.
To make sure your numbers are not way off base, here are a few ballpark figures to check against your results:
Put your names as a comment at the top of the definitions window. Save your file from DrScheme, attach it to an email message. In addition, put the names of both partners in the body of the email and in the name of the file. Submit your email to CS199Homework