Design: My program will: CREATE an empty histogram Read a series of DATA from some source (maybe Random.nextInt, maybe Scanner.nextInt...doesn't matter for this) ADD each datum to a HISTOGRAM DISPLAY the histogram at the console SAMPLE repeatedly from a probability distribution function proportional to the histogram ------------------------------------ Nouns (state): data, histogram Verbs (computation): display(), add(), sample(), create --> new/constructor ------------------------------------ Class structure: (group state into reusable components representing complete concepts) class Histogram - data - maybe some other stuff I'll discover as I implement - Histogram(?) - add(int value) - display() - int sample() class Program [later renamed to "Catan" to simulate 2d6 rolls] - main() - maybe some constants as state - nothing else, really! this just lets us put main() somewhere - main will use local variables of type Histogram and Random ------------------------------------ Key algorithm: sampling via the cumulative distribution function 1. Choose s = a random integer between 0 and the total number of samples 2. Iterate through the bins (array elements), decrementing s by the number of elements in that bin 3. When s <= 0, we're at the bin to choose: return its index There are other algorithms for performing this process more efficiently. I'm not worried about efficiency for this application, so I'm going to prefer the simplicity of this method.