代码

代码

这可以看作是该问题的后续:使用 xsim 包正确定义问题和子问题

我还没有接受这个问题,因为我还在尝试将我的 tex 发行版更新到最新版本以全面测试答案。然而,从答案中我能够想出自己的解决方案,这让我想到了这个问题

背景

我想收集不同大学的微积分 1 历年考试题目,给它们贴上标签,然后将它们分成exercisessubquestions。这些exercises是主要的考试题目,看起来像这样

在此处输入图片描述

subquestions是一个部分其中exercises独立存在。想想“问题 1b”,其中“1b”不依赖于“1a”或其他信息(例如问题的介绍文本)。因此,可以混合搭配subquestions

目标

我想exercises从这些考试中抽取不同的主题

理想情况下,我想采样 1-2 个关于积分、导数、微分方程和复数的问题。

问题

大约有 4 所大学提供这些课程,通常每年举行 2 次考试,每次考试约有 4-8 道题。我想从过去 5 年的考试中抽取一些题目。如果他们平均每次考试有 6 道题,那么我就可以大致250 exercises抽取一些题目了。

在下面的例子中,我仅包括了1每年每所大学的考试,1仅提供了 24 份exercises样本。

采样仅有的标记的问题integration给了我超过 58 个辅助文件。

在此处输入图片描述

为所有四个创建集合使问题更加严重

编译时间大约需要一两分钟complex,当我将所有四个都包括在内时,30 分钟后仍未完成。

不寒而栗当我考虑从全部 250 个问题中抽样完成编译需要多少周的时间时。

问题

  • 有没有更好的方法来使用不同的标签进行抽样(随机挑选问题)?我是否必须为每个标签创建一个单独的唯一集合?

  • 为什么要xsim创建这么多aux文件?有没有什么办法可以让它平静下来?

  • 为什么编译时间需要永远当将数量增加到exercises大约时,是否有一种方法可以使其在合理的时间内(例如几分钟)进行编译250

代码

主文本

\documentclass{article}
\usepackage{amssymb,mathtools}
\usepackage[ISO]{diffcoeff}
\usepackage{tasks}
\usepackage{xsim}

\providecommand*\e{e}

\DeclareExerciseType{subquestion}{
  exercise-env = question ,
  solution-env = answer ,
  exercise-name = Question ,
  solution-name = Answer ,
  exercise-template = item ,
  solution-template = item
}
\DeclareExerciseTagging{year} % 1992, 2010, etc
\DeclareExerciseTagging{topic}
\DeclareExerciseTagging{semester} % V (Spring), H (Fall)
\DeclareExerciseTagging{exam} % O (ordinary), K (kont / re-sit exam), P (prøveeksamen)
\DeclareExerciseTagging{university} % UiO, UiB, UiT, etc
\DeclareExerciseProperty{title}
\DeclareExerciseTagging{type}

