Solution of a Mathematical Problem Connected with the Theory of Heredity