Identifying the behavior patterns is the main goal for a dynamical system. It provides the useful information in behavior prediction of a dynamical system. On the other hand, measuring the orderliness of a dynamical system improves the prediction of behavior patterns. In this study, substitution sequences are used to model the long-term correlation of a dynamical system and evaluate the degree of randomness, where the degree of homogeneity is evaluated by the spanning tree invariant. The results show that the more contiguous patterns the sequence has, the smaller the value of the spanning tree invariant is. In fact, the spanning tree invariant can be an effective tool to measure the orderliness of sequences by comparing the computed value with the value of one.