Based on your statement in the CB that this is *not* homework -- A little more information is needed:
A simple tabulation to produce the top 100 is a different beast from from a 'word by word matrix' (correlation frequencies?).
How are you getting these words -- from a document (in which case the correlation matrix idea makes sense), or from a file (and if it's one work per line, sort() and uniq() are your fields).
----
I Go Back to Sleep, Now.
OGB
Comment on Re: a question about making a word frequency matrix