Problem

Source: 2022 IZHO P2, https://izho.kz/contest/problems/

Tags: combinatorics



A ten-level $2$-tree is drawn in the plane: a vertex $A_1$ is marked, it is connected by segments with two vertices $B_1$ and $B_2$, each of $B_1$ and $B_2$ is connected by segments with two of the four vertices $C_1, C_2, C_3, C_4$ (each $C_i$ is connected with one $B_j$ exactly); and so on, up to $512$ vertices $J_1, \ldots, J_{512}$. Each of the vertices $J_1, \ldots, J_{512}$ is coloured blue or golden. Consider all permutations $f$ of the vertices of this tree, such that (i) if $X$ and $Y$ are connected with a segment, then so are $f(X)$ and $f(Y)$, and (ii) if $X$ is coloured, then $f(X)$ has the same colour. Find the maximum $M$ such that there are at least $M$ permutations with these properties, regardless of the colouring.