How do I recognize a know pattern in a sequence of numbers?
I have two known pattern like this: 1, 2, 3 and 1, 3, 2
I have a data set looking like this: 1, 1, 3, 1, 1, 2, 2, 1, 2, 2, 3, 3, 3
I need a function (mathmatical operation) that tells me, that this pattern is closer to 1, 2, 3 than to 1, 3, 2 as I want to have the focus on the sequence. The number of appearance doesn't matter and also noise is fine. I thought of convolution but I am not sure how to apply it and what to look for.