CSCI 3294 (Seminar: UNIX Power Tools), Fall 2018:
Homework 7

Credit:
20 points.

Reading

Be sure you have read, or at least skimmed, the readings for 10/10.

Programming Problems

This isn't exactly a programming problem, but I want your files by e-mail so I can confirm that they work on a semi-standard Linux system.

Submit your file(s) by sending mail to bmassing@cs.trinity.edu with each file as an attachment. Please use a subject line that mentions the course and the assignment (e.g., ``csci 3294 hw 7'' or ``UNIX hw 7'').

gnuplot

  1. (10 points) Use gnuplot to create a plot of one or more formulas.

    It's up to you what to plot, but if nothing more interesting occurs to you:

    You could do the kind of plot I often use in class to illustrate order of magnitude of functions, showing a few $ O(N^2)$ and $ O(N^3)$ functions (at least two of each) and specifying the x-range (starting at 0 and going up to whatever will make the plot meaningful).

    Turn in a .plotin file that will create your plot, putting the result in a PNG file.

  2. (10 points) Use gnuplot to create a plot of data.

    It's up to you what to plot, but if nothing more interesting occurs to you:

    A C program I used recently in CSCI 1312 estimates $ \pi$ using a so-called Monte Carlo method (comments in the program explain more):

    monte-carlo-pi.c

    The compiled program takes two command-line arguments, a number of samples and a seed for the random-number sequence. It prints the computed value and the difference between it and a library-computed value. Increasing numbers of samples should give better results, and different seeds should give somewhat different results.

    You could use this program several ways to generate and plot data:

    Try to use other things you've learned in this class to automate getting the program's output into a file you can use as data for gnuplot.

    Turn in a .plotin file that will create your plot, putting the result in a PNG file, and all data files it needs.

Honor Code Statement

Include the Honor Code pledge or just the word ``pledged'', plus at least one of the following about collaboration and help (as many as apply).1Text in italics is explanatory or something for you to fill in. For programming assignments, this should go in the body of the e-mail or in a plain-text file honor-code.txt (no word-processor files please).

Essay

Include a brief essay (a sentence or two is fine, though you can write as much as you like) telling me what about the assignment you found interesting, difficult, or otherwise noteworthy. For programming assignments, it should go in the body of the e-mail or in a plain-text file essay.txt (no word-processor files please).



Footnotes

... apply).1
Credit where credit is due: I based the wording of this list on a posting to a SIGCSE mailing list. SIGCSE is the ACM's Special Interest Group on CS Education.


Berna Massingill
2018-10-20