I have been told that this following will tell me what loop to use in my function within my program.......... does anyone have a clue - because I don't.
void PrintGenerations( int count, double AA, double AB, double BB );
I need help!
2007-03-20
13:58:45
·
5 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
This is what I have to do:
Write a program that calculates and displays proportions of different genotypes.
Suppose that initially the three genotypes AA, AB and BB appear in the proportions: x=1/4, y=1/2 and z=1/4, respectively. Suppose that individuals of type AA cannot reproduce. Then the probability that one parent will donate gene A to an offspring is: p = 0.5*(y/(y+z))
because y/(y+z) is the probability that the parent is of type AB and 1/2 is the probability that such a parent will donate gene A. The new proportions x, y and z of AA, AB and BB, respectively, in succeeding generation are given by:
x = p2, y = 2p (1-p) and z = (1-p)2.
Write a program to calculate and display the generation number and the proportions of AA, AB and BB genotypes for a given number of generations. in a table :
---------------------------------------
Generation AA AB BB
---------------------------------------
1 0.2500 0.5000 0.2500
2 0.11
2007-03-20
14:15:19 ·
update #1