Original programming, combinatorial, and geometric schemes are presented. They have been developed and used by the authors to calculate exact analytical formulas that describe the probability of the formation of local groups of a given size in random point images. Formulas, which will be discussed below, arise in the assessment of the reliability detection of point images, when they are detected by scanning the aperture that has a limited number of thresholds. In this paper, significant attention is paid to the formulation and solution of difficult combinatorial problems that have been encountered in the course of the investigation and that are associated with new generalization of the Catalan numbers.