For finite sets , the inclusion-exclusion principle statesIt counts each element once: an element in exactly of the sets contributes , by the binomial theorem.
For the cyclic digit run problem, let mean that the three digits starting at position form a run, for . Every run of length at least three contains one of these triples, so we need . Introduce the five differencesA starting digit and these five residues determine a unique string, including runs that cross and . In these coordinates requires or .
Each single event fixes two differences, with two choices of sign; the initial digit and the other three differences are free. Thus . For intersections of two events, adjacent starting positions force three consecutive differences to have the same sign, giving . There are three such pairs. The other three pairs have disjoint constrained difference positions, with independent signs and one free difference, giving each. Consequently the sum of pair-intersection sizes is .
For triple intersections, and each force four consecutive differences to have the same sign, leaving one free difference, and each has size . The other two triples, and , divide the five differences into two blocks with independent signs; each has size . The triple-intersection sum is therefore . Finally, all four events force all five differences to have the same sign, giving strings.
The inclusion-exclusion principle now gives the number of stringsUsing differences makes the overlap conditions explicit and prevents double-counting long cyclic digit runs.
Articles by others on the same topic
There are currently no matching articles.