Foundations of Mathematical Genetics