X chromosome inactivation (XCI) is the phenomenon occurring in female mammals whereby dosage compensation of\ud X-linked genes is obtained by transcriptional silencing of one of their two X chromosomes, randomly chosen during\ud early embryo development. The earliest steps of random X-inactivation, involving counting of the X chromosomes and\ud choice of the active and inactive X, are still not understood. To explain "counting and choice," the longstanding\ud hypothesis is that a molecular complex, a "blocking factor" (BF), exists. The BF is present in a single copy and can\ud randomly bind to just one X per cell which is protected from inactivation, as the second X is inactivated by default. In\ud such a picture, the missing crucial step is to explain how the molecular complex is self-assembled, why only one is\ud formed, and how it binds only one X. We answer these questions within the framework of a schematic Statistical\ud Physics model, investigated by Monte Carlo computer simulations. We show that a single complex is assembled as a\ud result of a thermodynamic process relying on a phase transition occurring in the system which spontaneously breaks\ud the symmetry between the X’s. We discuss, then, the BF interaction with X chromosomes. The thermodynamics of the\ud mechanism that directs the two chromosomes to opposite fates could be, thus, clarified. The insights on the selfassembling\ud and X binding properties of the BF are used to derive a quantitative scenario of biological implications\ud describing current experimental evidences on "counting and choice.