CS 270 Computer Stat. Tech. Spring 1998
Assignment Projects Walpole, Myers, & Myers [1998]
Please construct, code, and debug the programs for the following
projects. On each output for each run handed in, include NAME, STUDENT
ID., Prof. Name,"CS270", and "Spring 1998" in the program's comments.
All input should be echoed in the output (ie. print the input
after it is read in.) Your program should have comments documenting the
code adequately (about one comment every five to ten lines, except where
more may be required.) NO PARTIAL CREDIT will be given for programs that
do not compute and output correct results. Programs should operate with
the prescribed algorithm or method described in the problem set below.
Do not store the answer in an array and just directly print it out.
Grades will be determined by correctness of output and adherence to
description of the problem in the program. Only hardcopy outputs from
the computer will be accepted. Best wishs! Use C/C++ and SAS as
prescribed. Indent properly.
Project 1 : Simple Statistical Parameters (1 point)
-----------
Write a C/C++ program which computes and prints the results for
Walpole, Myers, & Myers [1998], Chapter 1, page 9, problem #2.
Project 2 : Probabilistic Tree Diagram Computation (4 points)
-----------
Elmer Fudd is hunting wabbits. He has twelve hours of sunlight.
At each hour, he may either hunt ('H') for wabbits, rest ('W'), or
study ('S') for a quiz in CS 270. He may hunt upto three
consecutive hours, at which time he must rest or study to recooperate.
He must have at least one hour to study so he will pass the quiz;
if near the end of the day he has not studied, the last hour is study.
In the first hour of hunting, Fudd can guarentee 1 rabbit. In the
second hour, his weaken condition guarentees only 2/3 of a rabbit
(expectation). A third hour hunting can only result in 1/3 of a rabbit.
Resting and studying catches no rabbits. Prior to his twelve hour day,
Fudd rested. Assume that the probability of going from one state
to another is expressed in the following table (really, an Markov Ch..)
H W S
Prev. H 0.5 0.25 0.25
State W 0.75 0.20 0.05
S 0.6 0.3 0.1
Using "long double" for all real computations, write a C/C++ program
to compute the expected number of rabbits after hunting:
1 hour
2 hours
...
12 hours
It must have a main() and a recursive function hour_do()
Project 3 : Simple SAS Empirical Distribution Prog (2 point)
-----------
Write an SAS program which reads the file: 'ls-lRno'
using the the SAS command: infile 'ls-lRno'.
You may download the data file from:
Enterprise Root ls-lRno
SAS must compute the average file size (Mean), the standard
deviation, and a distribution plot (size vs probability/frequency)
as a bar chart. What can you conclude about file sizes on our
sample UNIX system?
Project 4 : Simple Linear Regression in C or SAS (4 point)
-----------
Write an SAS or C program which computes the simple linear
regression (using the least squares method) for page 363
problem 1 and then applies the analysis of problem 3 on page
375. Your program must compute and print all values needed
and print a conclusion.
Project 5 : Random Walk
-----------
Write a C/C++ program which computes random walks in one dimension.
Formulate a table of simulated results for 10, 100, 1000,
... 1000000000 (one billion) for the distance of the final
position, using -1 and +1 as the exact and only discrete values of
the walk. What does the data plot look like? Print all plots
of dist vs P(dist). What do you conclude? Can you find any
literature to support your conclusions?