You can just pull tokens out of a bag to generate a random sequence of virtually any length. Am I missing something? Why make it so complicated?