Building questions with algorithms

Definitions, conditions, random number functions, and formulas all work together in Exam Builder questions and answers, as shown in the examples that follow. Chapter 5EBquestion.tex explains how to structure questions and answers for the Exam Builder.

itbpF42.875pt18.125pt4ptex3.wmf

Define the variable n as a randomly selected prime number:

n : = $\limfunc$rand({5, 7, 11, 13})

Ask the student to identify the prime number in a list of answers, each of which has been defined using formulas:

itbpF42.875pt18.125pt4ptex3.wmf

Define several variables with random functions and restrict the definitions with conditions:

a : = {2, 3, 5, 7, 11, 23}

b : = $\func$rand(a)

c : = $\func$rand(a)

Conditions: (bc)∧(b < c)

State the question using several simple formulas:

If x + b = c, then x is:

Use additional formulas to determine several possible answers:

itbpF42.875pt18.125pt4ptex3.wmf

This example is somewhat more complicated. Define several sets of variables with random number functions, then define additional variables using the first set of definitions:

a : = $\limfunc$rand(1, 100)

b : = $\limfunc$rand(1, 100)

p : = $\limfunc$rand({3, 5, 7, 11, 13, 17, 19}) [some primes]

Condition: gcd(a, p) = 1

Condition: gcd(b, p) = 1

A : = $\left(\vphantom{ -(b/a)\func{mod}p}\right.$ - (b/a)$\func$modp$\left.\vphantom{ -(b/a)\func{mod}p}\right)$

B : = $\left(\vphantom{ -(b/a+1)\func{mod}p}\right.$ - (b/a + 1)$\func$modp$\left.\vphantom{ -(b/a+1)\func{mod}p}\right)$

C : = $\left(\vphantom{ -(b/a-1)\func{mod}p}\right.$ - (b/a - 1)$\func$modp$\left.\vphantom{ -(b/a-1)\func{mod}p}\right)$

Use formulas to state the question for the student:

Solve the congruence aX + b = 0$\func$modp.

Use additional formulas to present the possible answers: