% -*- coding: utf-8 -*-
% !TEX program = xelatex
\documentclass[12pt,math=all]{randexam}

%\SetExamBoolFalse{answer} % hide answers

\SetExamOption{
  seed = 19061116, % random seed
}

\begin{document}

\examtitle{name=Math 1906 Final Exam,date=\today,version=A} % make exam title

\gradetable[total=4]

\exampart{Fill in the blanks.}[6 questions; 3 points for each; 18 points in total.]

% make answer table: six in total, three for each row, strut height 3em
\answertable[total=6,column=3,strut=3em]

\begin{question}
The first question $k>0$, text $f(x)=\ln x-\frac{x}{\e}+k$ text $(0,+\infty)$
text text text text text text text text text text text text text text text text
text text text text text text text text text text text text text \fillout{$2$}.
\end{question}

\bigskip

\begin{question}
The second question $\va=(2,1,2)$, $\vb=(4,-1,10)$, $\vc=\vb-\lambda\va$,
text text text $\va\bot\vc$, text text text text text text text text text
text text text text text $\lambda=$ \fillout{$3$}.
\end{question}

\bigskip

\begin{question}
The third question $\left|\begin{array}{cc}
  1  & 2\\
  -3 & x
\end{array}\right|=0$, text text text text text text text text
text text text text text text text text text $x=$ \fillout{$-6$}.
\end{question}

\bigskip

\begin{question}
The fourth question $\alpha_1=(1,1,0), \alpha_2=(0,1,1), \alpha_3=(1,0,1)$,
text $\beta=(4, 5, 3)$ text $\alpha_1, \alpha_2, \alpha_3$ text text text text 
text text text text text text text text text text text text text text text text
text text text text text text $\beta=$ \fillout{$3\alpha_1+2\alpha_2+\alpha_3$}.
\end{question}

\bigskip

\begin{question}%[points=3]
The fifth question $\xi$ text text text $E\xi=3, D\xi=2$, text text text text text
text text text text text text text text text text $E\xi^2=$ \fillout{$11$}.
\end{question}

\bigskip

\begin{question}
The sixth question $\xi$ text text text text $\eta$ text text text text $\xi\sim N(1,4),
\eta\sim N(2,5)$, text text text text text text text text text text text text text text
text text text text text text text text text text $\xi-2\eta\sim$ \fillout{$N(-3,24)$}.
\end{question}

\bigskip

\newpage

\exampart{Select one answer from four choices.}[6 questions; 3 points for each; 18 points in total.]

% make answer table: six in total, six for each row, default strut height
\answertable[total=6,column=6]

\begin{question}
The first question text, text text text text text text text text text text
text text text text text text text text text text text text text \pickout{C}
\begin{abcd}
\item first $\int f'(x)\dx=f(x)$
\item second $\int \d f(x)=f(x)$
\item third $\frac{\d}{\dx}\big(\int f(x)\dx\big)=f(x)$
\item fourth $\d\big(\int f(x)\dx\big)=f(x)$
\end{abcd}
\end{question}

\bigskip

\begin{question}
The second question $F(x)$ text $f(x)$ text, text \pickout{A}
\begin{abcd}
\item first choice $F(x)$ text $\Leftrightarrow$ $f(x)$ text
\item second choice $F(x)$ text text $\Leftrightarrow$ $f(x)$ text
\item third choice $F(x)$ text $\Leftrightarrow$ $f(x)$ text text
\item fourth choice $F(x)$ text text $\Leftrightarrow$ $f(x)$ text text
\end{abcd}
\end{question}

\bigskip

\begin{question}
The third question $A = \left(\begin{array}{ccc}
  1 & 1 & 0\\
  1 & x & 0\\
  0 & 0 & 1
\end{array}\right)$ text text $\lambda_1 = 1$ text $\lambda_2
= 2$, text $x=$ \pickout{B}
\begin{abcd}
\item $2$
\item $1$
\item $0$
\item $-1$
\end{abcd}
\end{question}

\bigskip

\begin{question}
The fourth question $f = 4 x_1^2 - 2 x_1 x_2 + 6 x_2^2$ text text text text text text
text text text text text text text text text text text text text text text \pickout{C}
\begin{abcd}
\item $\left(\begin{array}{cc}
  4 & - 2\\
  - 2 & 6
\end{array}\right)$
\item $\left(\begin{array}{cc}
  2 & - 2\\
  - 2 & 3
\end{array}\right)$
\item $\left(\begin{array}{cc}
  4 & - 1\\
  - 1 & 6
\end{array}\right)$
\item $\left(\begin{array}{cc}
  2 & - 1\\
  - 1 & 3
\end{array}\right)$
\end{abcd}
\end{question}

\bigskip