\DeclareExerciseEnvironmentTemplate{named}
  {\subsection*{\GetExercisePropertyTF{title}{#1}{??}}}
  {}

\DeclareExerciseEnvironmentTemplate{item}
  {\item}
  {}

\xsimsetup{
  exercise/template = named,
  exercise/begin-hook = \renewcommand\theenumi{\alph{enumi}},
}

\DeclareExerciseCollection{MAT}

\DeclareExerciseCollection{integral}
\DeclareExerciseCollection{derivative}
\DeclareExerciseCollection{complex}
\DeclareExerciseCollection{ODE}

\newcommand*\includeQuestion[1]{%
    \XSIMexpandcode{\printexercise{subquestion}{\GetExerciseIdForProperty{ID}{#1}}}%
}

\newcommand*\includeProblem[1]{%
    \XSIMexpandcode{\printexercise{exercise}{\GetExerciseIdForProperty{ID}{#1}}}%
}

\usepackage{csquotes}
\usepackage{multicol}

\begin{document}

% \collectexercises{integral}
% \xsimsetup{type=prob, topic=integral}
%     \input{UiO/MAT1100/MAT1100-2015-2019}
%     \input{UiB/MAT111/MAT111-2015-2019}
%     \input{UiT/MAT-1001/MAT-1001-2015-2019}
%     \input{UiS/MAT100/MAT111-2015-2019}
% \collectexercisesstop{integral}

% \collectexercises{derivative}
% \xsimsetup{type=prob, topic=derivative}
%     \input{UiO/MAT1100/MAT1100-2015-2019}
%     \input{UiB/MAT111/MAT111-2015-2019}
%     \input{UiT/MAT-1001/MAT-1001-2015-2019}
%     \input{UiS/MAT100/MAT111-2015-2019}
% \collectexercisesstop{derivative}

\collectexercises{complex}
\xsimsetup{type=prob}
      \input{main-problems.tex}
    % \input{UiO/MAT1100/MAT1100-2015-2019}
    % \input{UiB/MAT111/MAT111-2015-2019}
    % \input{UiT/MAT-1001/MAT-1001-2015-2019}
    % \input{UiS/MAT100/MAT111-2015-2019}
\collectexercisesstop{complex}

% \collectexercises{ODE}
% \xsimsetup{type=prob, topic=ODE}
%     \input{UiO/MAT1100/MAT1100-2015-2019}
%     \input{UiB/MAT111/MAT111-2015-2019}
%     \input{UiT/MAT-1001/MAT-1001-2015-2019}
%     \input{UiS/MAT100/MAT111-2015-2019}
% \collectexercisesstop{ODE}


% \printcollection{MAT}

\printrandomexercises[collection=complex]{1}

% \printrandomexercises[collection=derivative]{1}

% \printrandomexercises[collection=integral]{1}

% \printrandomexercises[collection=ODE]{1}

\end{document}

主要问题.tex

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT-1001-2019-H-O-Problem-1-a,
  university = {UiT},
  topic = {complex, root}
  ]
  Det komplekse tallet $z_1 = 1 + i \sqrt{2}$ er en løsning til annengradslikningen
  
  \begin{equation*}
      z^2 - 2z + 3 = 0.
  \end{equation*}
  
  Finn den andre løsningen $z_2$. Regn så ut tallet $z_1^2 + z_2^2$.
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT-1001-2019-H-O-Problem-1-b,
  university = {UiT},
  topic = {complex, root, figure}
  ]
  Finn alle tre tredjegradsrøttene til $8$ på form $\rho e^{i\theta}$ og merk
  dem av som punktet på en skisse av det komplekse planet. Pass på å merke av
  enhetene $1$ og $i$ på aksene.
\end{question}

\begin{exercise}[
  year=2019,semester=H,type={prob},exam=O,
  topic={complex, root, figure},
  ID=MAT-1001-2019-H-O-Problem-1,
  university = {UiT},
  title={Oppgave~1 (H19, UiT)}]
  \begin{enumerate}
    \includeQuestion{MAT-1001-2019-H-O-Problem-1-a}
    \includeQuestion{MAT-1001-2019-H-O-Problem-1-b}
  \end{enumerate}
\end{exercise}







\begin{exercise}[year=2019,semester=H,type={prob},
  topic={concavity,monotonicity,limit},exam=O,
  ID=MAT-1001-2019-H-O-Problem-1,
  university = {UiT},
  title={Oppgave~2 (H19, UiT)}]
  En kontinuerlig funksjon $f\colon [0, \infty) \to \mathbb{R}$ er gitt ved
  
  \begin{equation*}
      f(x) = x^2 \log x, \qquad \text{når} > 0.
  \end{equation*}
  \begin{enumerate}
    \item Avgjør hvor $f$ er voksende/avtagende på $(0, \infty)$.
    \item Avgjør hvor $f$ er konveks/konkav på $(0, \infty)$.
    \item Regn ut grensen
    
    \begin{equation*}
        \lim_{x \to 0^+} x^2 \log x
    \end{equation*}
    
    og finn funksjonsverdien $f(0)$. Hva er minimumsverdien til $f$?
  \end{enumerate}
\end{exercise}







\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT-1001-2019-H-O-Problem-3-a,
  university = {UiT},
  topic = {ODE,2-order,homogeneous}
  ]
  For differensiallikningen
  
  \begin{equation*}
      u''(x) - 5 u'(x) + 6 u(x) = 0,\phantom{e^x}
  \end{equation*}
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT-1001-2019-H-O-Problem-3-b,
  university = {UiT},
  topic = {IVT,ODE,2-order,nonhomogeneous}
  ]
  For differensiallikningen
  \begin{equation*}
      u''(x) - 5 u'(x) + 6 u(x) = 2e^x,
  \end{equation*}
  
  Løs startverdiproblemet $y(0)=y'(0)=0$.
\end{question}

\begin{exercise}[
  year=2019,semester=H,type={prob},exam=O,
  topic={IVT,ODE,2-order,nonhomogeneous,homogeneous},
  ID=MAT-1001-2019-H-O-Problem-3,
  university = {UiT},
  title={Oppgave~3 (H19, UiT)}]
  \begin{enumerate}
    \includeQuestion{MAT-1001-2019-H-O-Problem-3-a}
    \includeQuestion{MAT-1001-2019-H-O-Problem-3-b}
  \end{enumerate}
\end{exercise}







\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT-1001-2019-H-O-Problem-4-a,
  university = {UiT},
  topic = {integral, IBP, substitution}
  ]
  Regn ut integralene
  
  \begin{equation*}
      \int \frac{e^x + 1}{(e^x + 1)^2} \dl x
      \quad \text{og} \quad
      \int_1^e x \log^2(x) \dl x
  \end{equation*}
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT-1001-2019-H-O-Problem-4-b,
  university = {UiT},
  topic = {integral, FTC, linear-approximation}
  ]
  Integralet
  
  \begin{equation*}
      \int_0^{2\pi} \frac{\dl u}{5 + 3 \cos(u)} = \frac{\pi}{2}
  \end{equation*}
  
  er oppgitt. Finn for funksjonen
  
  \begin{equation*}
      F(x) = \int_0^{x} \frac{\dl u}{5 + 3 \cos(u)}
  \end{equation*}
  
  den beste lineære tilnærmingen omrking punktet $x = 2\pi$.
  Vær nøye med din begrunnelse.
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT-1001-2019-H-O-Problem-4-c,
  university = {UiT},
  topic = {continuous,differentiable}
  ]
  En funksjon $g\colon[0,1] \to [0,1]$ er definert ved $g(1) = 1$, og
  
  \begin{equation*}
      g(x) = \frac{k - 1}{k} \cdot x \quad \text{og} \quad
      \frac{k - 1}{k} \leq x < \frac{k}{k+1} \quad \text{når} \quad
      k = 1, 2, 3, \ldots
  \end{equation*}
  
  Er $g$ kontinuerlig? Er $g$ integrerbar? Begrunn dine svar.
\end{question}

\begin{exercise}[
  year=2019,semester=H,type={prob},exam=O,
  topic={integral, IBP, substitution,FTC,
        linear-approximation,continuous,differentiable},
  ID=MAT-1001-2019-H-O-Problem-4,
  university = {UiT},
  title={Oppgave~4 (H19, UiT)}]
  \begin{enumerate}
    \includeQuestion{MAT-1001-2019-H-O-Problem-4-a}
    \includeQuestion{MAT-1001-2019-H-O-Problem-4-b}
    \includeQuestion{MAT-1001-2019-H-O-Problem-4-c}
  \end{enumerate}
\end{exercise}







\begin{question}[
  year=2018,semester=V,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-1-a,
  university = {UiS},
  topic = {complex}
  ]
  Gitt $z = 1 + 2i$ og $w = 3 - i$. Regn ut $z^2$, $|z|$ og $z/w$.
\end{question}

\begin{question}[
  year=2018,semester=H,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-1-b,
  university = {UiS},
  topic = {complex, polar, normalform}
  ]
  Skriv $a = 1  \sqrt{-3}i$ og $b=-2i$ på eksponentiell form og
  finn $a^3 b^4$. Skriv svaret på kartesisk form.
\end{question}

\begin{question}[
  year=2018,semester=H,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-1-c,
  university = {UiS},
  topic = {complex, root}
  ]
  For hvilke positive heltall $n$ er $i^n = -1$?
\end{question}

\begin{exercise}[
  year=2018,semester=H,type={prob},exam=O,
  topic={complex, root, polar, normalform},
  ID=MAT100-2018-V-O-Problem-1,
  university = {UiS},
  title={Oppgave~1 (H18, UiS)}]
  \begin{enumerate}
    \includeQuestion{MAT100-2018-V-O-Problem-1-a}
    \includeQuestion{MAT100-2018-V-O-Problem-1-b}
    \includeQuestion{MAT100-2018-V-O-Problem-1-c}
  \end{enumerate}
\end{exercise}







\begin{question}[
  year=2018,semester=V,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-2-a,
  university = {UiS},
  topic = {integral,trigonometric}
  ]
  $\displaystyle \int \bigl(2x^{5/3} + \cos x) \dl x$
\end{question}

\begin{question}[
  year=2018,semester=H,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-2-b,
  university = {UiS},
  topic = {integral,logarithm,IBP}
  ]
  $\displaystyle \int x^2 \log x \dl x$
\end{question}

\begin{question}[
  year=2018,semester=H,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-2-c,
  university = {UiS},
  topic = {integral,substitution}
  ]
  $\displaystyle \int \frac{x^2}{\sqrt{2x^3 + 1}} \dl x$
\end{question}

\begin{question}[
  year=2018,semester=H,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-2-d,
  university = {UiS},
  topic = {integral,PFD} 
  ]
  $\displaystyle \int \frac{x^2+1}{(x+1)^2(x+2)} \dl x$
\end{question}

\begin{question}[
  year=2018,semester=H,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-2-e,
  university = {UiS},
  topic = {integral, substitution}
  ]
  $\displaystyle \int \frac{\tan^{-1}x}{1+x^2} \dl x$
\end{question}

\begin{exercise}[
  year=2018,semester=H,type={prob},exam=O,
  topic={integral},
  ID=MAT100-2018-V-O-Problem-2,
  university = {UiS},
  title={Oppgave~2 (H18, UiS)}]
  Finn følgende integraler. Utregning må vises!
  \begin{multicols}{2}
  \begin{enumerate}
    \includeQuestion{MAT100-2018-V-O-Problem-2-a}
    \includeQuestion{MAT100-2018-V-O-Problem-2-b}
    \includeQuestion{MAT100-2018-V-O-Problem-2-c}
    \includeQuestion{MAT100-2018-V-O-Problem-2-d}
    \includeQuestion{MAT100-2018-V-O-Problem-2-e}
    \item[\vspace{\fill}]
  \end{enumerate}
  \end{multicols}
\end{exercise}







\begin{question}[
  year=2018,semester=H,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-3-a,
  university = {UiS},
  topic = {ODE, IVP} 
  ]
  Løs initialverdiproblemet:
  
  \begin{equation*}
      \begin{cases}
        4 y'' + y' + y = 0, \\
        y(0) = 0, \quad y'(0) = 1.
      \end{cases}
  \end{equation*}
\end{question}

\begin{question}[
  year=2018,semester=H,exam=O,type={subprob},
  ID=MAT100-2018-V-O-Problem-3-b,
  university = {UiS},
  topic = {ODE, 1-order, separable}
  ]
  Løs differensialligningen
  
  \begin{equation*}
      \diff yx = x^2 + y^2 x^2.
  \end{equation*}
\end{question}

\begin{exercise}[
  year=2018,semester=H,type={prob},exam=O,
  topic={ODE, IVP, 1-order, separable},
  ID=MAT100-2018-V-O-Problem-3,
  university = {UiS},
  title={Oppgave~3 (H18, UiS)}]
  Finn følgende integraler. Utregning må vises!
  \begin{enumerate}
    \includeQuestion{MAT100-2018-V-O-Problem-3-a}
    \includeQuestion{MAT100-2018-V-O-Problem-3-b}
  \end{enumerate}
\end{exercise}







\begin{exercise}[
  year=2018,semester=H,type={prob},exam=O,
  topic={derivative, max-min, integral, surface-of-revolution},
  ID=MAT100-2018-V-O-Problem-5,
  university = {UiS},
  title={Oppgave~5 (H18, UiS)}]
  Funksjonen $f$ er gitt som
  
  \begin{equation*}
      f(x) = x \sqrt{1 - x^2}, \qquad x \in [-1, 1].
  \end{equation*}
  \begin{enumerate}
    \item Finn alle ekstremalpunktene for $f$. Avgjør om de er logale eller globale
    maksimum og minimum.
    \item La $D$ være området avgrenset av grafen til $f$, $x$-aksen, $x=0$,
    og $x=1$. Finn volumet av omdreiningslegemet som fremkommer ved å dreie $D$
    om $y$-aksen.
  \end{enumerate}
\end{exercise}







\begin{exercise}[
  year=2018,semester=H,type={prob},exam=O,
  topic={curve, implicitt-derivative},
  ID=MAT100-2018-V-O-Problem-5,
  university = {UiS},
  title={Oppgave~5 (H18, UiS)}]
  En kurve er definert implisitt ved $x^2 y^3 - x^3 y^2 = 12$
  \begin{enumerate}
    \item Finn $\diff x/y$.
    \item Finn likningene for tangenten og normalen til kurven gjennom punktet
          $(-1, 2)$.
  \end{enumerate}
\end{exercise}







\begin{exercise}[
  year=2018,semester=H,type={prob},exam=O,
  topic={IVT, ODE, word-problem},
  ID=MAT100-2018-V-O-Problem-6,
  university = {UiS},
  title={Oppgave~6 (H18, UiS)}]
  Ali Gruffalo har akkuratt brygget seg en kopp kaffe. Kaffen er kjempevarm
  og holder temperaturen $96^\circ$C. Dette er alt for varmt for å drikkes og
  Ali venter derfor litt for at kaffen skal kjøle seg ned. Vi antar nedkjølinga
  følger Newtons kjølelov
  
  \begin{equation*}
      \diff Tt = -k(T - A)
  \end{equation*}
  
  hvor $T$ er temperaturen (i $^\circ$C, $t$ er tiden (i minutter), $A$
  er temperaturen til omgivelsene, og $k$ er konstant. Temperaturen i rommet
  er $21^\circ$C, så vi lar $A = 21$.
  \begin{enumerate}
    \item Løs differensiallikningen med initialbetingelsen $T(0) = 96$.
    \item Etter $5$ minutter måler Ali temperaturen i kaffen til å være
    $66^\circ$C. Når er temperaturen i kaffen $45^\circ$C?
  \end{enumerate}
\end{exercise}







\begin{exercise}[year=2019,semester=H,type={prob},
  topic={partialderivative,derivative},exam=O,
  ID=MAT1100-2019-H-O-Problem-1,
  university = {UiO},
  title={Oppgave~1 (H19, UiO)}]
  Finn de partiellderiverte
  $\diffp{f}{x}$, $\diffp{f}{x}$, $\diffp{f}{x}$ til
  
  \begin{equation*}
      f(x, y, z) = y^2 \tan(x z^3).
  \end{equation*}
\end{exercise}







\begin{exercise}[year=2019,semester=H,type={prob},
  topic={gradient,derivative,steepest-descent},exam=O,
  ID=MAT1100-2019-H-O-Problem-2,
  university = {UiO},
  title={Oppgave~2 (H19, UiO)}]
  Finn stigningstallet til funksjonen $f(x, y) = x^3y + x^2$ i punktet
  $(1, -1)$ i den retningen der funksjonen vokser raskest.
\end{exercise}







\begin{exercise}[year=2019,semester=H,type={prob},
  topic={gradient,derivative,steepest-descent},exam=O,
  ID=MAT1100-2019-H-O-Problem-3,
  university = {UiO},
  title={Oppgave~3 (H19, UiO)}]
  Finn stigningstallet til funksjonen $f(x, y) = x^3y + x^2$ i punktet
  $(1, -1)$ i den retningen der funksjonen vokser raskest.
\end{exercise}







\begin{exercise}[year=2019,semester=H,type={prob},
  topic={matrix,inverse},exam=O,
  ID=MAT1100-2019-H-O-Problem-4,
  university = {UiO},
  title={Oppgave~4 (H19, UiO)}]
\begin{flalign*}
&\text{La} &
\begin{pmatrix}
1 & a \\
0 & 1
\end{pmatrix}, \quad \text{der $a$ er ett reelt tall}.&&
\end{flalign*}
\begin{enumerate}
    \item Regn ut matriseproduktene $M(2)M(3)$ og $M(1)M(2)$
    og matrisepotensen $\bigl(M(a)\Bigr)^3$.
    \item Regn ut $M(a)M(b)$ og finn den inverse matrisen til $M(a)$.
\end{enumerate}
\end{exercise}







\begin{exercise}[year=2019,semester=H,type={prob},
  topic={integral, convergence},exam=O,
  ID=MAT1100-2019-H-O-Problem-5,
  university = {UiO},
  title={Oppgave~5 (H19, UiO)}]
  Avgjør om det uegentlige integralet
  
  \begin{equation*}
      \int_0^1 \frac{\arctan x}{x^2} \dl x
  \end{equation*}
  
  konvergerer eller divergerer.
\end{exercise}







\begin{exercise}[year=2019,semester=H,type={prob},
  topic={FTC,derivative,second-derivative},exam=O,
  ID=MAT1100-2019-H-O-Problem-6,
  university = {UiO},
  title={Oppgave~6 (H19, UiO)}]
  Finn den andrederiverte til funksjonen
  
  \begin{equation*}
      f(x) = \int_1^{2x^2} \e^{3t} \dl t, x \in [1, \infty)
  \end{equation*}
\end{exercise}







\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT1100-2019-H-O-Problem-7-a,
  university = {UiO},
  topic = {complex,root,polar}
  ]
  Skriv de komplekse røttene til polynomet
  
  \begin{equation*}
      x^2 + x + 1
  \end{equation*}
  
  både på $a + ib$ form og på polarform.
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT1100-2019-H-O-Problem-7-b,
  university = {UiO},
  topic = {complex,root,factorization}
  ]
  Faktoriser
  
  \begin{equation*}
      x^4 + x^2 + 1
  \end{equation*}
  
  i reelle andregradspolynomer.
\end{question}

\begin{exercise}[year=2019,semester=H,type={prob},
  topic={complex,root,polar,factorization},exam=O,
  ID=MAT1100-2019-H-O-Problem-7,
  university = {UiO},
  title={Oppgave~7 (H19, UiO)}]
  \begin{enumerate}
    \includeQuestion{MAT1100-2019-H-O-Problem-7-a}
    \includeQuestion{MAT1100-2019-H-O-Problem-7-b}
  \end{enumerate}
\end{exercise}








\begin{exercise}[year=2019,semester=H,type={prob},
  topic={continuous,differentiable,integrable},exam=O,
  ID=MAT1100-2019-H-O-Problem-8,
  university = {UiO},
  title={Oppgave~8 (H19, UiO)}]
La $a$, $b$ og $c$ være reelle tall. La

\begin{equation*}
    f(x) = \begin{cases}
        c & \text{hvis} \ x = 0\\
        \frac{ax \cos x}{\sin x} + 2 & \text{hvis} 0 < x < \frac{\pi}{2}\\
        bx + 1 & \text{hvis} \ \frac{\pi}{2} \leq x \leq 2
    \end{cases}
\end{equation*}
\begin{enumerate}
    \item For hvilke reelle tall $a$ og $c$ er $f$ kontinuerlig i $x = 0$.
    \item Finn $a$, $b$ og $c$ slik at $f$ er kontinuerlig på $[0, 2]$ og
    deriverbart på $(0, 2)$.
    \item Forklar hvorfor $f$ er integrerbar på hele intervallet $[0, 2]$
    for alle reelle tall $a$, $b$ og $c$. (Du skal ikke finne integralet.)
\end{enumerate}
\end{exercise}







\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT111-2019-H-O-Problem-1-a,
  university = {UiB},
  topic = {complex,root,normalform}
  ]
  Skriv de komplekse tallene nedenfor på normalform (på formen $a + ib$):
  
  \begin{tasks}(2)
    \task $\displaystyle \frac{2 + 3i}{1 + 4i}$
    \task $\displaystyle \Bigr(\frac{1}{2} - \frac{\sqrt{3}}{2}i\Bigl)^9$
  \end{tasks}
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT111-2019-H-O-Problem-1-b,
  university = {UiB},
  topic = {complex,root,normal}
  ]
  Finn alle løsningene til ligningen $z^3 = -1 $ og skriv dem på normalform.
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT111-2019-H-O-Problem-1-c,
  university = {UiB},
  topic = {complex,root,factorization}
  ]
  Faktoriser $z^3 + 1$ i lineære faktorier over $\mathbb{C}$ og i lineære
  kvadratiske faktorer over $\mathbb{R}$.
