I took a SAS programming class last week. SAS was invented in 1966 for the purpose of analyzing the data collected by the U.S. Department of Agriculture. The language developed proved to be so well suited for statistical processing that it's now used at 50,000 sites worldwide.
During the class, we covered the topic of arrays. Arrays, for those of you who are neither geeks nor mathematicians, are used for processing blocks of related data. For example, if you have sales figures by date and you want to calculate net profit for each quarter, you could write a program that says something like:
Quarter1_Net_Profit = Quarter1_Gross_Sales - Quarter1_Costs
Quarter2_Net_Profit = Quarter2_Gross_Sales - Quarter2_Costs
Quarter3_Net_Profit = Quarter3_Gross-Sales - Quarter3_Costs
Quarter4_Net_Profit = Quarter4_Gross_Sales - Quarter4_Costs
or you could put the data into an array and process it by performing this calculation 4 times, incrementing the value of the subscript (q) with each iteration:
Quarter_Net_Profit(q) = Quarter_Gross_Sales(q)- Quarter_Costs(q)
If you wanted to tally your profits by month within each quarter, you could set up a two-dimensional array:
Quarter_Net_Profit(q,m) = Quarter_Gross_Sales(q,m)- Quarter_Costs(q,m)
The way I've always pictured arrays in my head is like this:
A one-dimensional array is a list of things, like a single column in an Excel spreadsheet.
A two-dimensional array is rows and columns, like the periodic table.
A three-dimensional array is more like library stacks, with rows, columns and depth.
I suppose you could argue that the fourth dimension, which is time, would be that same set of stacks today versus tomorrow versus the day after.
Once you get to a fifth dimension, you're up, up and away from a stoned soul picnic, which, of course, is something else again.
And beyond that, you're into string theory.
Anyway, the class reminded me that I once worked with a woman who wrote a program that contained a nine-dimensional array.
She was building a report on student demographics: how many were freshmen vs. sophomores, male vs. female, black/white/Hispanic/Native American/ Asian/etc. and some other stuff I no longer recall. In total, the info fell into 9 categories.
So she set up an array that looked like this:
where "a" was either a 1 (freshman) or 2 (sophomore),
and "b" was either a 1 (male) or 2 (female),
and "c" was 1-6, for whatever race,
and you get the picture.
And while it makes perfect sense to me that if you set all the subscripts to the appropriate values and increment the Demographics_Count by 1, you'll wind up with exactly what you need, my brain cramps when I try to picture it.
Apparently it did the same thing to her, because soon after she left programming to become a meter-reader for the local electric company. There, she had all kinds of interesting adventures like:
a) Getting locked in the basement by four guys playing poker (scary, but they did let her out when she yelled)
b) Happening on a naked woman tied to a bed (yeah, it takes all kinds)
c) Having her calf ripped open by a German Shepherd
The last time I ran into her, she was working as a waitress in a steakhouse.
I'd love to know where she is and what she's doing today, because this was a woman who lived life in many dimensions.
How about you? How many dimensions are there to your life?