2022 SSMO Team Round Problems/Problem 2
Problem
Consider marbles in a line, where the color of each marble is either black or white and is randomly chosen. Define the period of a lineup of 8 marbles to be the length of the smallest lineup of marbles such that if we consider the infinite repeating sequence of marbles formed by repeating that lineup, the original lineup of 8 marbles can be found within that sequence.
A good ordering of these marbles is defined to be an ordering such that the period of the ordering is at most . For example, is a good ordering because we may consider the lineup , which has a length equal to If the probability that the marbles form a good ordering can be expressed as where and are relatively prime positive integers, find