\end{question}

\begin{exercise}[year=2019,semester=H,type={prob},
  topic={complex},exam=O,
  ID=MAT111-2019-H-O-Problem-1,
  university = {UiB},
  title={Oppgave~1 (H19, UiB)}]
  \begin{enumerate}
    \includeQuestion{MAT111-2019-H-O-Problem-1-a}
    \includeQuestion{MAT111-2019-H-O-Problem-1-b}
    \includeQuestion{MAT111-2019-H-O-Problem-1-c}
  \end{enumerate}
\end{exercise}







\begin{exercise}[year=2019,semester=H,type={prob},
                 topic={IVT,ODE,1-order,seperable},exam=O,
                 ID=MAT111-2019-H-O-Problem-2,
                 university = {UiB},
                 title={Oppgave~2 (H19, UiB)}
                ]
En kiselalge (\textit{Tacphoria arlyc Ketil, 2019})
blomstrer i takt med tilgangen på næring, slik
at den totale massen $y(t)$ (i megatonn) kiselalger
i Beringhavet ved tid t (i måneder etter
nyttår) tilfredsstiller differensialligningen

\begin{equation*}
    y'(t) = k \sin \Bigl( \frac{2\pi t}{12} \Bigr) \cdot y(t),
\end{equation*}

der $k$ er en konstant. Gitt at $y(0) = 100$ og $y(6) = 400$, finn $y(t)$.
\end{exercise}







