Olympiad in Informatics

Inversion Basics

Definition

If we know that \(\{ f_n \}, \{ g_n \}\) satisfy this relation:

\[ f_n = \sum_{i = 0}^n a_{ni} g_i \]

then we can use the known values of \(f_0, f_1, \dots, f_n\) to compute \(g_n\):

\[ g_n = \sum_{i = 0}^n b_{ni} f_i \]

This way of computing values is called inversion.

The Inversion Condition

First we write out the formula above:

\[ \begin{aligned} g_n &= \sum_{i = 0}^n b_{ni} f_i \\ &= \sum_{i = 0}^n b_{ni} \sum_{j = 0}^i a_{ij} g_j \\ &= \sum_{i = 0}^n b_{ni} \sum_{j = 0}^n a_{ij} g_j [j \leq i] \\ &= \sum_{i = 0}^n g_i \sum_{j = i}^n a_{ji} b_{nj} \end{aligned} \]

Quite clearly, we can see that the inversion holds if and only if:

\[ \sum_{j = i}^n a_{ji} b_{nj} = [i = n] \]

This is the condition for inversion.