What makes a pattern in a sequence?

1.8k Views Asked by At

Assume a stream of characters$(c)$ where $ c \in (A, B, C ... Z)$.

I need to identify patterns available in the stream. As per the definition of a pattern I should be looking for a recurring string.

For example if the stream observed thus far is:

$$A\space B\space A\space S\space Y\space K\space I\space A\space B\space L\space J\space L\space B\space C\space L\space K\space I\space P\space I\space B\space C\space A\space B\space A\space B\space A\space B\space A\space B\space $$

By observation it can be observed that the string $AB$ appears 6 times whilst $BC$ appears 2 times.

My questions are as follows:

  1. Apart from repetition are there any conditions that a string should suffice in order to be considered a pattern
  2. If repetition is the only factor how many times a string should appear on the stream to be legitimately considered a pattern? Is there any mathematical logic in deciding this factor. (As per my understanding it has to be at least 2 since a single character itself could not be considered a pattern in this case. A single character could also be a pattern if it appears in a fixed interval however, I'm only focused on the string make up at this point.)