Maths Olympiad Prep

Library / /36 of 37

Combinatorics Difficulty 7.0 National Olympiad Prove it Italy

Problem:

Given a string of digits 0 and 1, Giacomo would like to divide it into blocks of 2 or 3 consecutive digits so as to satisfy one of the following two conditions:
(1) in every block, every (possible) digit 0 appears to the left of every (possible) digit 1. The allowed blocks are namely 00,01,11,000,001,011,11100,01,11,000,001,011,111;
(2) in every block, every (possible) digit 0 appears to the right of every (possible) digit 1. The allowed blocks are namely 00,10,11,000,100,110,11100,10,11,000,100,110,111.
For example, for the string 011011 the subdivision 01101101|10|11 does not work, because the blocks are neither all of type (1), nor all of type (2). The subdivision 011|011 instead works, because all the blocks are of type (1).

a. Let m,nm, n be integers greater than or equal to 0, with m+n2m+n \geq 2. Prove that the string consisting of mm digits 0 followed by nn digits 1 can be divided into blocks as claimed by Giacomo.

b. Let l4l \geq 4 be an integer. Prove that the number of strings of digits 0 and 1 of length ll for which Giacomo cannot carry out a subdivision as above is 2l32^{l-3}.

Solution

Solution:

a. Note that, however the string is subdivided, the blocks will all be of the first type: indeed, in the given string all the 11's are to the right of all the 00's. Moreover, there exists at least one subdivision of the string into blocks of 2 or 3 digits: if m+nm+n is even, we can subdivide the string into blocks all of size 2; if it is odd, we can subdivide it into one block of size 3 and the rest into blocks of size 2.

b. First of all we prove that if a string begins with the digit 11 and ends with a number of digits 0 different from one (that is, the last two digits are not 1010), then there exists an admissible subdivision of the string: consider a string of this type and subdivide it into substrings of the form 00110\ldots 01\ldots 1 (where in each one there appear a positive number of digits 0 and of digits 1), plus possibly a final substring consisting only of digits 0 (if there are such trailing zeros, then there are at least two of them, by the hypothesis on the string).

Since all these substrings, except possibly the last one, contain both 0 and 1, they have in particular at least two digits. On the other hand, the possible final string containing only digits 0 will have, by hypothesis, at least two digits. By point a), each of these substrings with at least 2 digits can be subdivided into blocks of the first type.

We have thus shown that we know how to subdivide into blocks of the first type all the strings that begin with 1 and do not end with 10. It is shown in an analogous way that one can subdivide the strings that begin with 0 and that do not end with 01.

Now consider a string ss that begins with 0 and ends with 10. If we read it from right to left, we obtain a new string ss' that begins with 01 and ends with 0. If ss does not begin with 01, then ss' does not end with 10, and by the same reasoning as before we can decompose ss' into blocks of the first type. Reading the decomposition backwards we obtain a decomposition into blocks of the second type for ss.

So the only strings that we do not yet know how to decompose into blocks are those that begin with 01 and end with 10 (and those that begin with 10 and end with 01). However, in this case the first block of any possible decomposition would necessarily be of the first type, while the last one would necessarily be of the second type, which means that a subdivision as requested by Giacomo does not exist.

The strings of length ll that begin with 0 for which there is no admissible decomposition are therefore those that begin with 01 and end with 10, and there are therefore 2l42^{l-4} of them. By symmetry, the strings of length ll that begin with 1 for which there is no admissible subdivision are just as many, and so in total we obtain 2l32^{l-3} strings that do not admit a valid subdivision.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement translated into English from it; metadata (topic, difficulty) added by this project.