summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/probsoln/samples/sample2.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/probsoln/samples/sample2.tex')
-rw-r--r--macros/latex/contrib/probsoln/samples/sample2.tex48
1 files changed, 48 insertions, 0 deletions
diff --git a/macros/latex/contrib/probsoln/samples/sample2.tex b/macros/latex/contrib/probsoln/samples/sample2.tex
new file mode 100644
index 0000000000..cd13c89f30
--- /dev/null
+++ b/macros/latex/contrib/probsoln/samples/sample2.tex
@@ -0,0 +1,48 @@
+ % This file is public domain
+\documentclass[a4paper]{article}
+
+\usepackage{probsoln}
+ %uncomment the following line to display the answers
+\showanswers
+
+ % The following will generate a different set of
+ % problems in subsequent years
+ %\PSNrandseed{\year}
+
+ % The following will generate a different set of
+ % problems on every run (where each run is at
+ % least a minute apart from the previous one)
+\PSNrandseed{\time}
+
+\begin{document}
+\title{Sample Problem Sheet}
+\author{Nicola Talbot}
+\maketitle
+
+\begin{enumerate}
+
+\newcounter{numproblems}
+ % store a random number from 1 to 3 in the counter numproblems
+\random{numproblems}{1}{3}
+
+ % selects 1,2 or 3 problems from 1 of the given files:
+\doforrandN{1}{\file}{prob-1stprncp,prob-implicit}{\selectrandomly{\file}{\value{numproblems}}}
+
+\item Differentiate the following functions:
+\input{prob-args}% load database
+\begin{enumerate}
+\newcounter{A}
+\newcounter{B}
+\newcounter{C}
+\random{A}{-4}{5}
+\random{B}{-3}{3}
+\random{C}{-1}{10}
+\item \useproblem{diff:quad}{\arabic{A}}{\arabic{B}}{\arabic{C}}
+
+\random{A}{-5}{5}
+ % make sure its not 0
+\whiledo{\value{A}=0}{\random{A}{-5}{5}}
+\item \useproblem{diff:sin}{\arabic{A}}
+\end{enumerate}
+\end{enumerate}
+\end{document}