\begin{question}
The fifth question \underline{wrong} text \pickout{B}
\begin{abcd}
\item first choice text text text text text text text text text
\item second choice text text text text text text text text text
\item third choice text text text text text text text text text
\item fourth choice text text text text text text text text text
\end{abcd}
\end{question}

\bigskip

\begin{question}
The sixth question $X$ text $(X_1,\cdots,X_n)$ text \underline{wrong} text text
text text text text text text text text text text text text text text \pickout{D}
\begin{abcd}
\item text text text
\item text $n$ text
\item $X_1, \cdots, X_n$ text
\item $X_1 = X_2 =\cdots = X_n$
\end{abcd}
\end{question}

\bigskip

\newpage

\exampart{Work out math questions.}[6 questions; 8 points for each; 48 points in total.]

\begin{question}
The first question $\int\e^{2x}\,(\tan x+1)^2\dx$.
\end{question}

\smallskip

\begin{solution}
$I$ \? $=\int\e^{2x}\,\sec^2 x\dx+2\int\e^{2x}\,\tan x\dx$ \points{2}
\+ $=\int\e^{2x}\,\d(\tan x)+ 2\int\e^{2x}\,\tan x\dx$ \points{4}
\+ $=\e^{2x}\,\tan x - 2\int\e^{2x}\,\tan x\dx+ 2\int\e^{2x}\,\tan x\dx$ \points{6}
\+ $=\e^{2x}\,\tan x + C$ \points{8}
\end{solution}

\vfill

\begin{question}
The second question $A(1,2,-1), B(2,3,0),C(3,3,2)$ text $\triangle ABC$ text text text text text text.
\end{question}

\smallskip

\begin{solution}
Text $\overrightarrow{AB}=(1,1,1),\overrightarrow{AC}=(2,1,3)$, \points{2}
text $\overrightarrow{AB}\times \overrightarrow{AC}=\begin{vmatrix}
\vec{i}&\vec{j} &\vec{k}\\
1&1&1\\
2&1&3\\
\end{vmatrix}=(2,-1,-1)$, \points{4}
text $\triangle ABC$ text $S_{\triangle ABC}=\frac{1}{2}\big|\overrightarrow{AB}\times
\overrightarrow{AC}\big|=\frac{1}{2}\sqrt{6}.$ \points{6}
Text text $2(x-2)-(y-3)-z=0$, text $2x-y-z-1=0$. \points{8}
\end{solution}

\vfill

\newpage

\begin{question}
The third question $A = \left|\begin{array}{cccc}
  0 & 1 & 2 & 3\\
  1 & 2 & 3 & 0\\
  2 & 3 & 0 & 1\\
  3 & 0 & 1 & 2
\end{array}\right|$ text.
\end{question}

\smallskip

\begin{solution}
$A \? = \left|\begin{array}{cccc}
    0 & 1 & 2 & 3\\
    1 & 2 & 3 & 0\\
    2 & 3 & 0 & 1\\
    3 & 0 & 1 & 2
  \end{array}\right| = \left|\begin{array}{cccc}
    0 & 1 & 2 & 3\\
    1 & 2 & 3 & 0\\
    0 & - 1 & - 6 & 1\\
    0 & - 6 & - 8 & 2
  \end{array}\right| = 1 \cdot (- 1)^{2 + 1} \left|\begin{array}{ccc}
    1 & 2 & 3\\
    - 1 & - 6 & 1\\
    - 6 & - 8 & 2
  \end{array}\right|$ \points{4}
\+ $= -\left|\begin{array}{ccc}
    1 & 2 & 3\\
    0 & - 4 & 4\\
    0 & 4 & 20
  \end{array}\right| = - \left|\begin{array}{cc}
    - 4 & 4\\
    4 & 20
  \end{array}\right| = -(-4\cdot20-4\cdot4) = 96$ \points{8}
\end{solution}

\vfill

\begin{question}
The fourth question, tex text $f = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12
x_2 x_3 + 9 x^2_3$ text text $f = d_1 y^2_1 + d_2 y^2_2 + d_3 y^2_3$.
\end{question}

\smallskip

