MathDB
2021 Combo Div 2 P2

Source:

March 2, 2021
combinatorics

Problem Statement

Dilhan has objects of 33 types, AA, BB, and CC, and 66 functions fA,B,fA,C,fB,A,fB,C,fC,A,fC,Bf_{A,B},f_{A,C},f_{B,A},f_{B,C},f_{C,A},f_{C,B}where fX,Yf_{X,Y} takes in an object of type XX and outputs an object of type YY. Dilhan wants to compose his 66 functions, without repeats, such that the resulting expression is well-typed, meaning an object can be taken in by the first function, and the resulting output can then be taken in by the second function, and so on. In how many orders can he compose his 66 functions, satisfying this constraint?
Proposed by Adam Bertelli