| 1 | #DESCRIPTION |
1 | # This file is just a pointer to the file |
| 2 | # Tests the ability to recognize the graphs created by |
2 | # |
| 3 | # translation and stretching transformations. |
3 | # "Library/Rochester/setAlgebra16FunctionGraphs/c2s2p59_72/c2s2p59_72.pg" |
| 4 | #ENDDESCRIPTION |
4 | # |
| 5 | ##KEYWORDS('algebra', 'function') |
5 | # You may want to change your problem set to use that problem |
| 6 | ## tcao tagged and PAID on 2-20-2004 |
6 | # directly, especially if you want to make a copy of the problem |
|
|
7 | # for modification. |
| 7 | |
8 | |
| 8 | ## DBsubject('Algebra') |
9 | DOCUMENT(); |
| 9 | ## DBchapter('Functions') |
10 | includePGproblem("Library/Rochester/setAlgebra16FunctionGraphs/c2s2p59_72/c2s2p59_72.pg"); |
| 10 | ## DBsection('Graphs of Functions') |
11 | ENDDOCUMENT(); |
| 11 | ## Date('6/3/2002') |
|
|
| 12 | ## Author('') |
|
|
| 13 | ## Institution('') |
|
|
| 14 | ## TitleText1('College Algebra') |
|
|
| 15 | ## EditionText1('3') |
|
|
| 16 | ## AuthorText1('Stewart, Redlin, Watson') |
|
|
| 17 | ## Section1('4.2') |
|
|
| 18 | ## Problem1('61 68 63 64') |
|
|
| 19 | DOCUMENT(); # This should be the first executable line in the problem. |
|
|
| 20 | |
12 | |
| 21 | loadMacros("PG.pl", |
13 | ## These tags keep this problem from being added to the NPL database |
| 22 | "PGbasicmacros.pl", |
14 | ## |
| 23 | "PGchoicemacros.pl", |
15 | ## DBsubject('ZZZ-Inserted Text') |
| 24 | "PGanswermacros.pl", |
16 | ## DBchapter('ZZZ-Inserted Text') |
| 25 | "PGauxiliaryFunctions.pl" |
17 | ## DBsection('ZZZ-Inserted Text') |
| 26 | ); |
|
|
| 27 | |
18 | |
| 28 | |
|
|
| 29 | $showPartialCorrectAnswers = 0; |
|
|
| 30 | |
|
|
| 31 | TEXT(beginproblem()); |
|
|
| 32 | |
|
|
| 33 | |
|
|
| 34 | # Define which of the three sets of pictures to use |
|
|
| 35 | |
|
|
| 36 | # The pictures are labeled 1.gif, 2.gif and 3.gif and |
|
|
| 37 | # stored in the same directory as staticgraphicsexample.gif |
|
|
| 38 | # These are the corresponding transformed pictures. |
|
|
| 39 | # Be careful with the labeling, since the URL's could give the |
|
|
| 40 | # correct answers away. |
|
|
| 41 | # (In this example the middle integer tells you |
|
|
| 42 | # the correct position.) |
|
|
| 43 | |
|
|
| 44 | $pictID[1] = [ |
|
|
| 45 | "1-c2s2591.gif", |
|
|
| 46 | "1-c2s2601.gif", |
|
|
| 47 | "1-c2s2611.gif", |
|
|
| 48 | "1-c2s2621.gif", |
|
|
| 49 | "1-c2s2631.gif", |
|
|
| 50 | "1-c2s2641.gif", |
|
|
| 51 | "1-c2s2671.gif", |
|
|
| 52 | "1-c2s2681.gif", |
|
|
| 53 | ]; |
|
|
| 54 | $ml = new_match_list(); |
|
|
| 55 | |
|
|
| 56 | $pictSet=random(1,1,1); # Choose one of the three picture sets |
|
|
| 57 | #$pictSetname = $pictSet.".gif"; |
|
|
| 58 | $ml->qa ( |
|
|
| 59 | "\( {\rm Piecewise\, function:} f(x)=-1,\,{\rm if} \, x<2\,{\rm and} |
|
|
| 60 | f(x)=1, \, {\rm if} \, x\ge 2 \) ", |
|
|
| 61 | image($pictID[$pictSet][0],tex_size=>200), |
|
|
| 62 | "\( {\rm Piecewise\, function:} f(x)=1,\,{\rm if} \, x\le 1\,{\rm and} |
|
|
| 63 | f(x)=x+1, \, {\rm if} \, x> 1 \) ", |
|
|
| 64 | image($pictID[$pictSet][1],tex_size=>200), |
|
|
| 65 | "\( {\rm Piecewise\, function:} f(x)=3,\,{\rm if} \, x<2\,{\rm and} |
|
|
| 66 | f(x)=x-1, \, {\rm if} \, x\ge 2 \) ", |
|
|
| 67 | image($pictID[$pictSet][2],tex_size=>200), |
|
|
| 68 | "\( {\rm Piecewise\, function:} f(x)=1-x,\,{\rm if} \, x<-2\,{\rm and} |
|
|
| 69 | f(x)=4, \, {\rm if} \, x\ge -2 \) ", |
|
|
| 70 | image($pictID[$pictSet][3],tex_size=>200), |
|
|
| 71 | "\( {\rm Piecewise\, function:} f(x)=x,\,{\rm if} \, x\le 0\,{\rm and} |
|
|
| 72 | f(x)=x+1, \, {\rm if} \, x>0 \) ", |
|
|
| 73 | image($pictID[$pictSet][4],tex_size=>200), |
|
|
| 74 | "\( {\rm Piecewise\, function:} f(x)=2x+3,\,{\rm if} \, x<-1\,{\rm and} |
|
|
| 75 | f(x)=3-x, \, {\rm if} \, x\ge -1 \) ", |
|
|
| 76 | image($pictID[$pictSet][5],tex_size=>200), |
|
|
| 77 | "\( {\rm Piecewise\, function:} f(x)=2,\,{\rm if} \, x\le -1\,{\rm and} |
|
|
| 78 | f(x)=x^2, \, {\rm if} \, x>-1 \) ", |
|
|
| 79 | image($pictID[$pictSet][6],tex_size=>200), |
|
|
| 80 | "\( {\rm Piecewise\, function:} f(x)=1-x^2,\,{\rm if} \, x\le 2\,{\rm and} |
|
|
| 81 | f(x)=x, \, {\rm if} \, x> 2 \) ", |
|
|
| 82 | image($pictID[$pictSet][7],tex_size=>200), |
|
|
| 83 | ); |
|
|
| 84 | $numGraphs = 4; |
|
|
| 85 | $ml->choose($numGraphs); |
|
|
| 86 | sub format_graphs { |
|
|
| 87 | my $self = shift; |
|
|
| 88 | my @in = @_; |
|
|
| 89 | my $out = ""; |
|
|
| 90 | while(@in) { |
|
|
| 91 | $out .= shift(@in). "#" ; |
|
|
| 92 | } |
|
|
| 93 | $out; # The output has to be a string in order to conform to the |
|
|
| 94 | # specs for the match list object, but I've put some |
|
|
| 95 | # markers in (#) so that |
|
|
| 96 | # I can break the string up into a list for use |
|
|
| 97 | # as an input into row. |
|
|
| 98 | } |
|
|
| 99 | |
|
|
| 100 | # We need to change the output, since the normal |
|
|
| 101 | # output routine will put the pictures one above another. |
|
|
| 102 | $ml->rf_print_a(~~&format_graphs); |
|
|
| 103 | |
|
|
| 104 | BEGIN_TEXT |
|
|
| 105 | Match the functons with their graphs. |
|
|
| 106 | Enter the letter of the graph below which corresponds to the function. |
|
|
| 107 | ($BBOLD Click on image for a larger view $EBOLD) |
|
|
| 108 | \{ $ml -> print_q \} |
|
|
| 109 | END_TEXT |
|
|
| 110 | |
|
|
| 111 | # Place the output into a table |
|
|
| 112 | TEXT( |
|
|
| 113 | begintable($numGraphs), |
|
|
| 114 | row( split("#",$ml->print_a() ) ), |
|
|
| 115 | row(@ALPHABET[ 0..($numGraphs-1) ] ), |
|
|
| 116 | endtable(), |
|
|
| 117 | ); |
|
|
| 118 | |
|
|
| 119 | ANS(str_cmp( $ml ->ra_correct_ans() ) ) ; |
|
|
| 120 | |
|
|
| 121 | ENDDOCUMENT(); # This should be the last executable line in the problem. |
|
|
| 122 | |
|
|