summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/probsoln/samples
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/probsoln/samples')
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/1stprncp.tex61
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/args.tex45
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/easy.tex85
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/easy2.tex135
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/implicit.tex41
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/mchoice.tex34
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/newdata.tex26
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/nosoln.tex7
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/probspaces.tex31
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/probspaces2.tex41
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/sample.tex42
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/sample2.tex47
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/sample3.tex24
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/sample4.tex16
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/sample5.tex34
-rw-r--r--Master/texmf-dist/doc/latex/probsoln/samples/tabmchoice.tex16
16 files changed, 685 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/1stprncp.tex b/Master/texmf-dist/doc/latex/probsoln/samples/1stprncp.tex
new file mode 100644
index 00000000000..514abf57763
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/1stprncp.tex
@@ -0,0 +1,61 @@
+ % These all involve differentiating from 1st principles
+
+\newproblem{dfp:xcube}{%
+Differentiate $f(x) = x^3$ with respect to $x$ by first principles.}{%
+\begin{eqnarray*}
+\frac{dy}{dx} & = & \lim_{\Delta x\rightarrow 0}\frac{f(x+\Delta x) - f(x)}{\Delta x}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{(x+\Delta x)^3-x^3}{\Delta x}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{(x+\Delta x)(x^2+2x\Delta x+(\Delta x)^2)-x^3}{\Delta x}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{x^3+3x^2\Delta x+3x(\Delta x)^2+(\Delta x)^3-x^3}{\Delta x}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{3x^2\Delta x+3x(\Delta x)^2+(\Delta x)^3}{\Delta x}\\
+ & = & \lim_{\Delta x\rightarrow 0}3x^2+3x\Delta x + (\Delta x)^2\\
+ & = & 3x^2
+\end{eqnarray*}}
+
+\newproblem{dfp:Ioverxsq}{%
+Differentiate $\displaystyle f(x) = \frac{1}{x^2}$ with respect to $x$ by first principles.}{%
+\begin{eqnarray*}
+\frac{df}{dx} & = & \lim_{\Delta x\rightarrow 0}\frac{\frac{1}{(x+\Delta x)^2}-\frac{1}{x^2}}{\Delta x}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{\frac{x^2-(x+\Delta x)^2}{x^2(x+\Delta x)^2}}{\Delta x}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{x^2-(x^2+2x\Delta x+(\Delta x)^2)}{x^2\Delta x(x+\Delta x)^2}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{-2x\Delta x-(\Delta x)^2}{x^2\Delta x(x+\Delta x)^2}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{-2x-\Delta x}{x^2(x+\Delta x)^2}\\
+ & = & \frac{-2x}{x^2x^2}\\
+ & = & -\frac{2}{x^3}
+\end{eqnarray*}}
+
+\newproblem{dfp:sqrtx}{%
+Differentiate from first principles $f(x) = \surd x$}{%
+\begin{eqnarray*}
+\frac{df}{dx} & = & \lim_{\Delta x\rightarrow 0}\frac{\sqrt{x+\Delta x}-\surd x}{\Delta x}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{(\sqrt{x+\Delta x}-\surd x)(\sqrt{x+\delta x}+\surd x)}{\Delta x(\sqrt{x+\Delta x}+\surd x)}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{x+\Delta x - x}{\Delta x(\sqrt{x+\Delta x}+\surd x)}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{\Delta x}{\Delta x(\sqrt{x+\Delta x}+\Delta x)}\\
+ & = & \lim_{\Delta x\rightarrow 0}\frac{1}{\sqrt{x+\Delta x}+\surd x}\\
+ & = & \frac{1}{2\surd x}
+\end{eqnarray*}}
+
+\newproblem{dfp:cons}{%
+Differentiate from first principles $f(x) = c$ where $c$ is a constant.}{%
+\begin{eqnarray*}
+\frac{df}{dx} & = & \lim_{\Delta x\rightarrow 0}\frac{c-c}{\Delta x}\\
+ & = & \lim_{\Delta x\rightarrow 0}0\\
+ & = & 0
+\end{eqnarray*}}
+
+\newproblem{dfp:cosx}{%
+Given
+\begin{eqnarray*}
+\lim_{x \rightarrow 0} \frac{\cos x - 1}{x} & = & 0\\
+\lim_{x \rightarrow 0} \frac{\sin x}{x} & = & 1
+\end{eqnarray*}
+differentiate from first principles $f(x) = \cos x$.}{%
+\begin{eqnarray*}
+\frac{df}{dx} & = & \lim_{\Delta x \rightarrow 0}\frac{f(x + \Delta x) - f(x)}{\Delta x}\\
+ & = & \lim_{\Delta x \rightarrow 0} \frac{\cos(x + \Delta x) - \cos(x)}{\Delta x}\\
+ & = & \lim_{\Delta x \rightarrow 0} \frac{\cos x\cos\Delta x - \sin x\sin\Delta x - \cos x}{\Delta x}\\
+ & = & \lim_{\Delta x \rightarrow 0} \frac{\cos x(\cos\Delta x - 1) - \sin x\sin\Delta x}{\Delta x}\\
+ & = & \cos x\lim_{\Delta x \rightarrow 0}\frac{\cos\Delta x - 1}{\Delta x}
+ - \sin x\lim_{\Delta x \rightarrow 0}\frac{\sin\Delta x}{\Delta x}\\
+ & = & -1 \qquad\mbox{(using given results)}
+\end{eqnarray*}}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/args.tex b/Master/texmf-dist/doc/latex/probsoln/samples/args.tex
new file mode 100644
index 00000000000..77278d86530
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/args.tex
@@ -0,0 +1,45 @@
+ % These problems require arguments
+
+ % Arguments: #1->a_2, #2->a_1 and #3->a_0
+ % (Arguments must be integers)
+\newcount\ctr
+\newproblem[3]{diff:quad}{%
+\(f(x) =
+\ifnum#1=0
+\else
+\ifnum#1=1\else#1\fi x^2
+\fi
+\ifnum#2=0
+\else
+\ifnum#2>0 \ifnum#1=0 \else + \fi \fi
+\ifnum#2=1\else#2\fi x
+\fi
+\ifnum#3=0
+\else
+\ifnum#3>0 \ifnum#2=0 \ifnum#1=0 \else + \fi \else + \fi\fi
+#3
+\fi\)
+}{%
+\(f'(x) =
+\ifnum#1=0
+\else
+\ctr=2
+\multiply\ctr by #1
+\the\ctr x
+\fi
+\ifnum#2=0
+\else
+\ifnum#2>0 \ifnum#1=0 \else + \fi \fi
+#2
+\fi
+ % print 0 if both #1 and #2 are 0
+\ifnum#1=0 \ifnum#2=0 0 \fi\fi
+\)
+}
+
+\newproblem[1]{diff:sin}{%
+\(f(x) = \sin(#1x)\)
+}{%
+\(f'(x) = #1\cos(#1x)\)
+}
+
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/easy.tex b/Master/texmf-dist/doc/latex/probsoln/samples/easy.tex
new file mode 100644
index 00000000000..0833f7e9527
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/easy.tex
@@ -0,0 +1,85 @@
+ % These are all easy differentiation problems
+
+\newproblem{diffeasy:gpowh}{%
+\(f(x) = g(x)^{h(x)}.\)}{%
+\begin{eqnarray*}
+f(x) & = & e^{\ln g(x)^{h(x)}}\\
+ & = & e^{h(x)\ln g(x)}\\
+f'(x) & = & e^{h(x)\ln g(x)}(h'(x)\ln g(x) + h(x)\frac{g'(x)}{g(x)})\\
+ & = & g(x)^{h(x)}(h'(x)\ln g(x) + \frac{h(x)g'(x)}{g(x)})
+\end{eqnarray*}}
+
+\newproblem{diffeasy:arcsin}{%
+\(y = \arcsin(x)\)}{%
+\[\sin(y) = x\]
+diff. w.r.t. $x$:
+\begin{eqnarray*}
+\cos y \frac{dy}{dx} & = & 1\\
+\frac{dy}{dx} & = & \frac{1}{\cos y}\\
+ & = & \frac{1}{\sqrt{1 - \sin^2y}}\\
+ & = & \frac{1}{\sqrt{1-x^2}}.
+\end{eqnarray*}}
+
+\newproblem{diffeasy:arccos}{%
+$y = \arccos x$.}{%
+\(\cos y = x\)
+diff. w.r.t. $x$:
+\begin{eqnarray*}
+-\sin y \frac{dy}{dx} & = & 1\\
+\frac{dy}{dx} & = & \frac{-1}{\sin y}\\
+ & = & \frac{-1}{\sqrt{1-\cos^2y}}\\
+ & = & \frac{-1}{\sqrt{1-x^2}}
+\end{eqnarray*}}
+
+\newproblem{diffeasy:tan}{%
+\(y = \tan x\)}{%
+\begin{eqnarray*}
+y & = & \tan x\\
+ & = & \frac{\sin x}{\cos x}\\
+\frac{dy}{dx} & = & \frac{\cos x}{\cos x} + \sin x\times\frac{-1}{\cos^2x}\times -\sin x\\
+ & = & 1 + \tan^2x\\
+ & = & \sec^2x.
+\end{eqnarray*}}
+
+\newproblem{diffeasy:arctan}{%
+\(y = \arctan x = \tan^{-1}x\)}{%
+\[\tan y = x\]
+diff w.r.t. $x$:
+\begin{eqnarray*}
+\sec^2y\frac{dy}{dx} & = & 1\\
+\frac{dy}{dx} & = & \frac{1}{\sec^2y}\\
+ & = & \frac{1}{1+\tan^2y}\\
+ & = & \frac{1}{1+x^2}
+\end{eqnarray*}}
+
+\newproblem{diffeasy:cot}{%
+\(y = (\tan x)^{-1} = \cot x\)}{%
+\begin{eqnarray*}
+\frac{dy}{dx} & = & -(\tan x)^{-2}\sec^2x\\
+ & = & -\frac{\cos^2x}{\sin^2x}\cdot\frac{1}{\cos^2x}\\
+ & = & \frac{-1}{\sin^2x}\\
+ & = & -\csc^2x.
+\end{eqnarray*}}
+
+\newproblem{diffeasy:cosxsqsinx}{%
+$y = \cos(x^2)\sin x$.}{%
+\[\frac{dy}{dx} = -\sin(x^2)2x\sin x + \cos(x^2)\cos x\]}
+
+\newproblem{diffeasy:xlnx}{%
+$y = (x+1)\ln(x+1)$.}{%
+\begin{eqnarray*}
+\frac{dy}{dx} & = & \ln(x+1) + \frac{x+1}{x+1}\\
+ & = & 1 + \ln(x+1).
+\end{eqnarray*}}
+
+\newproblem{diffeasy:glng}{%
+$f(x) = g(x)\ln(g(x))$.}{%
+\begin{eqnarray*}
+f'(x) & = & g'(x)\ln(g(x)) + \frac{g(x)}{g(x)}g'(x)\\
+ & = & g'(x)(1+\ln(g(x))).
+\end{eqnarray*}}
+
+\newproblem{diffeasy:sinx/x}{%
+$y = \frac{\sin x}{x}$.}{%
+\[\frac{dy}{dx} = \frac{\cos x}{x} - \frac{\sin x}{x^2}\]}
+
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/easy2.tex b/Master/texmf-dist/doc/latex/probsoln/samples/easy2.tex
new file mode 100644
index 00000000000..9958efcb41c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/easy2.tex
@@ -0,0 +1,135 @@
+ % These are all easy differentiation problems
+
+\begin{defproblem}{diffeasy:gpowh}%
+\begin{onlyproblem}%
+\(f(x) = g(x)^{h(x)}.\)%
+\end{onlyproblem}%
+\begin{onlysolution}%
+\begin{eqnarray*}
+f(x) & = & e^{\ln g(x)^{h(x)}}\\
+ & = & e^{h(x)\ln g(x)}\\
+f'(x) & = & e^{h(x)\ln g(x)}(h'(x)\ln g(x) + h(x)\frac{g'(x)}{g(x)})\\
+ & = & g(x)^{h(x)}(h'(x)\ln g(x) + \frac{h(x)g'(x)}{g(x)})
+\end{eqnarray*}%
+\end{onlysolution}%
+\end{defproblem}
+
+\begin{defproblem}{diffeasy:arcsin}%
+\begin{onlyproblem}%
+\(y = \arcsin(x)\)%
+\end{onlyproblem}%
+\begin{onlysolution}%
+\[\sin(y) = x\]
+diff. w.r.t. $x$:
+\begin{eqnarray*}
+\cos y \frac{dy}{dx} & = & 1\\
+\frac{dy}{dx} & = & \frac{1}{\cos y}\\
+ & = & \frac{1}{\sqrt{1 - \sin^2y}}\\
+ & = & \frac{1}{\sqrt{1-x^2}}.
+\end{eqnarray*}
+\end{onlysolution}%
+\end{defproblem}
+
+\begin{defproblem}{diffeasy:arccos}%
+\begin{onlyproblem}%
+$y = \arccos x$.%
+\end{onlyproblem}%
+\begin{onlysolution}%
+\(\cos y = x\)
+diff. w.r.t. $x$:
+\begin{eqnarray*}
+-\sin y \frac{dy}{dx} & = & 1\\
+\frac{dy}{dx} & = & \frac{-1}{\sin y}\\
+ & = & \frac{-1}{\sqrt{1-\cos^2y}}\\
+ & = & \frac{-1}{\sqrt{1-x^2}}
+\end{eqnarray*}
+\end{onlysolution}%
+\end{defproblem}
+
+\begin{defproblem}{diffeasy:tan}%
+\begin{onlyproblem}%
+\(y = \tan x\)%
+\end{onlyproblem}
+\begin{onlysolution}%
+\begin{eqnarray*}
+y & = & \tan x\\
+ & = & \frac{\sin x}{\cos x}\\
+\frac{dy}{dx} & = & \frac{\cos x}{\cos x} + \sin x\times\frac{-1}{\cos^2x}\times -\sin x\\
+ & = & 1 + \tan^2x\\
+ & = & \sec^2x.
+\end{eqnarray*}
+\end{onlysolution}%
+\end{defproblem}
+
+\begin{defproblem}{diffeasy:arctan}%
+\begin{onlyproblem}%
+\(y = \arctan x = \tan^{-1}x\)%
+\end{onlyproblem}%
+\begin{onlysolution}%
+\[\tan y = x\]
+diff w.r.t. $x$:
+\begin{eqnarray*}
+\sec^2y\frac{dy}{dx} & = & 1\\
+\frac{dy}{dx} & = & \frac{1}{\sec^2y}\\
+ & = & \frac{1}{1+\tan^2y}\\
+ & = & \frac{1}{1+x^2}
+\end{eqnarray*}
+\end{onlysolution}%
+\end{defproblem}
+
+\begin{defproblem}{diffeasy:cot}%
+\begin{onlyproblem}%
+\(y = (\tan x)^{-1} = \cot x\)%
+\end{onlyproblem}
+\begin{onlysolution}%
+\begin{eqnarray*}
+\frac{dy}{dx} & = & -(\tan x)^{-2}\sec^2x\\
+ & = & -\frac{\cos^2x}{\sin^2x}\cdot\frac{1}{\cos^2x}\\
+ & = & \frac{-1}{\sin^2x}\\
+ & = & -\csc^2x.
+\end{eqnarray*}
+\end{onlysolution}%
+\end{defproblem}
+
+\begin{defproblem}{diffeasy:cosxsqsinx}%
+\begin{onlyproblem}%
+$y = \cos(x^2)\sin x$.%
+\end{onlyproblem}%
+\begin{onlysolution}%
+\[\frac{dy}{dx} = -\sin(x^2)2x\sin x + \cos(x^2)\cos x\]
+\end{onlysolution}%
+\end{defproblem}
+
+\begin{defproblem}{diffeasy:xlnx}%
+\begin{onlyproblem}%
+$y = (x+1)\ln(x+1)$.
+\end{onlyproblem}%
+\begin{onlysolution}%
+\begin{eqnarray*}
+\frac{dy}{dx} & = & \ln(x+1) + \frac{x+1}{x+1}\\
+ & = & 1 + \ln(x+1).
+\end{eqnarray*}
+\end{onlysolution}
+\end{defproblem}
+
+\begin{defproblem}{diffeasy:glng}%
+\begin{onlyproblem}%
+$f(x) = g(x)\ln(g(x))$.
+\end{onlyproblem}
+\begin{onlysolution}%
+\begin{eqnarray*}
+f'(x) & = & g'(x)\ln(g(x)) + \frac{g(x)}{g(x)}g'(x)\\
+ & = & g'(x)(1+\ln(g(x))).
+\end{eqnarray*}
+\end{onlysolution}%
+\end{defproblem}
+
+\begin{defproblem}{diffeasy:sinx/x}
+\begin{onlyproblem}%
+$y = \frac{\sin x}{x}$.
+\end{onlyproblem}
+\begin{onlysolution}%
+\[\frac{dy}{dx} = \frac{\cos x}{x} - \frac{\sin x}{x^2}\]
+\end{onlysolution}%
+\end{defproblem}
+
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/implicit.tex b/Master/texmf-dist/doc/latex/probsoln/samples/implicit.tex
new file mode 100644
index 00000000000..7f37fe0041f
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/implicit.tex
@@ -0,0 +1,41 @@
+ % These are all implicit differentiation problems
+
+\newproblem{imd:circ}{%
+Find the gradient of the unit circle ($x^2 + y^2 = 1$).}{%
+Differentiating with respect to $x$ gives:
+\begin{eqnarray*}
+2x + 2y\frac{dy}{dx} & = & 0\\
+\frac{dy}{dx} & = & \frac{-2x}{2y}\\
+ & = & \frac{-x}{\sqrt{1-x^2}}.
+\end{eqnarray*}}
+
+\newproblem{imd:ysq:xcuov2mx}{%
+Find $\frac{dy}{dx}$, given
+\begin{displaymath}
+y^2 = \frac{x^3}{2-x}
+\end{displaymath}}{%
+Differentiating both sides w.r.t.\ $x$:
+\begin{eqnarray*}
+2y\frac{dy}{dx} & = & \frac{(2-x)3x^2 - x^3(-1)}{(2-x)^2}\\
+ & = & \frac{3x^2(2-x) + x^3}{(2-x)^2}\\
+ & = & \frac{6x^2 - 3x^3 + x^3}{(2-x)^2}\\
+ & = & \frac{6x^2-2x^3}{(2-x)^2}\\
+ & = & 2x^2\frac{3-x}{(2-x)^2}
+\end{eqnarray*}
+Therefore
+\begin{displaymath}
+y\frac{dy}{dx} = x^2\frac{3-x}{(2-x)^2}
+\end{displaymath}}
+
+\newproblem{imd:exy:IIxay}{%
+Differentiate w.r.t.\ $x$:
+\begin{displaymath}
+e^{xy} = 2x + y
+\end{displaymath}}{%
+Differentiating both sides w.r.t.\ $x$:
+\begin{eqnarray*}
+e^{xy}(1y + x\frac{dy}{dx}) & = & 2 + \frac{dy}{dx}\\
+xe^{xy}\frac{dy}{dx} - \frac{dy}{dx} & = & 2 - ye^{xy} \\
+\frac{dy}{dx}(xe^{xy}-1) & = & 2 - ye^{xy}\\
+\frac{dy}{dx} & = & \frac{2-ye^{xy}}{xe^{xy}-1}
+\end{eqnarray*}}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/mchoice.tex b/Master/texmf-dist/doc/latex/probsoln/samples/mchoice.tex
new file mode 100644
index 00000000000..7add557a680
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/mchoice.tex
@@ -0,0 +1,34 @@
+\newproblem{mc:prod}{%
+Which of the following is the derivative of $x\sin(x)$?
+(Circle the correct answer.)
+\ifthenelse{\boolean{showanswers}}{}%
+{\begin{description}
+\item[A] $\sin(x)$
+\item[B] $x\cos(x)$
+\item[C] $\sin(x) + x\cos(x)$
+\end{description}
+}}{%
+\begin{description}
+\item[A] $\sin(x)$
+\item[B] $x\cos(x)$
+\item[\textcircled{C}] $\sin(x) + x\cos(x)$ (product rule).
+\end{description}
+}
+
+\newproblem{mc:quot}{%
+Which of the following is the derivative of $\frac{\sin(x)}{x}$?
+(Circle the correct answer.)
+\ifthenelse{\boolean{showanswers}}{}%
+{\begin{description}
+\item[A] $\sin(x)$
+\item[B] $\cos(x)$
+\item[C] $\frac{\cos(x)x-\sin(x)}{x^2}$
+\end{description}
+}}{%
+\begin{description}
+\item[A] $\sin(x)$
+\item[B] $\cos(x)$
+\item[\textcircled{C}] $\frac{\cos(x)x-\sin(x)}{x^2}$
+(quotient rule)
+\end{description}
+}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/newdata.tex b/Master/texmf-dist/doc/latex/probsoln/samples/newdata.tex
new file mode 100644
index 00000000000..82179a34ef0
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/newdata.tex
@@ -0,0 +1,26 @@
+\begin{defproblem}{sample}
+\begin{onlyproblem}
+Differentiate $y=\sin x$
+\end{onlyproblem}
+\begin{onlysolution}
+$y'=\cos x$
+\end{onlysolution}
+\end{defproblem}
+
+\begin{defproblem}[1]{sample2}
+\begin{onlyproblem}
+Differentiate $y = \sin(#1x)$
+\end{onlyproblem}
+\begin{onlysolution}
+$y'=#1\cos #1x$
+\end{onlysolution}
+\end{defproblem}
+
+\begin{defproblem}{sample3}
+\begin{onlyproblem}
+Differentiate $y = x^2$.
+\end{onlyproblem}
+\begin{onlysolution}
+$y' = 2x$
+\end{onlysolution}
+\end{defproblem}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/nosoln.tex b/Master/texmf-dist/doc/latex/probsoln/samples/nosoln.tex
new file mode 100644
index 00000000000..96ea6438aaa
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/nosoln.tex
@@ -0,0 +1,7 @@
+ % these problems don't have solutions
+
+\newproblem*{oop}{Describe what is meant by object-oriented
+programming.}
+
+\newproblem*{inheritance}{Describe what is meant by the term
+\emph{inheritance} in object-oriented programming. Use examples.}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/probspaces.tex b/Master/texmf-dist/doc/latex/probsoln/samples/probspaces.tex
new file mode 100644
index 00000000000..48f7c3c53d8
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/probspaces.tex
@@ -0,0 +1,31 @@
+ % Finite probability spaces
+\newproblem{weightedcoin}{%
+A coin is weighted so that heads is four times as likely
+as tails. Find the probability that:
+\begin{textenum}
+\item tails appears,
+\item heads appears
+\end{textenum}}{%
+Let $p=P(T)$, then $P(H)=4p$. We require $P(H)+P(T)=1$,
+so $4p+p=1$, hence $p=\frac{1}{5}$. Therefore:
+\begin{textenum}
+\item $P(T)=\frac{1}{5}$,
+\item $P(H)=\frac{4}{5}$
+\end{textenum}}
+
+\newproblem*{validprobspaces}{%
+Under which of the following functions does
+$S=\{a_1,a_2\}$ become a probability space?
+\par
+\begin{textenum}
+\begin{tabular}{ll}
+\incorrectitem $P(a_1)=\frac{1}{3}$, $P(a_2)=\frac{1}{2}$
+&
+\correctitem $P(a_1)=\frac{3}{4}$, $P(a_2)=\frac{1}{4}$
+\\
+\correctitem $P(a_1)=1$, $P(a_2)=0$
+&
+\incorrectitem $P(a_1)=\frac{5}{4}$, $P(a_2)=-\frac{1}{4}$
+\end{tabular}
+\end{textenum}
+}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/probspaces2.tex b/Master/texmf-dist/doc/latex/probsoln/samples/probspaces2.tex
new file mode 100644
index 00000000000..26839b65293
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/probspaces2.tex
@@ -0,0 +1,41 @@
+ % Finite probability spaces
+\begin{defproblem}{weightedcoin}
+\begin{onlyproblem}%
+A coin is weighted so that heads is four times as likely
+as tails. Find the probability that:
+\begin{textenum}
+\item tails appears,
+\item heads appears
+\end{textenum}
+\end{onlyproblem}
+\begin{onlysolution}%
+Let $p=P(T)$, then $P(H)=4p$. We require $P(H)+P(T)=1$,
+so $4p+p=1$, hence $p=\frac{1}{5}$. Therefore:
+\begin{textenum}
+\item $P(T)=\frac{1}{5}$,
+\item $P(H)=\frac{4}{5}$
+\end{textenum}
+\end{onlysolution}
+\end{defproblem}
+
+\begin{defproblem}{validprobspaces}
+\begin{onlyproblem}%
+Under which of the following functions does
+$S=\{a_1,a_2\}$ become a probability space?
+\par
+\begin{textenum}
+\begin{tabular}{ll}
+\item $P(a_1)=\frac{1}{3}$, $P(a_2)=\frac{1}{2}$
+&
+\item\label{validprobspacescorrect1} $P(a_1)=\frac{3}{4}$, $P(a_2)=\frac{1}{4}$
+\\
+\item\label{validprobspacescorrect2} $P(a_1)=1$, $P(a_2)=0$
+&
+\item $P(a_1)=\frac{5}{4}$, $P(a_2)=-\frac{1}{4}$
+\end{tabular}
+\end{textenum}
+\end{onlyproblem}%
+\begin{onlysolution}%
+\ref{validprobspacescorrect1} and \ref{validprobspacescorrect2}%
+\end{onlysolution}
+\end{defproblem}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample.tex
new file mode 100644
index 00000000000..e80c8dff020
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample.tex
@@ -0,0 +1,42 @@
+\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}
+\PSNrandseed{2007}
+
+\begin{document}
+\title{Sample Problem Sheet}
+\author{Nicola Talbot}
+\maketitle
+
+\begin{enumerate}
+ % Differentiation from first principles
+\selectrandomly{1stprncp}{1}
+
+\item Differentiate the following functions:
+\newcount\oldseed
+\PSNgetrandseed\oldseed
+\begin{enumerate}
+\selectrandomly{easy}{5}
+\end{enumerate}
+\PSNrandseed\oldseed
+
+ % Implicit differentiation
+\selectrandomly{implicit}{2}
+
+ % Finite probability spaces
+\selectrandomly{probspaces}{2}
+
+ % Multiple choice question
+\selectrandomly{mchoice}{1}
+
+ % select one essay style question that doesn't come with a solution
+
+\selectrandomly{nosoln}{1}
+\end{enumerate}
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample2.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample2.tex
new file mode 100644
index 00000000000..e82656c9f3a
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample2.tex
@@ -0,0 +1,47 @@
+\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}{1stprncp,implicit}{\selectrandomly{\file}{\value{numproblems}}}
+
+\item Differentiate the following functions:
+\input{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}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample3.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample3.tex
new file mode 100644
index 00000000000..35252593b33
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample3.tex
@@ -0,0 +1,24 @@
+\documentclass[a4paper]{article}
+
+\usepackage{longtable}
+\usepackage{probsoln}
+
+ %\showanswers
+
+\newcounter{problem}
+\renewcommand{\PSNitem}{\refstepcounter{problem}%
+\theproblem. }
+\renewcommand{\endPSNitem}{\\}
+
+\renewenvironment{solution}{}{}
+
+\newcommand{\selected}{\fbox{$\times$}}
+\newcommand{\notselected}{\fbox{\phantom{$\times$}}}
+
+\begin{document}
+\begin{longtable}{lrrrl}
+\bfseries Question & \bfseries A & \bfseries B &
+\bfseries C & \ifshowanswers \bfseries Reason\fi\\
+\selectrandomly{tabmchoice}{2}
+\end{longtable}
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample4.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample4.tex
new file mode 100644
index 00000000000..f82eef21182
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample4.tex
@@ -0,0 +1,16 @@
+\documentclass[a4paper]{article}
+
+\usepackage{probsoln}
+
+ % Sample file illustrating use of \selectallproblems
+ % All problems defined in specified file will be used
+ % in order of definition
+
+\showanswers
+
+\begin{document}
+Differentiate the following functions:
+\begin{enumerate}
+\selectallproblems{easy}
+\end{enumerate}
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/sample5.tex b/Master/texmf-dist/doc/latex/probsoln/samples/sample5.tex
new file mode 100644
index 00000000000..531170b1d6d
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/sample5.tex
@@ -0,0 +1,34 @@
+\documentclass[a4paper]{report}
+
+\usepackage{probsoln}
+
+\begin{document}
+
+\hideanswers
+
+\chapter{Easy Problems}
+\loadrandomproblems[easyproblems]{5}{easy2}
+
+\renewcommand{\theenumi}{\thechapter.\arabic{enumi}}
+\begin{enumerate}
+\foreachproblem[easyproblems]{\item\label{prob:\thisproblemlabel}\thisproblem}
+\end{enumerate}
+
+\chapter{Probability Spaces}
+\loadrandomproblems[probspaces]{2}{probspaces2}
+
+\renewcommand{\theenumi}{\thechapter.\arabic{enumi}}
+\begin{enumerate}
+\foreachproblem[probspaces]{\item\label{prob:\thisproblemlabel}\thisproblem}
+\end{enumerate}
+
+\appendix
+\chapter{Solutions}
+\showanswers
+\begin{enumerate}
+\foreachdataset{\thisdataset}{%
+\foreachproblem[\thisdataset]{\item[\ref{prob:\thisproblemlabel}]\thisproblem}
+}
+\end{enumerate}
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/tabmchoice.tex b/Master/texmf-dist/doc/latex/probsoln/samples/tabmchoice.tex
new file mode 100644
index 00000000000..39cd1f10e41
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/probsoln/samples/tabmchoice.tex
@@ -0,0 +1,16 @@
+ % These problems are designed to be placed in a
+ % tabular environment
+ %
+\newproblem{tab:1}{%
+What is $(3+2)\times5$? &
+25 \ifshowanswers\selected\else\notselected\fi &
+13 \notselected &
+10 \notselected &
+}{Brackets come first}%
+
+\newproblem{tab:2}{%
+What is $-1+2\times3$? &
+3 \notselected &
+-7 \notselected &
+5 \ifshowanswers\selected\else\notselected\fi &
+}{Multiplication comes first}%