How to choose from random patterns of varying lengths?

This post has been moved here: How to randomly choose from patterns of varying lengths?