MathDB
The Number of pairs

Source: Korea Junior Mathematics Olympiad 2020 P3

November 22, 2020
combinatoricsKJMO

Problem Statement

The permutation σ\sigma consisting of four words A,B,C,DA,B,C,D has fAB(σ)f_{AB}(\sigma), the sum of the number of BB placed rightside of every AA. We can define fBC(σ)f_{BC}(\sigma),fCD(σ)f_{CD}(\sigma),fDA(σ)f_{DA}(\sigma) as the same way too. For example, σ=ACBDBACDCBAD\sigma=ACBDBACDCBAD, fAB(σ)=3+1+0=4f_{AB}(\sigma)=3+1+0=4, fBC(σ)=4f_{BC}(\sigma)=4,fCD(σ)=6f_{CD}(\sigma)=6, fDA(σ)=3f_{DA}(\sigma)=3 Find the maximal value of fAB(σ)+fBC(σ)+fCD(σ)+fDA(σ)f_{AB}(\sigma)+f_{BC}(\sigma)+f_{CD}(\sigma)+f_{DA}(\sigma), when σ\sigma consists of 20202020 letters for each A,B,C,DA,B,C,D