Chip Reynolds
1994 Woodrow Wilson Biology Institute
This program will quiz students on their ability to solve mathematical problems dealing with the Hardy-Weinberg principle. There are 7 basic types of Hardy-Weinberg Problems which are randomly chosen by the program. A student may think that he or she is getting the same problem, but the program does try to 'mix' the 7 problem types and does try to insert different numbers into the problems. The program will keep track of the number of problems attempted, the number of problems missed on the first attempt, and the percentage of problems correctly answered on the first attempt.
The teacher may type the program, word for word, line for line, punctuation mark for punctuation mark, into the computer. If one chooses to use this method, it is very important that no mistakes are made in typing the program into the computer. In order to type in this program, the following steps must be followed.
Alternatively to METHOD #1, the teacher may send me a blank 3.5" diskette formatted for IBM. I shall load the program on the blank disk and return it. Please be certain to include your return address if you choose to use this method of obtaining this program. My address is given in program lines 40 through 70 in the program listing appearing below this paragraph. Upon receipt of the diskette from me, go to step 'f' in METHOD #1 (above) in order to RUN the program.
10 CLS
20 PRINT ' HARDY-WEINBERG PROBLEMS TUTORIAL'
30 PRINT ' written by'
40 PRINT ' Robert W. Reynolds'
50 PRINT ' The Casady Schools'
60 PRINT ' 9500 North Pennsylvania Avenue'
70 PRINT ' Oklahoma City, Oklahoma 73120'
80 PRINT : PRINT : PRINT : PRINT : INPUT 'Push <ENTER> to continue.'; z$
83 CLS : PRINT : PRINT : PRINT : PRINT
84 PRINT 'Throughout this tutorial, remember to push <ENTER> after'
85 PRINT 'having entered your answer. Also, to leave the program, push'
87 PRINT 'simultaneously the CTRL button and the BREAK button.'
88 PRINT 'Then, choose FILE in the upper left hand corner of the screen and'
89 INPUT 'make the correct choices. Press <ENTER> to continue.'; z$: CLS
90 PRINT 'Welcome to the HARDY-WEINBERG PROBLEM TUTORIAL. You should'
100 PRINT 'have a pencil and paper and a calculator that can do square root.'
110 PRINT 'You should be quite familiar with the HARDY-WEINBERG equilibrium'
120 PRINT 'concepts and the following HARDY-WEINBERG equations:'
130 PRINT : PRINT 'p + q = 1 and pp + 2pq + qq = 1'
140 PRINT : PRINT : PRINT 'If you do not have a working knowledge of these 2'
150 PRINT 'equations, ask your teacher for some advice on where to read about'
160 PRINT 'them. It may be unwise for you to continue this tutorial.'
170 PRINT : PRINT : INPUT 'push <q> to quit or <c> to continue.'; y$
175 IF y$ <> 'c' AND y$ <> 'q' THEN GOTO 170
180 IF y$ = 'q' THEN CLS : GOTO 10
190 CLS : PRINT 'Let's start with a sample problem:'
200 PRINT : PRINT 'If the frequency of a recessive allele in a population is'
210 PRINT '0.16 (or 16%), what is the expected frequency of the dominant'
220 PRINT 'allele?'
230 PRINT : PRINT : INPUT 'Type your answer in decimal format.'; a
240 PRINT : PRINT : IF a <> (.84) THEN PRINT 'Your answer is incorrect.'
245 IF a = (.84) THEN PRINT 'Congratulations.'
250 PRINT : PRINT 'The correct answer is 0.84 (or 84%). Throughout this'
260 PRINT 'tutorial, give the answers in decimal format and not as'
270 PRINT 'percentage. To find the answer, you should have used the'
280 PRINT 'equation: p + q = 1.': PRINT : PRINT
290 PRINT 'From the problem, we know that q = 0.16. From the equation we'
300 PRINT 'know that p + q = 1. By substituting the value of q into the'
310 PRINT 'equation, we arrive at:': PRINT
320 PRINT 'p +( 0.16) = 1. This is equivalent to p = 1 - (0.16) or p = 0.84'
330 PRINT : PRINT : INPUT 'Press <ENTER> enter to continue.'; z$: CLS
340 PRINT 'Let's try one more sample problem before we start the tutorial'
350 PRINT 'problems.': PRINT : PRINT
360 PRINT 'If the frequency of the homozygous dominant genotype is 0.49'
370 PRINT '(49%) and the frequency of the homozygous recessive genotype'
380 PRINT 'is 0.09 (9%), what is the expected frequency of the heterozygous'
390 PRINT 'genotype?': PRINT : PRINT
400 INPUT 'Type your answer in the decimal format.'; a
410 IF a <> .42 THEN PRINT 'Your answer is incorrect.'
420 IF a = .42 THEN PRINT : PRINT 'Congratulations.'
430 PRINT : PRINT 'The correct answer is 0.42 or 42%. Throughout this'
440 PRINT 'tutorial, give the answer in decimal format rather than as a per'
450 PRINT 'centage. To find the answer you should have used the equation:'
460 PRINT : PRINT ' pp + 2pq + qq = 1'
470 PRINT : PRINT : PRINT 'From the problem, we know that pp = 0.49 and that'
480 PRINT 'qq = 0.09. By substituting these 2 values into the equation, we'
490 PRINT 'arrive at:': PRINT ' ( 0.49) + 2pq +( 0.09) = 1'
500 PRINT : PRINT 'Solving for 2pq, which is the frequency of occurrence of'
510 PRINT 'the heterozygous genotype, one can see that:'
520 PRINT : PRINT ' 2pq = 1 - (0.49 + 0.09)'
530 PRINT : PRINT 'Therefore: 2pq = 0.42'
535 INPUT 'Press <ENTER> to continue.'; y$: CLS
540 PRINT : PRINT 'You have completed the 2 practice problems. If you had'
550 PRINT 'difficulty with the 2 sample problems, you should ask your teacher'
560 PRINT 'for advice on whether to proceed further.': PRINT : PRINT
600 CLS : PRINT 'You are now ready to begin the tutorial. You will not be'
610 PRINT 'given any solutions so be certain to have your calculator and'
620 PRINT 'pencil and paper nearby. Ask your teacher for assistance if you'
630 PRINT 'are really puzzled about an answer.'
640 PRINT : PRINT 'If you wish to quit the program, type <q>.': PRINT
650 INPUT 'To continue the program, type <c>.'; c$: CLS
660 IF c$ = 'q' THEN GOTO 10
700 RANDOMIZE TIMER: x = ((INT(RND * 7) + 2) * 1000): n = 0
710 IF w > 0 THEN PRINT : PRINT 'If you wish to quit the program, type <q>.'
720 IF w > 0 THEN INPUT 'To continue the program, type <c>.'; c$: CLS
730 IF w > 0 AND c$ = 'q' THEN GOTO 9600
740 w = w + 1: REM w counts number of problems attempted
745 CLS : PRINT 'PROBLEM NUMBER'; w: PRINT : PRINT : PRINT : PRINT
750 IF x = 2000 THEN GOTO 2000
760 IF x = 3000 THEN GOTO 3000
770 IF x = 4000 THEN GOTO 4000
780 IF x = 5000 THEN GOTO 5000
790 IF x = 6000 THEN GOTO 6000
800 IF x = 7000 THEN GOTO 7000
810 IF x = 8000 THEN GOTO 8000
2000 REM: PROBLEM #1
2010 RANDOMIZE TIMER: x% = (INT(RND * 100)): PRINT : PRINT
2020 PRINT 'If the frequency of the dominant allele in a population is';
2030 PRINT x% / 100; ','; 'what is the frequency of the recessive allele in'
2040 INPUT 'the same population'; b: a = ((100 - x%) / 100)
2050 IF b = a THEN GOSUB 9500 ELSE GOSUB 9000
2060 IF n > 0 AND n < 3 THEN GOTO 2020 ELSE GOTO 700
3000 REM PROBLEM #2
3010 RANDOMIZE TIMER: x% = (INT((RND * 9) + 1))
3020 PRINT 'If the frequency of the recessive allele in the gene pool is'
3030 PRINT x% / 10; ', what is the frequency of the homozygous recessive'
3040 INPUT 'genotype in the population'; b: a = (x% / 10) ^ 2
3050 IF b = a THEN GOSUB 9500 ELSE GOSUB 9000
3060 IF n > 0 AND n < 3 THEN GOTO 3020 ELSE GOTO 700
4000 REM:PROBLEM #3
4010 RANDOMIZE TIMER: x% = (INT((RND * 10) + 1) ^ 2)
4020 PRINT 'If the frequency of the homozygous recessive phenotype in'
4030 PRINT 'a population is'; x% / 100; ', what is the frequency of the';
4040 INPUT ' recessive allele in the gene pool of that population'; b
4050 a = (SQR(x% / 100)): IF b = a THEN GOSUB 9500 ELSE GOSUB 9000
4060 IF n > 0 AND n < 3 THEN GOTO 4020 ELSE GOTO 700
5000 REM:PROBLEM #4
5010 RANDOMIZE TIMER: x% = (INT((RND * 10) + 1) ^ 2)
5020 PRINT 'If the frequency of the homozygous recessive phenotype in the'
5030 PRINT 'population is'; x% / 100; ', what is the frequency of the'
5040 INPUT ' dominant allele in the gene pool of that population'; b
5050 a = (1 - (SQR(x% / 100)))
5060 IF b = a THEN GOSUB 9500 ELSE GOSUB 9000
5070 IF n > 0 AND n < 3 THEN GOTO 5020 ELSE GOTO 700
6000 REM:PROBLEM #5
6010 RANDOMIZE TIMER: x% = (INT(RND * 9) + 1)
6020 PRINT 'If the frequency of the dominant allele is found to be'
6030 PRINT x% / 10; ', what is the frequency of the heterozygous genotype in the'
6040 INPUT 'same population'; b: a = 2 * ((x%) * (10 - (x%))) / 100
6050 IF b = a THEN GOSUB 9500 ELSE GOSUB 9000
6060 IF n > 0 AND n < 3 THEN GOTO 6020 ELSE GOTO 700
7000 REM:PROBLEM #6
7010 RANDOMIZE TIMER: x% = (INT((RND * 10) + 1) ^ 2)
7015 RANDOMIZE TIMER: y% = (INT((RND * 10) + 1) ^ 2)
7016 IF ((SQR(x% / 100)) + (SQR(y% / 100))) <> 1 THEN GOTO 7000
7020 PRINT 'If the frequency of the homozygous recessive genotype is'
7030 PRINT x% / 100; 'and the frequency of the homozygous dominant genotype'
7040 PRINT 'is'; y% / 100; ', '; 'what is the predicted frequency of the'
7050 INPUT 'heterozygous genotype in the population'; b
7055 a = (2 * ((SQR(x%)) * (SQR(y%)))) / 100
7060 IF b = a THEN GOSUB 9500 ELSE GOSUB 9000
7070 IF n > 0 AND n < 3 THEN GOTO 7020 ELSE GOTO 700
8000 REM:PROBLEM #7
8010 RANDOMIZE TIMER: x% = (INT((RND * 10) + 1) ^ 2)
8015 IF 2 * (x% / 100) > 1 THEN GOTO 8010
8020 PRINT 'If the frequency of the homozygous dominant genotype and the'
8030 PRINT 'heterozygous genotype are both equal to the same number,'
8040 PRINT x% / 100; ',what is the predicted frequency of the homozygous'
8050 INPUT 'recessive genotype'; b: a = (1 - (2 * x% / 100))
8060 IF b = a THEN GOSUB 9500 ELSE GOSUB 9000
8070 IF n > 0 AND n < 3 THEN GOTO 8020 ELSE GOTO 700
9000 REM:ERROR MESSAGE
9010 CLS : PRINT : PRINT 'You have answered incorrectly. You are given'
9020 PRINT '3 total chances to answer correctly before being given the'
9030 INPUT 'correct answer. Push <ENTER> to continue.'; r: PRINT
9040 n = n + 1: REM counter
9050 IF n = 1 THEN v = v + 1: REM v counts number of first time errors
9060 IF n = 2 THEN PRINT : PRINT 'Only 1 more chance.'
9065 IF n = 3 THEN PRINT 'You have erred on your 3 attempts.'
9070 IF n = 3 THEN PRINT : PRINT 'The correct response is'; a; '.'
9080 IF n = 3 THEN PRINT : PRINT 'Better luck next time.'
9090 PRINT : IF n = 3 OR n = 2 THEN INPUT 'Push <ENTER> to continue.'; r
9100 CLS : RETURN
9500 REM:CONGRATULATORY MESSAGE
9510 n = 0: PRINT : PRINT 'You have answered correctly. Congratulations!'
9520 PRINT : INPUT 'Press <ENTER> to continue.'; r: CLS : RETURN
9600 REM :ENDING MESSAGE
9610 CLS : PRINT 'You have attempted '; w; 'problems. You have missed'
9620 PRINT v; 'of them on the first attempt.': PRINT : PRINT
9630 PRINT 'Your % correct on first attempt was'; ((w - v) / (w)) * 100; '.'
9640 PRINT : INPUT 'press <ENTER> to continue';
i: w = 0: n = 0: GOTO 10