Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.)
share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.