\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT111-2019-H-O-Problem-3-a,
  university = {UiB},
  topic = {limit,epsilon-delta}
  ]
  Bruk den \emph{formelle definisjonen av grenseverdi} (\enquote{$\varepsilon-\delta$ definisjonen}) til å vise at:
  
  \begin{equation*}
      \lim_{x \to 1} \Bigl( x^2 + x + 1 \Bigr) = 3,
  \end{equation*}
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT111-2019-H-O-Problem-3-b,
  university = {UiB},
  topic = {lhopital,limit,derivative}
  ]
  La $f$ og $g$ være deriverbare funksjoner og $a$ et reelt tall slik at
  
  \begin{equation*}
      f(a) = g(a) = 0, \quad g'(a) = 0
  \end{equation*}
  
  Begrunn at
  
  \begin{equation*}
      \frac{f'(a)}{g'(a)} = \lim_{x \to a} \frac{f(x)}{g(x)}.
  \end{equation*}
  
  Du får \emph{bare} bruke definisjonen av den deriverte og grensesetningene, ikke f.eks.
  l'Hôpital's regel.
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT111-2019-H-O-Problem-3-c,
  university = {UiB},
  topic = {lhopital,limit,derivative}
  ]
  Bruk l'Hôpitals regel til å regne ut
  
  \begin{equation*}
      \lim_{x \to 0} \frac{x}{\e^x - 1}
  \end{equation*}.