\begin{solution}
$f \? = x_1^2 + 2 x_1 x_2 - 6 x_1 x_3 + 2 x_2^2 - 12 x_2 x_3 + 9 x^2_3$ \par
  \+ $= x_1^2 + 2 x_1 (x_2 - 3 x_3) + (x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3 $ \par
  \+ $= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 6 x_2 x_3$ \points{3}
  \+ $= (x_1 + x_2 - 3 x_3)^2 + x_2^2 - 2 x_2 \cdot 3 x_3 + (3 x_3)^2 - 9x_3^2$ \par
  \+ $= (x_1 + x_2 - 3 x_3)^2 + (x_2 - 3 x_3)^2 - 9 x_3^2$ \points{6}
Text $y_1 = x_1 + x_2 - 3 x_3, y_2 = x_2 - 3 x_3, y_3 = x_3$, \newline
text $f = y_1^2 + y_2^2 - 9y_3^2$ text.\points{8}
\end{solution}

\vfill

\newpage

\begin{question}
The fifth question text text text $0.2$ text text, text text $100$ text text.\par
(1) text text text text text text $\xi$ text $10$ text $30$ text.\par
(2) text text text text text $\xi$ text $10$ text $30$ text.
\end{question}

\smallskip

\begin{solution}
$E\xi = n p = 100 \cdot 0.2 = 20, D\xi = n p q = 100 \cdot 0.2 \cdot 0.8 = 16$. \points{2}
(1) $P (10 < \xi < 30) = P (|\xi - E\xi| < 10) \ge 1 - \frac{D\xi}{10^2}
     = 1 - \frac{16}{100} = 0.84$. \points{4}
(2) $P (10 < \xi < 30) \? \approx \Phi_0\left(\frac{30 - 20}{\sqrt{16}}\right)
         - \Phi_0\left(\frac{10 - 20}{\sqrt{16}}\right)$ \points{6}
      \+ $= 2 \Phi_0(2.5) - 1 = 2 \cdot 0.9938 - 1 =0.9876$ \points{8}
\end{solution}

\vfill

\begin{question}
The sixth question $N(\mu,\sigma^2)$ text text $16$ text, text text text $3160$, text text $100$.
Text text $H_0:\mu=3140$ text text ($\alpha = 0.01$).
\end{question}

\smallskip

\begin{solution}
(1) Text text $H_0 : \mu = 3140$. \points{2}
(2) Text text text $T = \frac{\widebar{X}-\mu}{S / \sqrt{n}} \sim t(n-1)$. \points{3}
(3) Text text $t_{\alpha} = t_{\alpha} (n - 1) = t_{0.01} (15) =2.947$. \points{5}
(4) Text text text $t = \frac{\widebar{x} - \mu_0}{s/\sqrt{n}} =\frac{3160-3140}{100/4} = 0.8$.\points{7}
(5) Text $| t | < t_{\alpha}$, text text $H_0$, text text text. \points{8}
\end{solution}

\vfill

\newpage

\exampart{Work out math proofs.}[2 questions; 16 points in total.]

\SetExamTranslation{solution-Solution=Proof} % rename "Solution" as "Proof"

\begin{question}[points=9]
The first question $\{x_n\}$ text $x_1=\sqrt2$, $x_{n+1}=\sqrt{2+x_n}$.
Text text text, text text text.
\end{question}

\smallskip

\begin{solution}
(1) Text, text $x_1<2$, text $x_k<2$ text
$$x_{k+1}=\sqrt{2+x_k}<\sqrt{2+2}=2,$$
Text text text text text $n$ text $x_n<2$, text text text.
Text text
$$\frac{x_{n+1}}{x_n}=\sqrt{\frac{2}{x_n^2}+\frac{1}{x_n}}>\sqrt{\frac{2}{2^2}+\frac{1}{2}}=1,$$
Text text text text text. Text text text text text, Text text text text.\points{4}
(2) Text text text text $A$, text text text text text text
$$A=\sqrt{2+A}.$$
Text text $A=2$, text text $\{x_n\}$ text text text $2$.\points{8}
\end{solution}

\vfill

\begin{question}[points=7]
The second question $A$ text $B$ text, text $A$ text $\widebar{B}$ text.
\end{question}

\smallskip

\begin{solution}
\? $P (A \cdot \widebar{B}) = P (A - B) = P (A - A B)$ \points{2}
\< $= P (A) - P (A B) = P (A) - P (A) P (B)$ \points{4}
\< $= P (A) (1 - P (B)) = P (A) P (\widebar{B})$ \points{6}
Text text text $A$ text text text $\widebar{B}$ text text text.\points{8}
\end{solution}

\vfill

\examdata{Some data may be used in the exam} % appendix data

\begin{tabularx}{\linewidth}{*{4}{>{$}X<{$}}}
\hline
\Phi_0(0.5)=0.6915 & \Phi_0(1)=0.8413 & \Phi_0(2)=0.9773 & \Phi_0(2.5)=0.9938 \\
t_{0.01}(8)=3.355 & t_{0.01}(9)=3.250 & t_{0.01}(15)=2.947 & t_{0.01}(16)=2.921 \\
\chi_{0.005}^2(8)=22.0 & \chi_{0.005}^2(9)=23.6 & \chi_{0.005}^2(15)=32.8 & \chi_{0.005}^2(16)=34.3 \\
\chi_{0.995}^2(8)=1.34 & \chi_{0.995}^2(9)=1.73 & \chi_{0.995}^2(15)=4.60 & \chi_{0.995}^2(16)=5.14 \\
\hline
\end{tabularx}

\end{document}
