My objective is to be able to generate worksheets in categories like:
- Laws of Indices
- Simultaneous Linear equations and
- Quadratic equations
When I say generate is to generate for example 20 different problems. I believe I have addressed that with:
\newcommand{\questiontype}[1]{%
\foreach \i in {1,...,#1}
{
\item $my question type$
}}
Somehow I believe that it is related to the question Creating random problems by using rand option.
The only difference is the restrictions that would be needed in code. For example, considering quadratic equations, there are three categories that is problems with equal roots, distinct and imaginary.
I am not an expert in pgf nor the random parameters. I am in the learning process here and I hope you the experts can assist me. I got the inspiration from Calculs et Programmation.
I haven't developed any code as yet but am ready to learn.
EDIT
To better understand my question see the code below.
For example:
\usepackage{lcg,calc,ifthen}
% Une variable qui va servir
\newcounter{det}
\newcommand{\randomsys}{
% Génerer 6 entiers dans [-20,20]
\reinitrand[first=-20, last=20, counter=a] \rand
\chgrand[counter=b] \rand
\chgrand[counter=c] \rand
\chgrand[counter=d] \rand
\chgrand[counter=e] \rand
\chgrand[counter=f] \rand
% Remplacer 0 par 1000
\ifthenelse{\value{a}=0}{\setcounter{a}{1000}}{}
\ifthenelse{\value{b}=0}{\setcounter{b}{1000}}{}
\ifthenelse{\value{d}=0}{\setcounter{d}{1000}}{}
\ifthenelse{\value{e}=0}{\setcounter{e}{1000}}{}
% Un énoncé selon la valeur du dét
\setcounter{det}{\value{a}*\value{e}-\value{b}*\value{d}}
\ifthenelse{\value{det}=0}%
{Expliquer pourquoi le système suivant
n'admet pas une unique solution :}%
{Résoudre le système suivant :}
\[
\left\lbrace \begin{array}{rcl}
\thea x+\theb y &=& \thec \\
\thed x+\thee y &=& \thef
\end{array} \right.
\]}
\randomsys \randomsys \randomsys \randomsys
\randomsys \randomsys \randomsys \randomsys
The code above should generate random simultaneous equations. Thus my objective is to understand what each line is saying, an alternative to this like using the pgfmath from tikz, and what each definition in the code means.
Ultimately I want to learn how I can create random problems based on the above principle. The above topics mentioned (laws of indices, quad equations and simultaneous equations) are just samples to reference from.
