A primitive string is not expressible as a concatenation of several identical smaller strings, for instance 110110 is not primitive, but 1011 is.
How many bit strings of length 12 are primitive?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Let's compute the number of non-primitive strings first.
There are 2 6 strings which can be divided into two equal parts, such as 101100101100, 100100100100, 010101010101, and 111111111111.
There are 2 4 more strings which can be divided into three equal parts, such as 110011001100, 101110111011, 010101010101, and 111111111111.
However, 2 2 of these strings actually count the same strings, those that can be divided into six equal parts, such as 010101010101 and 111111111111 above.
Thus, by Principle of Inclusion-Exclusion, there are 2 6 + 2 4 − 2 2 = 7 6 non-primitive strings. None of the remaining strings can be non-primitive, since the length of the string is 1 2 and the number of parts must thus be a divisor of 1 2 , which thus must have either 2 or 3 as a prime factor and thus is counted above.
There are 2 1 2 bit strings in total. Thus, by complementary counting, there are 2 1 2 − 7 6 = 4 0 2 0 primitive strings.
Problem Loading...
Note Loading...
Set Loading...
In order for a bit string to repeatedly concatenate to another string of length n, the length of the string must be a proper divisor of n. We can develop a recurrence relation for the number of primitive strings: F ( n ) = 2 n − ∑ F ( d ) for each proper divisor d of n. Calculating only the values we need we get F ( 1 ) = 2 1 F ( 2 ) = 2 2 − F ( 1 ) = 2 F ( 3 ) = 2 3 − F ( 2 ) − F ( 1 ) = 6 F ( 4 ) = 2 4 − F ( 2 ) − F ( 1 ) = 1 2 F ( 6 ) = 2 6 − F ( 3 ) − F ( 2 ) − F ( 1 ) = 5 4 F ( 1 2 ) = 2 1 2 − F ( 6 ) − F ( 4 ) − F ( 3 ) − F ( 2 ) − F ( 1 ) = 4 0 2 0