#!/pkg/bin/perl
push(@INC,"/www/httpd/cgi-bin");
require 5.003;
require "cgi-lib.pl";

#---------------------------- Main Program ----------------------------
sub Reply {

$percent = ($score/ $NunbProbs)*100;

print <<end
<!--
<SCRIPT language="JavaScript">
  window.open("http://www.math.upenn.edu/~kazdan/210/diag/diag_ans.html", "Math 210 Diagnostic Exam Solutions",'');
</SCRIPT>
-->

<html><head><title>Diagnostic Exam Solutions</title>

<!--
<SCRIPT  language="JavaScript">
  function newWin() {
    window.open("http://www.math.upenn.edu/~kazdan/210/diag/diag_ans.html", "Math 210 Diagnostic Exam Solutions",'');
  }
</SCRIPT>
-->
</head>

<!--body onLoad="newWin()" bgcolor=white-->
<body bgcolor="#FFF0E0">

<center> 
<h1><font color=blue><i> Diagnostic Exam Results</i></font></h1> 
</center>

You correctly answered $score questions out of $NunbProbs (so $percent%).
<p>
    You missed the following: &nbsp;  $wrong1.  

<p>This Diagnostic Exam was intended to be easy.  If you missed many
problems, it may not be wise to take this course.

<p>
Below are the solutions.  The correct answer has a light blue background.

<p>
You may wish to save this page.

<hr>

<center> <h3> Diagnostic Exam Solutions</h3> </center>
<!--form-->
<p>
1. 300 is what percent of 2,000?
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N1" value="a"> .67%
<td><input type=radio name="N1" value="b"> 1.5%
<td><input type=radio name="N1" value="c"> 6.7%
<td bgcolor="#E0E0FF"><input type=radio name="N1" value="d"> 15%
<td><input type=radio name="N1" value="e"> 33%
<td><input type=radio name="N1" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp;  300/2000 =3/20 =1.5/10 =15%

<p>&nbsp;
<p>
2. A town has 100,000 families. One tenth of one percent of these families
have incomes over \$75,000 a year.  The number of such families is
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N2" value="a"> 1
<td><input type=radio name="N2" value="b"> 10
<td bgcolor="#E0E0FF"><input type=radio name="N2" value="c"> 100
<td><input type=radio name="N2" value="d"> 1,000
<td><input type=radio name="N2" value="e"> 1,500
<td><input type=radio name="N2" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp;   one tenth of one
 percent = 1/1000.  Thus number = 100,000/1000 = 100 families.

<p>&nbsp;
<p>
3. There are 100 million eligible voters in the United States.  The
Gallup pole interviews 5,000 of them.  This amounts to 1 eligible voter
out of every &nbsp; ?  &nbsp; voters.
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N3" value="a"> 200
<td><input type=radio name="N3" value="b"> 2,000
<td><input type=radio name="N3" value="c"> 5,000
<td bgcolor="#E0E0FF"><input type=radio name="N3" value="d"> 20,000
<td><input type=radio name="N3" value="e"> 50,000
<td><input type=radio name="N3" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp;  5,000/100,000,000 = 1/V so
V = 100,000/5 = 20,000.

<p>&nbsp;
<p>
4. In the United States, 1 person out of every 500 is in the army, and 3
out of every 10,000 Americans are army officers.  What percentage of army
personnel are officers?
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N4" value="a"> .15%
<td><input type=radio name="N4" value="b"> .2%
<td><input type=radio name="N4" value="c"> 5%
<td bgcolor="#E0E0FF"><input type=radio name="N4" value="d"> 15%
<td><input type=radio name="N4" value="e"> 20%
<td><input type=radio name="N4" value="f"> Can't tell.
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp;  army = 1/500US, officers =
3/10,000US so officers/army = (3/10,000)/(1/500) = 1500/10,000 =15/100 =
15%

<p>&nbsp;
<p>
5. In the United States, 1 person out of every 2,000 is a marine, and
one-tenth of marine personnel are officers.  What percentage of the U.S.
Population consists of marine officers?
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N5" value="a"> .002%
<td bgcolor="#E0E0FF"><input type=radio name="N5" value="b"> .005%
<td><input type=radio name="N5" value="c"> .02%
<td><input type=radio name="N5" value="d"> .05%
<td><input type=radio name="N5" value="e"> .2%
<td><input type=radio name="N5" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp;   officers = (1/10)marines =
(1/20,000)US = 0.005%

<p>&nbsp;
<p>
6. <sup><img src="/~kazdan/210/diag/diag6.gif" align=middle> </sup> is about
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td bgcolor="#E0E0FF"><input type=radio name="N6" value="a"> 300
<td><input type=radio name="N6" value="b"> 400
<td><input type=radio name="N6" value="c"> 500
<td><input type=radio name="N6" value="e"> 1,000
<td><input type=radio name="N6" value="e"> 3,000
<td><input type=radio name="N6" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; 300 (better: 316).
100,000 = 10x100<sup>2</sup>

<p>&nbsp;
<p>
7. <sup><img src="/~kazdan/210/diag/diag7.gif" align=middle> </sup>.
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N7" value="a"> True
<td bgcolor="#E0E0FF"><input type=radio name="N7" value="b"> False
<td><input type=radio name="N7" value="c"> Don't know
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; False: The left side
is less than one while the right (the reciprocal of the left) is thus greater 
than one. The fraction on the left = 
<sup><img src="/~kazdan/210/diag/diag7s.gif" align=middle></sup>.  

<p>&nbsp;
<p>
8. <sup><img src="/~kazdan/210/diag/diag8.gif" align=middle> </sup>is smaller than .5 .
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N8" value="a"> True
<td bgcolor="#E0E0FF"><input type=radio name="N8" value="b"> False
<td><input type=radio name="N8" value="c"> Don't know
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; False, since if
0 &lt; x &lt; 1 &nbsp;then &nbsp;x<sup>2 </sup> &lt;x .

<p>&nbsp;
<p>
9. <sup><img src="/~kazdan/210/diag/diag9.gif" align=middle> </sup>
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N9" value="a"> True
<td bgcolor="#E0E0FF"><input type=radio name="N9" value="b"> False
<td><input type=radio name="N9" value="c"> Don't know
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; False

<p>&nbsp;
<p> 10. A quart of vodka is 40% alcohol.  Write a formula for the
<font color=red>percentage </font>of alcohol in a mixture of &nbsp; V
&nbsp; quarts of vodka and &nbsp; J  &nbsp; quarts of orange juice.
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr align=center>
<td><input type=radio name="N10" value="a"> <font size="-1"><br>.4V
<td bgcolor="#E0E0FF"><input type=radio name="N10" value="b"><font size="-1"> <br>40V/(V + J)
<td><input type=radio name="N10" value="c"><font size="-1"> <br>(4V + J)/(V + J)
<td><input type=radio name="N10" value="d"><font size="-1"> <br>(40V + J)/(100 J)
<td><input type=radio name="N10" value="e"><font size="-1"> <br>.40V/ J
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; total alcohol =
.4V and total liquid = V + J.  Thus proportion alcohol = .4V/(V+J) =
40V/(V+J) %

<p>&nbsp;
<p>
11. This year John's mother is exactly three times as old as he is.
Next year their ages will add up to 50.  How old is John?
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N11" value="a"> 5
<td><input type=radio name="N11" value="b"> 6
<td bgcolor="#E0E0FF"><input type=radio name="N11" value="c"> 12
<td><input type=radio name="N11" value="d"> 15
<td><input type=radio name="N11" value="e"> 24
<td><input type=radio name="N11" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; M = 3J &nbsp;and
&nbsp; (M+1) + (J+1) = 50. Thus John = 12 and mother = 36.

<p>&nbsp;
<p>
12. Here is a quadratic equation: &nbsp;
3x<sup>2</sup> + 17x -28.9207 = 0.  One of the following is a
solution; which one?
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N12" value="a"> 0.1
<td><input type=radio name="N12" value="b"> 0.87
<td bgcolor="#E0E0FF"><input type=radio name="N12" value="c"> 1.37
<td><input type=radio name="N12" value="d"> 2.17
<td><input type=radio name="N12" value="d"> 3.81
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; Try all the
possibilities using rough estimates.  The upshot is that only 1.37
could possibly work.  For instance x = 1 is clearly too small to be a
solution,  so neither are x = 0.1 or x = 0.87. Similarly x = 2 is too large
so both 2.17 and 3.81 are also too large.  This leaves only 1.37 which
presumably works (it does).

<p>&nbsp;
<p>
13. The graph of the equation &nbsp; y = (1/3)x + 2 &nbsp;  is a
straight line.  Does the point (5.1, 3.5) lie on the line?
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N13" value="a"> Yes
<td bgcolor="#E0E0FF"><input type=radio name="N13" value="b"> No
<td><input type=radio name="N13" value="c"> Need more information.
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; No.  By a direct
calculation (5.1)/3 + 2 =  1.7 + 2 = 3.7, not 3.5.

<p>&nbsp;
<p>
14. You throw one die.  What is the chance of getting an
ace<sup><img src="/~kazdan/210/diag/diag14.gif" align=middle> </sup>?
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N14" value="a"> 1/12
<td bgcolor="#E0E0FF"><input type=radio name="N14" value="b"> 1/6
<td><input type=radio name="N14" value="c"> 1/4
<td><input type=radio name="N14" value="d"> 1/3
<td><input type=radio name="N14" value="e"> 1/2
<td><input type=radio name="N14" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; &nbsp; 1/6

<p>&nbsp;
<p>
15. You throw a pair of dice.  What is the chance of getting two
<br>aces:
<sup><img src="/~kazdan/210/diag/diag14.gif" align=middle> </sup>
<sup><img src="/~kazdan/210/diag/diag14.gif" align=middle> </sup>?
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N15" value="a"> 1/72
<td bgcolor="#E0E0FF"><input type=radio name="N15" value="b"> 1/36
<td><input type=radio name="N15" value="c"> 1/24
<td><input type=radio name="N15" value="d"> 1/18
<td><input type=radio name="N15" value="e"> 1/12
<td><input type=radio name="N15" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; 1/36

<p>&nbsp;
<p>
16. Here are three situations:
<br>&nbsp;&nbsp;&nbsp;
(i) <font color=green>A coin will be tossed 100 times.  If it comes up heads 60 or more
or more times times you win $2.</font>
<br>&nbsp;&nbsp;&nbsp;
 (ii) <font color=green>A coin will be tossed 1,000 times.  If it comes up
 heads 600 or more times you win $2.</font>
<br>&nbsp;&nbsp;&nbsp;
 (iii) <font color=green>A (fair) coin has been tossed 100 times and 73 have
 been tails.  If it comes up heads 60 or more times times in the next
 100 tosses you win $2.</font>
<br>
Which is better -- or do they offer the same chance of winning?
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N16" value="a"> (i)
<td><input type=radio name="N16" value="b"> (ii)
<td><input type=radio name="N16" value="c"> (iii)
<td bgcolor="#E0E0FF"><input type=radio name="N16" value="d"> Same chance.
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; The
coin has no memory of the past so the extra information in (iii) is
irrelevant -- unless the coin is unfair.

<p>&nbsp;
<hr>

<p>
<i>The next three questions refer to the histogram below</i>.
<br>
A group of people were asked how many hats they own.  This summarizes their
replies. The horizontal axis is the number of hats, so min = 0, max = 5,
while the vertical axis is the number of people who gave that reply.

<img align=right src="/~kazdan/210/diag/210hist1b.gif">

<p>
17. How many people replied?
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N17" value="a"> 5
<td><input type=radio name="N17" value="b"> 6
<td><input type=radio name="N17" value="c"> 8
<tr>
<td bgcolor="#E0E0FF"><input type=radio name="N17" value="d"> 10
<td><input type=radio name="N17" value="e"> 20
<td><input type=radio name="N17" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; 10

<p>&nbsp;
<p>
18. What was the <i>mean</i> reply?
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N18" value="a"> 3
<td><input type=radio name="N18" value="b"> 3.3
<td bgcolor="#E0E0FF"><input type=radio name="N18" value="c"> 3.5
<tr>
<td><input type=radio name="N18" value="d"> 3.7
<td><input type=radio name="N18" value="e"> 4
<td><input type=radio name="N18" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; (1x1 + 2x1 + 3x2 +
4x4 + 5x2) = 35/10 = 3.5

<p>&nbsp;
<p>
19. <i>median</i> ?
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N19" value="a"> 3
<td><input type=radio name="N19" value="b"> 3.3
<td><input type=radio name="N19" value="c"> 3.5
<td><input type=radio name="N19" value="d"> 3.7
<td bgcolor="#E0E0FF"><input type=radio name="N19" value="e"> 4
<td><input type=radio name="N19" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; 4, since there are as
many replies above four as below four.

<br clear=all>
<p>&nbsp;<hr>

<p>
20. The derivative of &nbsp; x<sup>2</sup> &nbsp; is &nbsp;
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N20" value="a"> 2
<td bgcolor="#E0E0FF"><input type=radio name="N20" value="b"> 2x
<td><input type=radio name="N20" value="c"> 2x + C
<td><input type=radio name="N20" value="d"> x/2 + C
<td><input type=radio name="N20" value="e"> x
<td><input type=radio name="N20" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; 2x

<p>&nbsp;
<p>
21. <sup><img src="/~kazdan/210/diag/diag21.gif" align=middle> </sup>=
<br><center>
<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N21" value="a"> 11/4
<td><input type=radio name="N21" value="b"> 3
<td><input type=radio name="N21" value="c"> 13/4
<td bgcolor="#E0E0FF"><input type=radio name="N21" value="d"> 15/4
<td><input type=radio name="N21" value="e"> 4
<td><input type=radio name="N21" value="f"> Can't tell
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; 4 - (1/4) = 15/4

<p>&nbsp;
<p>
22. If  &nbsp;dy/dx &nbsp;= &nbsp;x &nbsp;with &nbsp;y(0) = 3,&nbsp; then 
&nbsp; y(2) = &nbsp;
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="N22" value="a"> 5/2
<td><input type=radio name="N22" value="b"> 4
<td bgcolor="#E0E0FF"><input type=radio name="N22" value="c"> 5
<td><input type=radio name="N22" value="b"> 6
<td><input type=radio name="N22" value="c"> 7
</table></center>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; dy/dx = x inplies
y(x) = x<sup>2</sup>/2 + C.  Also 3 = y(0) = C.  Thus y =
x<sup>2</sup>/2 + 3.  Consequently y(2) = 4/2 + 3 = 5.

<p>&nbsp;
<p>
23. To find the value of &nbsp; c  &nbsp; that minimizes
<center><sup><img src="/~kazdan/210/diag/diag23.gif" align=middle> </sup>  </center>

<table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr><td><input type=radio name="N23" value="a"> Differentiate with respect to
&nbsp; x
<tr><td bgcolor="#E0E0FF"><input type=radio name="N23" value="b"> 
Differentiate with respect to &nbsp; c
<tr><td><input type=radio name="N23" value="c"> Can't do it by calculus.
</table>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; Differentiate with respect to
&nbsp; c

<p>&nbsp;
<p>
<hr>
<i>The next two problems refer to the graph of</i> &nbsp; h(x) &nbsp;
<i>on the right</i>.
<img src="/~kazdan/210/diag/diag24a.gif" align=right>
<p>

24. Which of the following best describe the graph at <b>P</b>?  (here
&nbsp; h'&nbsp; is the first derivative and &nbsp; h''&nbsp; the second).
<br>
<table border=1  cellspacing=2 cellpadding=3 bgcolor="white">
<tr>
<td><input type=radio name="N24" value="a">&nbsp; h'>0,&nbsp; h''<0
<td><input type=radio name="N24" value="b">&nbsp; h'>0,&nbsp; h''>0
<td bgcolor="#E0E0FF"><input type=radio name="N24" value="c">&nbsp; h'=0,&nbsp; h''<0
<tr>
<td><input type=radio name="N24" value="d">&nbsp; h'=0,&nbsp; h''>0
<td><input type=radio name="N24" value="e">&nbsp; h'<0,&nbsp; h''>0
<td><input type=radio name="N24" value="e">&nbsp; h'<0,&nbsp; h''<0
</table>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; h'=0,&nbsp; h''<0

<p>&nbsp;
<p>

25. Which of the following best describe the graph at <b>Q</b>?
<br>
<table border=1  cellspacing=2 cellpadding=3 bgcolor="white">
<tr>
<td><input type=radio name="N25" value="a">&nbsp; h'>0,&nbsp h''<0
<td bgcolor="#E0E0FF"><input type=radio name="N25" value="b">&nbsp; h'>0,&nbsp h''>0
<td><input type=radio name="N25" value="c">&nbsp; h'=0,&nbsp h''<0
<tr>
<td><input type=radio name="N25" value="d">&nbsp; h'=0,&nbsp h''=0
<td><input type=radio name="N25" value="e">&nbsp; h'<0,&nbsp h''>0
<td><input type=radio name="N25" value="e">&nbsp; h'<0,&nbsp h''<0
</table>
<p>
<font color=magenta><b>SOLUTION:</b></font> &nbsp; h'>0,&nbsp h''>0

<br clear=all>
<hr>
<p>&nbsp;
<p>
A-1. I know how to make an HTML table like this next answer box:
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="A1" value="y"> <font color=blue> Yes</font>
<td><input type=radio name="A1" value="n"> <font color=black>Not yet</font>
<td><input type=radio name="A1" value="m"> <font color=green>Not sure</font>
</table></center>

<p>&nbsp;
<p>
A-2. I know how to write an HTML document like this diagnostic exam:
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="A2" value="y"> <font color=blue> Yes</font>
<td><input type=radio name="A2" value="n"> <font color=black>Not yet</font>
<td><input type=radio name="A2" value="m"> <font color=green>Not sure</font>
</table></center>
<p>&nbsp;
<p>

A-3. I know how to write a script that processes an exam like this one:
<center><table border=1  cellspacing=3 cellpadding=5 bgcolor="white">
<tr>
<td><input type=radio name="A3" value="y"> <font color=blue> Yes</font>
<td><input type=radio name="A3" value="n"> <font color=black>Not yet</font>
<td><input type=radio name="A3" value="m"> <font color=green>Not sure</font>
</table></center>
<p>
</form>
<hr>
<font size="-1">
This is based on a diagnostic quiz from <i>Statistics</i> (3rd edition)
by Freedman, Pisani, &amp; Purves, &nbsp; W.W. Norton, 1998 </font>
</body></html>
end
} # end Reply

1; #return true 
