Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → Transition Matrix
Transition Matrix
2011-07-22, 7:01 PM #1
Hey guys, I'm loathe to ask what I'm sure is a pretty dumb question, but my googling skills have failed me. I've got a long string of a limited number of words, and I want to create a transition matrix that tells me how frequently word A goes to word B. What's the easiest way to generate something like this?
2011-07-23, 1:28 AM #2
It's easy to see that you cannot do better than the naive solution. There are n words, and a simple left-to-right linear count will have a time complexity in Θ(n) if using a hash map to convert words into a matrix index (n.b. Θ(n) = Θ(cn) where c is the true mean number of letters per word in the superstring.) The easiest way to generate this matrix is to implement such an algorithm in a programming language.

↑ Up to the top!