\documentclass{article}

\usepackage[dvips]{graphicx}
\usepackage{amsmath,amsthm,amsfonts}
\usepackage{html,color}

\begin{document}

\maximacode
  set_random_state(make_random_state(true));
  pick([list]) := block([i], i:random(length(list))+1, return(list[i]));
  round(x) := ?round(float(x));
\endmaximacode

\problemset
\problem
\maximacode
  x1: pick(-2,1,2,4);
  x2: x1 + pick(-5,6,7);
  y1: pick(-3,1,3,5);
  y2: y1 + pick(-3,-2,5);
\endmaximacode
If a linear function~\textit{f}
satisfies \maxima f(x1) = y1 \endmaxima and \maxima f(x2) = y2 \endmaxima,
find \textit{f(x)}.

\multiplechoice
\correct
\maxima expand(solve(y - y1 = (y1 - y2)/(x1 - x2)*(x - x1), y)[1]) \endmaxima
\incorrect
\maxima expand(solve(y + y1 = (y1 - y2)/(x1 - x2)*(x + x1), y)[1]) \endmaxima
\incorrect
\maxima expand(solve(y - y2 = y1/x1*(x - x2), y)[1]) \endmaxima
\incorrect
\maxima expand(solve(y + y2 = y1/x1*(x + x2), y)[1]) \endmaxima
\endmultiplechoice

\problem
\maximacode
  a: pick(-2,2,3);
  c: pick(-3,1,2,4);
  b: pick(-1,1) * round(sqrt(4*abs(a*c) + pick(1,3,4,7)));
\endmaximacode
Solve the equation \maxima ff: a*x^2 + b*x + c = 0 \endmaxima.

\multiplechoice
\correct
\maxima solve(ff,x) \endmaxima
\incorrect
\maxima solve(a * x^2 + b*x - c, x) \endmaxima
\incorrect
\maxima solve(a * x^2 - b*x + c, x) \endmaxima
\incorrect
\maxima solve(x^2 + b*x + c, x) \endmaxima
\endmultiplechoice

\endproblemset

\end{document}
