Created
January 16, 2015 03:15
-
-
Save amonshiz/3a352b0e0abd6534f799 to your computer and use it in GitHub Desktop.
Introduction to Mendelian Inheritance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mendelsFirstLaw :: Float -> Float -> Float -> Float | |
mendelsFirstLaw k m n = ((k**2 - k) + (2.0 * k * m) + (2.0 * k * n) + (m * n) + (0.75 * (m**2 - m))) / ((k + m + n) * (k + m + n - 1)) | |
main = do | |
k <- getLine | |
m <- getLine | |
n <- getLine | |
putStrLn . show $ mendelsFirstLaw (read k :: Float) (read m :: Float) (read n :: Float) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment