How to find the probabilities of certain events occurring in a defined sequence?
My answer is inspired by this question in Code Review SE

import random
import string
from collections import Counter

def test_data(n, m, choices):
    return [[random.choice(choices) for _ in range(m)] for _ in range(n)]

data = test_data(50000, 9, ["A", "B", "C", "D", "E", "F"])

def subsequence_counts(sequences):
    return Counter([seq for seq in map(''.join, sequences)])

counter = subsequence_counts(data)

print(counter['BCEEECFAF'])


What the above code does:

1) The test_data function, creates a n lists with m items using elements of the choices parameters.

In specific, we create 50000 lists with 9 items length using the capital letters A, B, C, D, E, F

This is just for testing the code

2) The function subsequence_counts uses a list comprehension and a Counter to keep track of every single combination of the sublists we have. 

3) Finally, you can access the Counter and get the frequency of any event you want.