Difference between revisions of "Problem9"

From WeBWorK_wiki
Jump to navigation Jump to search
m (added tag)
 
Line 66: Line 66:
 
 
 
ENDDOCUMENT();
 
ENDDOCUMENT();
  +
  +
[[Category:PREP 2011]]

Latest revision as of 12:18, 16 June 2021

Prep Main Page > Web Conference 2 > Sample Problems > Problem 9

This is Library/Rochester/setLimitsRates5Continuity/S02.05.Continuity.PTP01.pg

DOCUMENT();

loadMacros(
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGanswermacros.pl",
"PGgraphmacros.pl",
"PGauxiliaryFunctions.pl",
"extraAnswerEvaluators.pl"
);

TEXT(beginproblem());
$showPartialCorrectAnswers = 1;

$a=random(1,3,1);
$b=non_zero_random(-3,0,1);
$c=random(-3,2,1);
$m1=non_zero_random(-1,1,0.5);
$m2= - $m1;
$m3=non_zero_random(-1,1,1);
$m4=non_zero_random(-1,1,1);
@slice = NchooseK(3,3);

@colors = ("blue", "red", "green");
@sc = @colors[@slice];  #scrambled colors
@sa = ('A','B','C')[@slice];

$f1 = FEQ("sin(10*(x+1)) + $b for x in [-2,-1) using color:$sc[0] and weight:2");
$f2 = FEQ("1 + $a for x in [-1,-1] using color=$sc[0] and weight=2");
$f3 = FEQ("${m3}/((3*x)**2) + $b - ${m3}*1/9 for x in (-1,0) using " .
           "color=$sc[0] and weight:2");
$f4 = FEQ("${m4}/((3*x)**2) + $b - ${m4}*1/9 for x in (0,1) using " .
           "color=$sc[0] and weight:2");
$f5 = FEQ("$b/5 for x in [1,1] using color=$sc[0] and weight=2");
$f6 = FEQ("${m1}*(x-3)+$c for x in (1,3] using color=$sc[0] and weight=2");
$f7 = FEQ("${m2}*(x-3)+$c for x in [3,4] using color=$sc[0] and weight=2");

$graph = init_graph(-3,-6,5,6,'axes'=>[0,0],'grid'=>[8,12]);

($f1Ref,$f2Ref,$f3Ref,$f4Ref,$f5Ref,$f6Ref,$f7Ref) =
    plot_functions($graph,$f1,$f2,$f3,$f4,$f5,$f6,$f7);

TEXT(EV2(<<EOT));
Let \( f \) be the function below.$PAR
EOT

TEXT(image( insertGraph($graph) , height=>200, width=>200));

TEXT(EV2(<<EOT));
$BR
$BR

Use \{ helpLink('interval notation')\} to indicate where \( f(x) \)
is continuous.  If it is continuous on more than one interval, 
use $BITALICS U $EITALICS for union.  You may click on the graph to 
make it larger.

\<ans_rule(40)\>
EOT

ANS(interval_cmp("[-2,-1)U(-1,0)U(0,1)U(1,4]"));

ENDDOCUMENT();