\end{question}

\begin{exercise}[year=2019,semester=H,type={prob},
  topic={limit,epsilon-delta,derivative,lhopital},exam=O,
  ID=MAT111-2019-H-O-Problem-3,
  university = {UiB},
  title={Oppgave~3 (H19, UiB)}]
  \begin{enumerate}
    \includeQuestion{MAT111-2019-H-O-Problem-3-a}
    \includeQuestion{MAT111-2019-H-O-Problem-3-b}
    \includeQuestion{MAT111-2019-H-O-Problem-3-c}
  \end{enumerate}
\end{exercise}







\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT111-2019-H-O-Problem-4-a,
  university = {UiB},
  topic = {integral,partial-fractions}
  ]
  \begin{equation*}
      \int \frac{\dl x}{x^2 + 2x - 15}
  \end{equation*}
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT111-2019-H-O-Problem-4-b,
  university = {UiB},
  topic = {integral,IBP}
  ]
  \begin{equation*}
      \int_0^1 \tan^{-1}x \dl x
  \end{equation*}
\end{question}

\begin{question}[
  year=2019,semester=H,exam=O,type={subprob},
  ID=MAT111-2019-H-O-Problem-4-c,
  university = {UiB},
  topic = {integral,substitution}
  ]
(Hint: bruk delvis integrasjon)
  \begin{equation*}
      \int_0^1 \frac{x^2}{\sqrt{1 - x^2}}\dl x
  \end{equation*}
