Simulation, Modeling, and Monte Carlo Methods in Archaeology

Keith Kintigh

Problem Set 4 Hints

First, if you are using arrays and having trouble, I think it would be well to do this problem set first without arrays. Problem Set 5 requires you to modify this week's program to use arrays and add some other bells and whistles.

Start this one by developing a conceptual structure for the program. One simple way to lay out the problem follows.

First create a variable for each value

int jarSherds=200, cookingPotSherds=100, ...

double jarProb=0.2, cookingPotProb=0.6...

int summerJars=3, winterJars=12...

int assemblageJar=0, assemblageCookingPot=0...

double assemblageJarPct...

prompt for number of weeks

prompt for season

operationalize a summer site, simulating each weeks breakage

if summer then

for week from 1 to numberOfWeeks

check to see if a jar breaks

for i=1 to summerjars

if Math.random<=jarProb then

assemblageJar=assemblageJar+jarsherds

check to see if each cooking pot breaks

for i=1 to summerCookingPots then

...

recalculate percentages in sherd assemblage

print the assemblage at the end of the week

similarly simulate each week's breakage at a winter site

if winter then

same structure but use winterJars etc.

You're done.