A Randomized Algebra Test by Otto Wilke otto_wilke@hotmail.com
Randomized tests inhibit cheating and reduce the number of student-teacher confrontations. This application consists of four major sections. SECTION ONE refers the reader to a file containing a large block of code that creates a table of procedures. In that file, procedures beginning with the letter d identify the kind of problem. Procedures beginning with the letter p create the problem. Problems are grouped by topic, NUMBER SYSTEMS, LINEAR EQUATIONS, CONICS, etc. Problems are not numbered consecutively. Space is reserved for 100 problems for each topic. Numbers p1 through p100 are reserved for number base problems. Numbers p101 through p200 are for algebraic operation problems, etc. When the block of code is executed, the table of procedures is created and stored in the binary file, algtest.m. SECTION TWO consists of examples of problems currently in the test bank. Each problem is followed by the Maple 7 (I hope) code that could generate the answer(s) and by the answer(s). SECTION THREE consists of code that generates a sample test and the output of that code. To generate a test without answers, set answers:=0: To generate the same version with answers, set answers:=1: It might be wise to set the seed for the random number generator, _seed, to some secret function of the version number. That would prevent students who read this from generating the test with answers. Desired problem numbers from the test bank in SECTION TWO, without the "p" prefix, are entered into list1 in the SECTION THREE code block. The same problem number can be entered in the list more that once to create variants of the same problem. For some versions, problem 104 will try to do something illegal. Just choose a different version number. Problem 501 doesn't exist. I accidentally skipped that number. SECTION FOUR consists of code to generate a randomized final exam that contains one problem from each topic area. The code is followed by its output. Problem numbers can be removed from the problem lists for the topics to change the content of the exam. As before, to generate the test with answers set answers:=1: I plan to add problems, especially application problems, and topic areas to the test bank. I hope some of you will generate additional problems and send them to me.
SECTION ONE A TABLE OF PROCEDURES
To make the code in SECTION THREE and in SECTION FOUR functional, it is necessary to download and execute the file algtest.mws. Execution of that file will create a binary file named algtest.m. The code in SECTION THREE and SECTION FOUR will open the algtest.m file. Inspection of the code in algtest.mws will give the reader insight into the process of creating randomized problems.
SECTION TWO THE TEST BANK
SECTION TWO consists of examples of problems currently in the test bank created by algtest.mws. Each problem is followed by the Maple 7 (I hope) code that could generate the answer(s) and by the answer(s).
NUMBER SYSTEMS
Test Bank Problem 1. Convert a decimal number to binary.
Convert 16 from decimal to binary.
> Answer=convert(16,binary);
Test Bank Problem 2. Convert a decimal number to hexadecimal.
Convert 100 from decimal to hexadecimal.
> Answer=convert(100,hex);
Test Bank Problem 3. Convert a binary number to decimal.
Convert 10000 from binary to decimal.
> Answer=convert(10000,decimal,binary);
>
Test Bank Problem 4. Convert a hexadecimal number to decimal.
Convert `38` from hexadecimal to decimal.
> Answer=convert("38",decimal,hex);
Test Bank Problem 5. Add, subtract, multiply, or divide numbers
in different bases.
Find the sum of 12 decimal and 100 binary.
Give the answer in decimal form.
The answer is 16 decimal.
> Answer=12+convert(100,decimal,binary);
ALGEBRAIC OPERATIONS
Test Bank Problem 101. Evaluate an algebraic expression.
Evaluate.
> Answer=(8+(-24))/(6+(-1));evalf(%);
Test Bank Problem 102. Evaluate an algebraic expression.
> Answer=(9+(-22))*(18+(-32));
Test Bank Problem 103. Evaluate an algebraic expression.
Warning, the protected name Chi has been redefined and unprotected
when a = 3, b = 22, c = 26, d = 25,
e = 9, and f = 32.
> Answer=3+22/26-25*9*32;evalf(%);
Test Bank Problem 104. Evaluate an algebraic expression with exponents.
when a = 2, b = 3, c = 3, d = 3,
e = 1, and f = 5.
> Answer=2*3+(3*3+1)^5;evalf(%);
RADICALS
Test Bank Problem 201. Simplify a radical.
Simplify the following radical.
> Answer=sqrt(25*x*y,symbolic);
Test Bank Problem 202. Multiply radicals.
Multiply the following radicals and simplify.
> Answer=sqrt((50*x^2*y^3)*(48*x*y^3),symbolic);
Test Bank Problem 203. Divide radicals.
Divide the following radicals and simplify.
> Answer=rationalize(sqrt((32*x^2*y)/(27*x*y^3),symbolic));
Test Bank Problem 204. Divide binomials with radicals.
Rationalize the following expressions and simplify. Assume x is real and positive.
> rationalize((2+sqrt(3*x,symbolic))/(5-3*sqrt(x,symbolic)));
> Answer=expand(numer(%))/denom(%);
SETS AND LISTS
Test Bank Problem 301. Find the union of two sets.
Find the union of sets A and B.
> Answer={3,9} union {2,4,6,7,8,10};
Test Bank Problem 302. Find the intersection of two sets.
Find the intersection of sets A and B.
> Answer={5, 8, 9} intersect {4, 6, 8, 9};
Test Bank Problem 303. Find the cardinality of a set.
Find the cardinality of set A.
> Answer=nops({5,7,8,9,11,14,16});
Test Bank Problem 304. Find the number of operands in a list.
Find the number of operands in list A.
> Answer=nops([17, 10, 3, 18, 6]);
Test Bank Problem 305. Find the value of an operand in a list.
Find the value of operand 2 in list A.
> Answer=op(2,[2, 16, 10, 8]);
SETS OF NUMBERS
Test Bank Problem 401. Express a rational number in decimal form.
Find the decimal value of following number.
> Answer=evalf(5/7,50);
Test Bank Problem 402. Express a decimal number in rational form.
Hint: Maple rounds the last digit.
Express the following decimal number in rational form.
> Answer=convert(.35294117647058823529411764705882352941176470588235,rational);
FACTORING
Test Bank Problem 502. Factor common factor.
Factor the following expression.
> Answer=factor(4*x^5+3*x);
Test Bank Problem 503. Factor trinomials with leading coefficient
equal to 1.
> Answer=factor(x^2-9*x+18);
Test Bank Problem 504. Factor trinomials with leading coefficient
not equal to 1.
> Answer=factor(10*x^2-24*x+8);
Test Bank Problem 505. Factor difference of squares.
> Answer=factor(-8*x^8+18*y^6);
FRACTIONS
Test Bank Problem 601. Write a mixed number as a sum.
Write the mixed number 6 and 4/5 as a sum
of an interger and a rational fraction.
> Answer=" (6 + 4/5)";
Test Bank Problem 602. Multiply mixed numbers.
Multiply the mixed number 5 and 4/6 by
the mixed number 2 and 2/7.
> Answer=(5+4/6)*(3+2/5);evalf(%);
Test Bank Problem 603. Add mixed numbers.
Add the mixed number 3 and 2/5 and
the mixed number 3 and 2/5.
> Answer=(3+2/5)+(3+2/5);evalf(%);
COMPLEX NUMBERS
Test Bank Problem 701. Convert radicals with negative radicands to complex form.
Write the following in standard form for a complex number.
> Answer=-1+sqrt(-25);
Test Bank Problem 702. Operations with complex numbers.
Given the complex numbers z1 and z2 below, find z1 + z2,
z1 - z2, z1 * z2, z1 / z2, and z1 ^ z2.
> z1:=2+sqrt(-9);z2:=4+sqrt(-9);'z1'+'z2'=z1+z2;'z1'-'z2'=z1-z2;'z1'*'z2'=z1*z2;'z1'/'z2'=evalf(z1/z2);'z1'^'z2'=evalf(z1^z2);z1:='z1':z2:='z2':
CARTESIAN PLANE
Test Bank Problem 801. Graph a point in a plane.
Graph the point (-3, 8).
> plot([[-3,8]],style=point,symbol=circle,symbolsize=30,scaling=constrained,color=red,labels=[x,y],view=[-10..10,-10..10]);
Test Bank Problem 802. Graph a point in three dimensions.
Graph the point (-7, 2, -6).
Warning, the name changecoords has been redefined
> with(plots):plot3d({[-7,2,-6]},x=-10..10,y=-10..10,style=point,symbol=circle,symbolsize=30,view=[-10..10,-10..10,-10..10],axes=boxed,labels=[x,y,z],color=red);
Test Bank Problem 803. Graph a complex number.
Graph the number, -3 + 8 I, on the complex plane.
> plot([[-3,8]],symbol=circle,symbolsize=30, style=point,labels=[a,b],font=[TIMES,BOLD,12],scaling=constrained,view=[-10..10,-10..10]);
UNITS AND DIMENSIONS
Test Bank Problem 901. Length conversions.
Convert +3.71 meters to feet.
> with(Units);with(Units[Natural]): Answer=convert(3.71*m,system,FPS);
Warning, the name Unit has been rebound
Test Bank Problem 902. Mass conversions.
Convert 1.99 pounds_mass to kilograms.
> with(Units):with(Units[Natural]):GetUnits(dimension=mass);
Warning, the assigned name polar now has a global binding
Warning, these protected names have been redefined and unprotected: *, +, -, /, <, <=, <>, =, Im, Re, ^, abs, arccos, arccosh, arccot, arccoth, arccsc, arccsch, arcsec, arcsech, arcsin, arcsinh, arctan, arctanh, argument, ceil, collect, combine, conjugate, convert, cos, cosh, cot, coth, csc, csch, csgn, diff, eval, evalc, evalr, exp, expand, factor, floor, frac, int, ln, log, log10, max, min, normal, root, round, sec, sech, shake, signum, simplify, sin, sinh, sqrt, surd, tan, tanh, trunc, type, verify
> Answer=convert(1.99*pound[avoirdupois],system,SI);
Test Bank Problem 903. Temperature conversions.
Convert 16.7 degree_Centigrade to Kelvin.
> with(Units):with(Units[Natural]):GetDimensions();
> GetUnits(dimension=thermodynamic_temperature);
> Answer=convert(16.7, temperature, centigrade, kelvin);
Test Bank Problem 904. Convert joules, newtons, volts or coulombs to SI.
Convert 82.0 joules to base_metric_units.
> with(Units):with(Units[Natural]): Answer=convert(82.0*J,units,'kg*m^2/s^2');
Test Bank Problem 905. Application with units.
A pump pumps 75 gallons per minute against a pressure.
of 55 pounds per square inch. What is its horsepower?
Convert flow and pressure to SI and then multiply.
> with(Units):with(Units[Natural]): GetUnits(dimension=pressure);GetUnits(dimension=volume);GetUnits(dimension=power);
> evalf(55*pound_per_square_inch[standard])*75*gallon[US_liquid]/minute;
> Answer=convert(%,units,horsepower[UK]);
GEOMETRIC FORMULAE
Test Bank Problem 1001. Given two sides of a right triangle,
find its third side, perimeter, and area.
If a leg of a right triangle is 4.5 and the length of
the hypotenuse is 8.3 find the other leg, the perimeter of
the triangle, and the area of the triangle.
> Leg=sqrt(8.3^2-4.5^2);
> Perimeter=4.5+8.3+6.974238310;
> Area=1/2*4.5*6.974238310;#one-half times base times height
Test Bank Problem 1002. Given three sides of a triangle,
find its area.
If the sides of a triangle are 14, 14,
and 2 find the area of the triangle.
> s:=(14+14+2)/2:Area=sqrt(s*(s-14)*(s-14)*(s-2)); evalf(%);s:='s':#Heron's formula
Test Bank Problem 1003. Given the radius or diameter of a circle,
find its circumference and area.
If the radius of a circle is 2.2, find the circumference
and the area of the circle.
> Circumference = 2*evalf(Pi)*2.2;Area =evalf(Pi)*2.2^2;
Test Bank Problem 1004. Find the volume of a cone or pyramid.
If a pyramid has a square base and each side of the base is 2.3,
and the height of the pyramid is 2.5, find the pyramid's volume.
> Volume =1/3*2.3^2*2.5;
Test Bank Problem 1005. Find the volume and area of a sphere.
If the radius of a sphere is 3.2, find its volume
and its surface area.
> Volume = 4/3*evalf(Pi)*3.2^3;Area = 4*evalf(Pi)*3.2^2;
LINEAR EQUATIONS
Test Bank Problem 1101. Solve a linear equation in one variable.
Solve.
> x=solve(-18*x-13 = -8,x);evalf(%);
Test Bank Problem 1102 Solve a linear equation in one variable with fractions.
> x=solve(-1/3*x-7/4 = 1/3*x,x);evalf(%);
Test Bank Problem 1103 Solve a linear equation with x in the denominator.
> x=solve(-5*1/(x+8)-4 = 7/3,x);evalf(%);
Test Bank Problem 1104. Solve a literal equation.
Solve for c.
> c=solve(a*b*c-d = e+f,c);
Test Bank Problem 1105. Distance, midpoint, slope, line.
Given the points (-2, -3) and (2, 2),
find the distance between the points, their midpoint, the slope
of the line through the points, and the equation of the line through
the points. Plot the points and the line.
> Distance=sqrt(''(x[2]-x[1])^2+(y[2]-y[1])^2''); Distance = sqrt((2-(-2))^2+(2-(-3))^2);evalf(%);
> x_midpoint=(x[1]+x[2])/[2];x_midpoint=(-2+2)/2; y_midpoint=(y[1]+y[2])/[2];y_midpoint=(-3+2)/2;
> slope=(y[2]-y[1])/(x[2]-x[1]);slope=(2-(-3))/(2-(-2));
> y-y[1]=m*(x-x[1]);y=solve(y-(-3)=5/4*(x-(-2)),y);
> with(plots):p1:=plot([[-2,-3],[2,2]],style=point,symbol=box): p2:=plot(-1/2+5/4*x,x=-5..5,y=-5..5,color=blue): display({p1,p2});
LINEAR INEQUALITIES
Test Bank Problem 1201. Solve linear inequalities.
> x=solve(0 < 8*x+11,x);
Test Bank Problem 1202. Solve double linear inequalities.
> x=solve({2<=-4*x + (-9),-4*x + (-9)<=19},x);
Test Bank Problem 1204. Graph linear inequalities in two variables.
> plots[inequal](y <= 5*x+5,x=-5..5,y=-5..5); #Maple 6 bug: Use <= instead of < and >= instead of >
QUADRATIC EQUATIONS
Test Bank Problem 1301. Solve factorable quadratic equations with
leading coefficient of 1.
> x=solve(x^2-4*x-60 = 0,x);
Test Bank Problem 1302. Solve factorable quadratic equations with
leading coefficient not 1.
> x=solve(4*x^2+6*x = 0,x);
Test Bank Problem 1303. Solve quadratic equations with fractions.
> x=solve(8*1/(x+2)-5/(x-9) = 2/5,x);evalf(%);
RADICAL EQUATIONS
Test Bank Problem 1401. Solve radical equations with one radical.
> x={solve(sqrt(-7*x-5)-2 = 6,x)};evalf(%);
Test Bank Problem 1402. Solve radical equations with two radicals.
> x={solve(sqrt(9*x-8)+sqrt(4*x+7) = 3,x)};evalf(%);
POLYNOMIAL EQUATIONS
Test Bank Problem 1501. Solve polynomial equations with real roots.
> x=solve(-6*x^3-31*x^2+72*x-35 = 0,x);evalf(%);
Test Bank Problem 1502. Solve polynomial equations with complex roots.
> x=solve(36*x^3+156*x^2-271*x+534 = 0,x);evalf(%);
FUNCTIONS
Test Bank Problem 1601. Find inverse functions.
Given the following function, F, find the inverse of F.
> F:=x->8*x+5;[F]^[-1]=solve(x=8*y+5,y);F:='F': #Exchange x and y and solve for new y.
Test Bank Problem 1602. Find composite functions.
Given the following functions, F and G, find the F composite G.
> F:=x->-2*x+3;G:=x->2*x+3;F_comp_G=(F@G)(x);F:='F':G:='G':
EXPONENTIAL AND LOGARITHMIC FUNCTIONS
Test Bank Problem 1701. Solve exponential equation.
The accumulation in an annuity, A, is given by the following
equation in which P is the periodic contribution, r is the
rate of increase per period(expressed as a decimal),
and n is the number of periods.
Joan invested $110 each month into a tax-sheltered annuity
which earns 10.5 percent (APR) compounded annually.
How many years will it take for her to have a million dollars
in her annuity account?
> Answer = solve(1000000=110*((1+.105/12)^(12*x)-1)/(.105/12),x)*years; #Interest rate as a decimal; with monthly contribution, use monthly #rate and n is number of months.
Test Bank Problem 1702. Solve exponential equation.
The future value, A, (principle plus interest), of principle, P
invested at compound interest rate, r for n periods
is given by the following equation.
Joan invested $6000 which earns 12.0 percent (APR) .
How many years will it take for her to double her money
if interest is compounded annually?
> Answer = solve(2*6000=6000*(1+.12)^n,n)*years; #Interest rate as a decimal; with annual compounding, use yearly #rate and n is number of years.
Test Bank Problem 1703. Solve logarithmic equation.
The pH of a solution having a hydronium ion concentration, H3O,
in moles per liter, is given by the following equation.
Find the hydronium ion concentration if the pH is 7.1.
> H3O =solve(7.1= -ln(H3O),H3O);
MATRICES
Test Bank Problem 1801. Add matrices.
Given the following matrices:
Find A + B.
> evalm([[-6,11],[6,-12]])+evalm([[5,-11],[3,-7]])=evalm([[-6,11],[6,-12]]+[[5,-11],[3,-7]]);
Test Bank Problem 1802. Multiply matrices.
Find the product of A and B.
> evalm([[-9,-6],[-11,10]])*evalm([[-1,8],[4,5]])=evalm([[-9,-6],[-11,10]]&*[[-1,8],[4,5]]);
Test Bank Problem 1803. Multiply a constant by a matrix.
Multiply the following matrix by 3.
> 3*evalm([[-7,-7],[-4,-3]])=evalm(3*[[-7,-7],[-4,-3]]);
Test Bank Problem 1804. Find the inverse of a matrix.
Find the inverse of the following matrix.
Warning, the name fibonacci has been redefined
Warning, the protected names norm and trace have been redefined and unprotected
> with(linalg):A := array( [[-7,7],[-11,1]] ):[A]^[-1]=inverse(A);A:='A':
Test Bank Problem 1805. Find the determinant of a matrix.
Find the determinant of the following matrix.
> Answer=linalg[det](matrix([[-5, -10, 11], [-12, 9, 1], [10, 12, 12]]));
SIMULTANEOUS EQUATIONS
Test Bank Problem 1901. Solve two simultaneous equations.
Solve the following simultaneous equations.
> solve({7*x-y = 7,-7*x-8*y = 1},{x,y});
Test Bank Problem 1902. Solve three simultaneous equations.
> solve({-3*x+2*y-5*z = 6,9*x-7*y+7*z = 5,8*x-6*y+5*z = 2},{x,y,z});
Test Bank Problem 1903. Solve an underdetermined system.
> solve({4*x-3*y-6*z = -4,-9*x+4*y-7*z = 4},{x,y,z});
Test Bank Problem 1904. Reduced row echelon form.
Write the reduced row echelon from of the augmented matrix
for the following equations.
> with(linalg):rref([[1,-3,-3],[-3,1,4]]);
SIMULTANEOUS INEQUALITIES
Test Bank Problem 2001. Graph two simultaneous inequalities.
Graph the following inequalities.
> plots[inequal]({7*x+3*y <= -6,-9 <= x+y},x=-20..20,y=-20..20,thickness=8); #Maple 6 bug: Use <= instead of < and >= instead of >
SEQUENCES
Test Bank Problem 2101. Common difference or ratio, general term, sums.
Arithmetic Sequence Formulae
Geometric Sequence Formulae
Is the following sequence arithmetic, geometric, or neither?
If arithmetic, what is the common difference, the general formula
for the nth term, and the sum of the first 7 terms?
If geometric, what is the common ratio, the general formula
If the geometric series converges, what is the sum of an infinite number of terms?
Test for common difference
> [-3-(-5),-9/5-(-3),-27/25-(-9/5),-81/125-(-27/25)];
Differences between successive terms not the same; therefore sequence is not arithmetic.
Test for common ratio.
> [-3/(-5),-9/5/(-3),-27/25/(-9/5),-81/125/(-27/25)];
Ratios of successive terms are the same, therefore sequence is geometric.
Geometric sequence
> a[n]=a[1]*r^(n-1); a[n]=-5*(3/5)^(n-1);
Use general formula in sum command
> Sum( -5*(3/5)^(n-1),n=1..7)=sum( -5*(3/5)^(n-1),n=1..7);
If the absolute value of the common ratio, r, is less than 1, find the sum of an infinite number of terms.
> Sum( -5*(3/5)^(n-1),n=1..infinity)=sum( -5*(3/5)^(n-1),n=1..infinity);
PROBABILITY
Test Bank Problem 2201. Factorial.
Calculate 9 factorial.
> Answer = 9!;
Test Bank Problem 2202. Combinations.
Calculate the number of combinations of 17 things taken 7 at a time.
> with(combinat):Answer=numbcomb(17,7);
Test Bank Problem 2203. Permutations.
Calculate the number of permutations of 7 things taken 5 at a time.
> with(combinat):Answer=numbperm(7,5);
Test Bank Problem 2204. Probability of union.
A jar contains 2 red marbles, 4 blue marbles, and 7 yellow marbles.
If one marble is drawn from the jar, what is the probability it will
be red or yellow?
> Answer = (2+7)/(2+4+7);
Test Bank Problem 2205. Probability of independent events and complements.
The probability of rain today is .20 and the probability
of rain tomorrow is .45. What is the probability of no
rain today? What is the probability of rain both days?
What is the probability of no rain either day?
What is the probability of rain at least one day of the two?
> No_rain_today = 1-.2;
> Rain_both_days=.2*.45;
> No_rain_at_all = (1-.2)*(1-.45);
> Rain_one_day = 1-.440;
CONICS
Test Bank Problem 2301. Given equation, identify conic, locate centers, vertices, foci.
Does the following equation describe a line, a circle,
an ellipse, or a parabola?
If a circle, determine the radius and locate the center.
If an ellipse, locate the center and foci.
If a parabola, locate the vertex and focus.
In all cases, graph the equation and the determined points.
Graph the relationship.
> plots[implicitplot](4*x^2+40*x+108-4*y = 0,x=-20..20,y=-20..40);
Graph show a parabola. Also, because the coefficient of y^2 is zero, we know the graph is a parabola. The standard from of the equation for a parabola opening in the y-direction is:
> k:='k':4*p*(y-k)=(x-h)^2;
> student[completesquare](4*x^2+40*x+108-4*y = 0,x);%/4;
Arrange in standard form for a parabola.
> 4*[1/4]*[y-2]=(x+5)^2;
Focus is distance p from the vertex in the y-direction (2+1/4).
> with(plots):p1:=implicitplot(4*x^2+40*x+108-4*y = 0,x=-10..-1,y=0..10): p2:=plot([[-5,2],[-5,9/4]],style=point,symbol=circle): display({p1,p2},scaling=constrained,axes=framed);
Test Bank Problem 2302. Given three points, find equation of parabola.
Given the following points, [x,y], find the equation of the parabola
passing through the points. What are the coordinates of its vertex?
The standard form for the equation of a parabola is:
> solve({4*p*(6-k) = (2-h)^2,4*p*(-2-k) = (5-h)^2,4*p*(6-k) = (8-h)^2},{p,h,k});
> 4*(9/32)*(y-(-2))=(x-5)^2;
STATISTICS AND REGRESSION
Test Bank Problem 2401. Mean, median, standard deviation.
Calculate the mean, median, and standard deviation
of the following set of numbers.
> with(stats):Mean = describe[mean]([10, 7, 13, 9, 10, 11]);evalf(%);
Warning, these names have been redefined: anova, describe, fit, importdata, random, statevalf, statplots, transform
> with(stats):Median = describe[median]([10, 7, 13, 9, 10, 11]);evalf(%);
> with(stats):Standard_deviation = describe[standarddeviation]([10, 7, 13, 9, 10, 11]);evalf(%);
Test Bank Problem 2402. Linear regression.
Calculate the the equation of the best-fit line
for the following set of points, [x,y].
Plot the points and the line.
> with(stats):fit[leastsquare[[x,y]]]([[4,9,11],[1,5,10]]);
> p1:=plot([[4,1],[9,5],[11,10]],style=point,symbol=cross): p2:=plot(-164/39+31/26*x,x=0..15): plots[display]({p1,p2});
LOGIC
Test Bank Problem 2501. Deductive reasoning.
Is the syllogism direct, indirect, or transitive reasoning and is the
argument a valid argument?
If John studies math two hours per day, then John passes math.
John studies math two hours per day,therefore John passes math.
The argument is DIRECT and VALID.
SECTION THREE GENERATE A RANDOMIZED TEST
SECTION THREE consists of code that generates a sample test and the output of that code. To generate a test without answers, set answers:=0: To generate the same version with answers, set answers:=1: It might be wise to set the seed for the random number generator, _seed, to some secret function of the version number. That would prevent students who read this from generating the test with answers. Desired problem numbers from the test bank in SECTION TWO are entered into list1 in the SECTION THREE code block. The same problem number can be entered in the list more that once to create variants of the same problem. For some versions, problem 104 will try to do something illegal. Just choose a different version number. Problem 501 doesn't exist. I accidentally skipped that number.
> read `algtest.m`:with(combinat): Version:=3:_seed:=Version:answers:=1: printf("Randomized Test\n"); list1:=randperm([1,2,3,103,104,903]): for j from 1 to nops(list1) do printf("Problem% d, Version% d\n",j,Version); s1:=``||op(j,list1): algtest[`p`||s1](answers);printf("\n");od:
Randomized Test
Problem 1, Version 3
when a = 4, b = 3, c = 5, d = 6
e = 4, and f = 4
Problem 2, Version 3
Convert 3 from decimal to hexadecimal.
Problem 3, Version 3
Convert 32 from decimal to binary.
Problem 4, Version 3
Convert 1011 from binary to decimal.
Problem 5, Version 3
Convert 63.50 degree_Centigrade to Kelvin.
Problem 6, Version 3
when a = 25, b = 6, c = 18, d = 3
e = 21, and f = 31.
SECTION FOUR GENERATE A RANDOMIZED FINAL EXAM
SECTION FOUR consists of code to generate a randomized final exam that contains one problem from each topic area. The code is followed by its output. Problem numbers can be removed from the problem lists for the topics to remove simplistic problems from the exam. As before, to generate the test with answers, set answers:=1:
> read `algtest.m`:with(combinat): Version:=723011:_seed:=Version:answers:=1:j:=1: printf("Problem % d, Version % d\n",j,Version); list1:=[1,2,3,4,5]: s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[101,102,103,104]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[201,202,203,204]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[301,302,303,304]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[401,402]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[502,503,504]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[601,602,603]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[701,702]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[801,802,803]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[901,902,903,904]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1001,1002,1003,1004]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1101,1102,1103,1104]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1201,1202,1204]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1301,1302,1303]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1401,1402]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1501,1502]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1601,1602]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1701,1702,1703]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1801,1802,1803,1804]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[1901,1902,1903]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[2001]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[2101]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[2301,2302]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[2401,2402]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers); j:=j+1:printf("\n");printf("\n"); printf("Problem % d, Version % d\n",j,Version); list1:=[2501]:s1:=``||op(1,randcomb(list1,1)): algtest[`p`||s1](answers);
Problem 1, Version 723011
Convert 5 from decimal to binary.
Problem 2, Version 723011
Problem 3, Version 723011
Problem 4, Version 723011
Problem 5, Version 723011
Problem 6, Version 723011
Problem 7, Version 723011
Write the mixed number 6 and 2/ 6 as a sum
Problem 8, Version 723011
Problem 9, Version 723011
Graph the point ( 0, 7).
Problem 10, Version 723011
Convert 88.20 newtons to base_metric_units.
Problem 11, Version 723011
If the radius of a cone is 6.40 and its height
is 5.70, find its volume.
Problem 12, Version 723011
Problem 13, Version 723011
Problem 14, Version 723011
Problem 15, Version 723011
Problem 16, Version 723011
Problem 17, Version 723011
Problem 18, Version 723011
Find the hydronium ion concentration if the pH is 6.2.
Problem 19, Version 723011
Problem 20, Version 723011
Problem 21, Version 723011
Problem 22, Version 723011
for the nth term, and the sum of the first 8 terms?
Arithmetic sequence
Problem 23, Version 723011
Problem 24, Version 723011
Problem 25, Version 723011