## BEGIN_DESCRIPTION ## Using the Sage single cell server, show a graph involved in a question. ## END_DESCRIPTION ## DBsubject(Discrete) ## DBchapter(Graph Theory) ## DBsection(Radius of a graph) ## Date(April 2014) ## Institution(UMass Lowell) ## Author(Ken Levasseur) ## MLT(transForm) ## Level(3) ## KEYWORDS('sage', 'sagelet', 'graph', 'radius') DOCUMENT(); loadMacros( "PGstandard.pl", "PGchoicemacros.pl", "MathObjects.pl", "problemRandomize.pl", "sage.pl" ); TEXT(beginproblem()); Context("Numeric"); ProblemRandomize(when=>"Correct",onlyAfterDue=>0); $m = random(2,5,1); $n = random(2,5,1); $r=$m+$n-4; $ansList = List("$r"); #################################################### Context()->normalStrings; $SageCode = <$SageCode, AutoEvaluateCell=>'true', ); Context()->texStrings; BEGIN_TEXT $PAR What is the radius of the graph above? \(r =\) \{ans_rule(15) \} $BR $ECENTER $BR END_TEXT Context()->normalStrings; NAMED_ANS( sageAnswer => $ansList->cmp ); ANS(num_cmp($r)); Context()->texStrings; BEGIN_SOLUTION $PAR $BBOLD SOLUTION $EBOLD $BR The radius... $BR END_SOLUTION ENDDOCUMENT();