

This captures the multiples of three, or at least the first ten that I tested.

These boil down to the two RE sequences: ST0 -> ST0 : 0+ What you have to do is allow for any of the transition sequences that can get from ST0 to ST0 then just repeat them: However, given that there can be an arbitrary number of sub-expressions (and sub-sub-expressions), it does not lend itself easily to reduction to a regular expression. This idea is that, at the end, you need to finish up in state ST0.
#BINARY SEQUENCES DEFINITION PLUS#
The transitions for that are: ST0 -> ST1 (3n * 2 + 1 = 3*2n + 1, a multiple of three, plus 1). ST2 -> ST1 ((3n+2) * 2 = 3*2n + 4 = 3*(2n+1) + 1, a multiple of three, plus 1).Īlso think of any non-negative number, multiply it by two then add one (tack a binary one on to the end). The transitions for that are: ST0 -> ST0 (3n * 2 = 3 * 2n, still a multiple of three). Now think of any non-negative number (that's our domain) and multiply it by two (tack a binary zero on to the end). Thus, ( T) is the sum of the probabilities of ( - 1, + 1) -binary n -sequences for which the respective product equals + 1 minus the sum of the. The moment ( T) equals the expectation of the product of the digits indexed by the elements of T T U. ST1, multiple of 3 plus 1 (1, 4, 7, 10. Index the digits of ( - 1, + 1) -binary n -sequences from 1 to n.This can be done by an automaton with the three states: What you're aiming at is to ensure the remainder is 0, hence a multiple of three. When you divide a number by three, there are only three possible remainders (0, 1 and 2).
