Saint Louis University |
Computer Science 146
|
Dept. of Math & Computer Science |
Topic: Random Walks
Due:
11:59pm Sunday, September 8
Related Reading: Pages 6-12 of case study
Please make sure you adhere to the policies on academic integrity.
We will be using our own revision of the source code originally provided with the AP case study (in particular, we will be using the standard C++ string and vector classes, rather than the custom "apstring" and "apvector" classes used in the original case study).
If you are working on turing, you may get your own copy of the required source code for part I of the case study by directly copying our version. Begin by opening a console window.
To put everything related to CSCI 146 in a single directory, begin by executing the following commmands
mkdir csci146
cd csci146
Now, you can copy the source code for part I by executing the
following command (Note well the period at the period at the end of
the command):
cp -Rp /Public/goldwasser/146/partI .
This will cause a new folder named partI to appear in your
working directory including all files that you need for this
assignment.
Note: if you have a C++ compiler on your personal computer and wish to
work directly on that computer, the necessary files may be downloaded
here as
partI.zip.
Our distribution of the source code includes a special file named makefile that assists in compiling the various programs in this project. To compile or recompile the entire project, simply execute the command
make
from within the partI directory in your account. For
part I, this results in three separate executable programs:
Once a program is compiled, you may execute it from the project directory with a command such as
./sixflips
to run the sixflips program.
Note: If you make any modifications to the source code, you will need to recompile the program before reexecuting it.
You are to go through pages 6-12 of the case study, answering all exercises, and performing all interactive experiments described. Specifically, you are to provide responses to:
Please create one summary document with a prose description of all activities, and answers to any questions that were posed. In addition, please submit a new file dicetest.cpp with your code from Exercise 1 on page 11, and your revised onewalk.cpp file based upon the modification in Exercise 4 of page 12.
Note: our original makefile does not include instructions for compiling the dicetest.cpp program requested from Exercise 1 on page 11. You can compile that directly with the command
g++ -o dicetest dicetest.cpp randgen.o
Your assignment should be submitted electronically (details on the submission process). This includes one summary document, and two pieces of source code (dicetest.cpp and modified onewalk.cpp).