I saw something interesting about text-analysis - bigrams - in Basic Text Analysis in Mathematica
I wondered how the bigrams of Pi's digits might appear. As expected, take enough terms and every integer in the range 0-9 has been followed by every other number (including itself).
Here's my code -- I'm sure it can be improved, but that's my second question:
t = Table[ edgeList = Map[#[[1]] -> #[[2]] &, Partition[First[RealDigits[N[π, J]]], 2, 1]]; g = Graph[Union[edgeList], VertexLabels -> "Name"]; am = AdjacencyMatrix[g]; Total[am, 2], {J, 2, 600} ]; ListLinePlot[t] t The idea here is that the total of the adjacency matrix of the bigram graph tells you when you've looked at enough of Pi's digits for every single-digit integer to have been followed by every single digit integer.
The problem I have found in the result (looking at ListLinePlot[t], and then inspecting the sequence of Total[AdjMat, 2]) is that the plot isn't monotonic. I have to think that there's something I've done/omitted in the code, but no matter how hard I look I can't see it.
Can anyone see the problem that causes incorrectness of results?

