I am programming some combinatorics questions, and have run into the following situation: My answer, $ans= Compute("C(60+6-1,60)") ; created in the IntegerFunctions context, is formatted correctly in the feedback table showing the correct answer, but I can't replicate this formatting in the PGML environment. All I get are the computed really big numbers, but I want the C(m,n) notation. This is causing issues for me as I want to refer to $ans (and other similarly constructed numbers) in the PGML solution environment. I have included a small working example and a screen shot below.
Thanks!
##############################################################
DOCUMENT();
loadMacros(
"PGstandard.pl", # Standard macros for PG language
"MathObjects.pl",
"PGML.pl",
"PGchoicemacros.pl", # NchooseK defined here
"contextIntegerFunctions.pl", # need for P(n,k) and C(n,k);
#"source.pl", # allows code to be displayed on certain sites.
"PGcourse.pl", # Customization file for the course
);
# Print problem number and point value (weight) for the problem
TEXT(beginproblem());
# Show which answers are correct and which ones are incorrect, set to 0 for no information
$showPartialCorrectAnswers = 1;
##############################################################
#
# Setup
#
#
Context("IntegerFunctions");
$ans= Compute("C(60+6-1,60)") ;
BEGIN_PGML
Determine the number of integer solutions to the following equation.
>>[`x_1+x_2+ \ldots +x_{6} = 60`]<<
where [`x_i \geq 0 `] for [`i =1,2,3,\ldots, 6`].
My answer is [_]{$ans}{10}.
Testing formatting for [| [$ans], [$ans]*, [$ans]**, [$ans]***|]
[$ans], [$ans]*, [$ans]**, [$ans]***
Testing formatting for [| [: [$ans], [$ans]*, [$ans]**, [$ans]*** :]|]
[: [$ans], [$ans]*, [$ans]**, [$ans]*** :]
I am looking for the command so that [| $ans |] produces the C(m,n) formatting, not the computed (large) number.
END_PGML
ENDDOCUMENT();
The result