Restricted Formula

Description

Similar to the Formula type, but answers may only use the standard operations +, -, *, /, and ^, and the sqrt() function. Functions such as log(), sin(), etc., are not allowed. Answers may include variables.

Notes

Examples

\begin{question}{Restricted Formula}
\qutext{What is the exact value of $\sin(\frac{\pi}{4})$?}
% Use calculator syntax for the answer, NOT TeX:
\answer{1/sqrt(2)}
% Note that the response 'sin(pi/4)' would be graded correct in
% 'Formula' mode, but not here. 
\end{question}
\begin{question}{Restricted Formula}
\qutext{Compute the value of $\sin(\frac{\pi}{4})$. Round your answer 
to 5 significant digits.}
\answer{0.70711}
% In this case, a more accurate response would still be graded as
% incorrect.
\end{question}
\begin{question}{Restricted Formula}
\qutext{Compute the value of $\sin(\frac{\pi}{4})$. Your answer should
be correct to an accuracy of at least 5 decimal places.}
\answer{0.707107 ? 0.00001}
% Any numerical response between 0.707097 and 0.707117 would be graded
% as correct.
\end{question}
\begin{question}{Restricted Formula}
% This question uses algorithmic variables.
\qutext{What is the exact value of $\sin(\frac{\var{n}\pi}{4})$?}
\answer{\var{s}1/sqrt(2)}
\code{$m = range(0,6);
      $n = int(2*$m+3);
      $s = switch($m,"","-","-","","","-","-");}
% The above code chooses a random integer coefficient n to be an odd
% number between 3 and 15. The 'switch' statement picks the correct
% sign of the answer. 
\end{question}