\end{question}

\begin{exercise}[
  year=2019,semester=H,type={prob},exam=O,
  topic={limit,epsilon-delta,derivative,lhopital},
  ID=MAT111-2019-H-O-Problem-4,
  university = {UiB},
  title={Oppgave~4 (H19, UiB)}
  ]
Regn ut integralene ved grunnleggende integrasjonsteknikker (ikke ved å slå opp i permen
i læreboken)
  \begin{enumerate}
    \includeQuestion{MAT111-2019-H-O-Problem-4-a}
    \includeQuestion{MAT111-2019-H-O-Problem-4-b}
    \includeQuestion{MAT111-2019-H-O-Problem-4-c}
  \end{enumerate}
\end{exercise}

答案1

辅助文件背后的原因在第 5 节中解释演习环境如何运作手册:因为这是允许练习和解决方案中的逐字材料的最简单方法。

因为从一开始就很明显,那些可能很多很多的文件弄乱了项目文件夹可能会分散注意力,甚至会让人烦恼,所以xsim总是有一个名为的选项path

path = {<path>}使用此选项可以指定主项目文件夹内的子文件夹或路径。练习将被写入并包含在该路径中。该路径必须存在于您的系统中,您才能使用它!

在 v0.13(2019/10/06)中引入了选项 `no-files'。

no-files此选项可防止 xsim 将练习和解决方案写入外部文件。这将使您的工作文件夹保持“干净”,但也会阻止在练习和解决方案中使用逐字材料,并可能进一步减慢处理速度。


的开发xsim正在进行中。您这个并不简单的示例在我的计算机上第一次编译大约需要 30 秒,后续编译则需要 80 到 85 秒。使用我的下一版本草稿,同一文件第一次编译大约需要 2 秒,后续编译则需要 7 到 8 秒:仅需十分之一的时间。使用其他示例进行的其他测试也显示出了相同的性能提升。敬请期待 :)

答案2

dbshow提供了一种方法来实现这些功能。下面的示例展示了如何使用不同的条件(或组合)来过滤问题。过滤并显示了四组问题。

  • 难题
  • 多次答错的难题
  • 计划于 2022-01-07 审核的问题
  • 2022-01-02 之后记录的问题
\documentclass{article}
\usepackage{amsmath, physics}
\usepackage{geometry}
\usepackage{dbshow}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\usetikzlibrary{shadings}
\usepackage[hidelinks]{hyperref}

\geometry{
  margin=2cm
}

% #1 link node #2 target node #3 text to show
\NewDocumentCommand \linktarget { m m m } {%
  \hyperlink{#1}{#3}%
  \raisebox{1em}{\hypertarget{#2}{}}%
}

% question box
\tcbset{
  base/.style={
    empty,
    frame engine=path,
    colframe=yellow!10,
    coltitle=red!70,
    fonttitle=\bfseries\sffamily,
    sharp corners,
    left=4pt,
    right=4pt,
    drop fuzzy shadow,
    drop fuzzy shadow,
    borderline west={3pt}{-3pt}{red!80},
  }
}

\newtcolorbox{mybox}[1]{%
  base, title = {#1}
}

\dbNewReviewPoints{review}{1, 3, 7, 15, 30, 60}

\dbNewDatabase{ques-book}{
  ques = tl,
  answer = tl,
  count = int|1,
  labels = clist,
  date = date,
}

\begin{dbFilters}{ques-book}
  \dbNewConditional{hard}{labels}{hard}
  \dbNewConditional{bad}{count}{\dbval > 1}
  \dbNewConditional{review}{date}{review|2022-01-07}
  \dbNewConditional*{after}{date}{\dbval > 2022-01-02}
\end{dbFilters}

% show all questions with hyperlink to answers
\dbNewStyle{ques}{ques-book}{
  before-code = {\section{Questions}},
  item-code = {
    \begin{mybox}{%
      \linktarget{answer_\dbIndex}{ques_\dbIndex}{%
        Question \dbarabic%
        \hspace{2em}\dbuse{date}%
        \hspace{2em}\dbuse{labels}%
        \hfill\dbuse{count}%
      }%
    }
      \dbuse{ques}%
    \end{mybox}
  },
  labels/sep = /,
}

% show all questions and answers with hyperlink to questions
\dbNewStyle{answer}{ques-book}{
  before-code = {\section{Questions and Answers}},
  item-code = {
    \begin{mybox}{%
      \linktarget{ques_\dbIndex}{answer_\dbIndex}{%
        Question \dbarabic%
        \hspace{2em}\dbuse{date}%
        \hspace{2em}\dbuse{labels}%
        \hfill\dbuse{count}%
      }%
    }
      \dbuse{ques}\tcbsubtitle{Answer}\dbuse{answer}%
    \end{mybox}
  },
  labels/sep = /,
}

% show all hard questions with hyperlink to answers
\dbNewStyle{hard}{ques-book}{
  before-code = {\section{Hard Questions}},
  item-code = {
    \begin{mybox}{%
      \hyperlink{answer_\dbIndex}{%
        Question \dbarabic%
        \hspace{2em}\dbuse{date}%
        \hspace{2em}\dbuse{labels}%
        \hfill\dbuse{count}%
      }%
    }
      \dbuse{ques}%
    \end{mybox}
  },
  raw-filter = hard,
  labels/sep = /,
}

% show all hard questions that have answered incorrectly for more than one
% time with hyperlink to answers
\dbNewStyle[hard]{bad}{ques-book}{
  before-code = {\section{Bad Questions}},
  raw-filter = {bad && hard},
}
% show all questions that plan to be reviewed on 2022-01-07 with hyperlink to
% answers
\dbNewStyle[hard]{review}{ques-book}{
  before-code = {\section{Questions to be Reviewed}},
  raw-filter = {review},
}
% show all questions that is record after 2022-01-02 with hyperlink to answers
\dbNewStyle[hard]{after}{ques-book}{
  before-code = {\section{Questions after 2022-01-02}},
  raw-filter = {after},
}

\AtEndDocument{
  \dbshow{review}{ques-book}
  \dbshow{hard}{ques-book}
  \dbshow{bad}{ques-book}
  \dbshow{after}{ques-book}
  \dbshow{ques}{ques-book}
  \dbshow{answer}{ques-book}
}

\begin{document}

\begin{dbitem}{ques-book}[
  date=2022-01-01,
  labels={math, equation, easy},
  count=2
  ]
  \dbsave{ques}{%
    Solve the linear equation: $x + 16 = 31$.
  }
  \dbsave{answer}{%
    $x = 31 - 16 = 15$
  }
\end{dbitem}

\begin{dbitem}{ques-book}[
  date=2022-01-01,
  labels={math, equation, hard},
  count=3
  ]
  \dbsave{ques}{%
    Solve the linear equation: $2y = 16$.
  }
  \dbsave{answer}{%
    $y = 16 / 2 = 8$
  }
\end{dbitem}

\begin{dbitem}{ques-book}[
  date=2022-01-04,
  labels={math, integral, hard},
  count=1
  ]
  \dbsave{ques}{%
    Find the indefinite integral: $\int 2x \dd x$.
  }
  \dbsave{answer}{%
    $\int 2x \dd x = x^2$
  }
\end{dbitem}

\end{document}

相关内容