П. В. Бибиков, тренер сборной Москвы на Всероссийской олимпиаде школьников по математике, предлагает вам решить следующую задачу: Дан клетчатый прямоугольник 2m × 2n, разбитый произвольным образом на доминошки 2 × 1. Если две доминошки образуют квадрат 2 × 2, разрешается повернуть их обе на 90° (сделать флип). Наша цель — последовательностью флипов сделать все доминошки горизонтальными (кирпичная кладка) за как можно меньшее количество операций.
Раскрасим наш прямоугольник в шахматную раскраску, считая левый нижний угол черным. Направим по сторонам квадратиков стрелочки так, чтобы черные квадратики обходились бы против часовой стрелки, а белые — по часовой стрелке.
Пусть нам дано некоторое замощение прямоугольника доминошками, которое мы обозначим через T. Сопоставим замощению его функцию высоты — это будет функция на вершинах клеток нашего прямоугольника, которую мы будем обозначать HT(υ). Определим ее следующим образом.
Выберем левую нижнюю вершину υ0 прямоугольника и положим ее высоту равной нулю; далее, каждую вершину υ соединим с υ0 путем, который проходит по линиям сетки и не пересекает доминошек. Этот путь состоит из стрелок, каждая из которых проходится либо в попутном направлении (т. е. сонаправлена с путем), либо в противоположном. Положим высоту HT(υ) равной разности числа попутных и противоположно направленных стрелок.
Пусть H(υ) — функция на вершинах графа G, удовлетворяющая следующему свойству: для любых соседних вершин u и υ, ребро между которыми направлено от u к υ, либо либо
Докажите, что H(υ) является функцией высоты единственного замощения T.
P. Bibikov, coach of the Moscow team at the All-Russian Olympiad in mathematics, suggests you the
following problem:
There is a checkered rectangle 2m × 2n given, arbitrarily divided into rectangles 2 × 1 («dominoes»). If two dominoes form a 2 × 2 square, it is allowed to rotate them both by 90° (make a flip). Our goal is to make all dominoes horizontal (brickwork) by a sequence of flips in as few operations as possible.
Let’s color our rectangle in a chessboard color, assuming the bottom left corner to be black. Let’s draw the arrows along the sides of the squares so that the black squares go counterclockwise, and the white ones go clockwise.
Let us be given some tiling of a rectangle with dominoes, which we denote by T. Let us associate the tiling with its height function — it will be the function at the vertices of the cells of our rectangle, which we will denote by HT(υ). We define it as follows. Select the lower left vertex of the υ0 rectangle and set its height to zero; further, each vertex υ is connected to υ0 by a path that passes along the grid lines and does not intersect the dominoes. This path consists of arrows, each of which is traversed either in the same direction (i. e., co-directed with the path), or in the opposite direction. Let the height of HT(υ) be equal to the difference in the number of trailing and oppositely directed arrows.
Let H(υ) be a function on the vertices of the graph G satisfying the following property: for any connected vertices u and υ, the edge between which is directed from u to υ there is or
Prove that H(υ) is a function of the height of the unique tiling T.
Единственность следует из такого простого соображения. Рассмотрим те ребра, разность функций высоты на концах которых равна единице. Эти ребра будут образовывать границы доминошек нашего разбиения; напротив, те ребра, разность функций высоты на концах которых равна минус трем, будут «закрыты» доминошками.
Далее, рассмотрим какую-нибудь клетку. Все стрелки на ее границе направлены в одном направлении: либо по часовой стрелке, либо против. Поскольку сумма приращений функции высоты при обходе этой клетки равна нулю, это значит, что существует ровно три ребра из четырех, для которых разность значений функции высоты на их концах равна единице, и одно ребро, для которого эта разность равна минус трем; оно и будет закрыто доминошкой. То же самое можно будет сказать и про клетку, смежную с данной по этому ребру. Тем самым все клетки окажутся разбитыми на пары, то есть в итоге действительно получится замощение нашего прямоугольника.
Uniqueness follows from such a simple consideration. Consider those edges, the difference of the height functions at the ends of which is equal to one. These edges will form the boundaries of the dominoes of our tiling; on the contrary, those edges, the difference of the height functions at the ends of which is equal to minus three, will be «closed by dominoes.
Next, consider a cell. All arrows on its border point in the same direction: either clockwise or counterclockwise. Since the sum of the increments of the height function when traversing this cell is equal to zero, this means that there are exactly three edges out of four for whichthe difference in the valuesof the height function at their ends is equal to one, and one edge for which this difference is equal to minus three; it will be closed by the domino. The same can be said about the cell adjacent to the given one along this edge. Thus, all the cells will be divided into pairs, that is, in the end, we really get a tiling of our rectangle.

