I have a large number of binary sequences of different lengths (time-series of observations of the occurrence (1) and non-occurence (0) of some thing) and I am wondering how I could find patterns that are common to these sequences. What I am interested in is
finding out whether the sequences are random in the sense that the thing occurring at one position is independent of its earlier (non-)occurrences
finding something like typical contours, that is, one or several sequences that are representative for the set. To elaborate, from exploring the data it looks like there is often a) a string of 0s first, then a string of 1s and then some alternating 1s and 0s or b) some alternating and then a string of 1s. This is what I would somehow like to extract or show statistically, though I have no clear idea how.
So how can I say these sequences are not random and they tend to look a certain way? For the first question (test for randomness), what I have thought of so far is to test for auto-correlation, to treat the sequences as a random walk, to compare conditional probabilities or maybe to add the preceding n observations as predictors in a logistic regression (a factor, e.g. for n=2 with levels (0,0), (0,1), (1,0) or (1,1)). For pattern-finding, I could define a similarity/distance measure (maybe hamming distance or pearson correlation) between the sequences and then do clustering? The biggest problem with that is that I don't know how to handle different lengths of the sequences.
Any ideas? I hope this question isn't too broad. I've never had a similar problem and I'm not sure how to tackle it.