We describe how the multifractal analysis of dynamical systems can be used to compute the Hausdorff dimension of a large class of sets in the real line, defined in terms of relations between the frequencies of digits in some integer base. As an illustration we compute the Hausdorff dimension of a class of sets in [0,1] that are defined in terms of linear or quadratic relations between the frequencies of digits. Although these relations are only prototypes of more general ones, the computations follow the same procedure and are already rather involved.