"} else {document.forms[0].elements[item+3].value = "Your answer,

"+ANS+"

"+SHOW+" "} document.forms[0].elements[item+3].value = QuestionText0%QUESTION.NUMBER%+Equation1%QUESTION.NUMBER%+QuestionText1%QUESTION.NUMBER%+Equation2%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%+QuestionText3%QUESTION.NUMBER%+document.forms[0].elements[item+3].value } function question%QUESTION.NUMBER%() { ///////////////// C set n = displayarray( 1, 2, 5, 1); myCArray = displayarray( n, 0, 5, 1); c_set = ""; for(ip=0; ip

"; e2=""; Equation2%QUESTION.NUMBER% = m1+m2+m3+e2; Equation%QUESTION.NUMBER% = Equation1%QUESTION.NUMBER%+Equation2%QUESTION.NUMBER%; QuestionText0%QUESTION.NUMBER% = "Let A = {1,2} and B = {3,4}. Then A × B = {(1,3),(1,4),(2,3),(2,4)} where we have used lexographical ordering.

Now let

";
QuestionText1%QUESTION.NUMBER% = "and

"
QuestionText2%QUESTION.NUMBER% = "

What is the "+h+ordStringOf(h)+" element of C × D when listing elements using the lexographical ordering shown for the A × B?

"
QuestionText3%QUESTION.NUMBER% = "*Type impossible if you think there are not that many elements in a set. *

"; QuestionText%QUESTION.NUMBER% = QuestionText0%QUESTION.NUMBER%+QuestionText1%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%+QuestionText3%QUESTION.NUMBER%; allowed_input = "impossible"; g=Math.ceil(h/m); f=Math.floor(h/m); k = custRound(m*((h/m)-f),0); if(k=="0"){delement=k+m} else{delement=k} cartesian_set = ""; for(ip=0; ip<=n-1; ip++){ for(im=0; im<=m-1; im++){ cartesian_set+="("+cset[ip]+","+dset[im]+"),"}} long=cartesian_set.length; cartesianproduct="{"+cartesian_set.slice(0,long-1)+"}"; Correct%QUESTION.NUMBER% = "("+cset[g-1]+","+dset[delement-1]+")"; //document.write(cartesianproduct+"

"); //document.write(Correct%QUESTION.NUMBER%+"

"); Feedback%QUESTION.NUMBER% = "

*A × B* denotes the Cartesian product of two sets A and B. It is the set of all ordered pairs *(a, b)*, where a ∈ A and b ∈ B.

The number of elements in the Cartesian product of A and B is given by *n(A × B) = n(A) ⋅ n(B)* where the ⋅ means multiply.

Since C contains "+n+" elements and B contains "+m+" elements, the Cartesian product has "+n+" ⋅ "+m+" = "+p+" elements.

*C × D *= "+cartesianproduct+"

Then counting gives the "+h+ordStringOf(h)+" element of this set as **"+Correct%QUESTION.NUMBER%+"**

";
document.write(QuestionText0%QUESTION.NUMBER%+Equation1%QUESTION.NUMBER%+QuestionText1%QUESTION.NUMBER%+Equation2%QUESTION.NUMBER%+QuestionText2%QUESTION.NUMBER%);
document.write("

")
document.write(QuestionText3%QUESTION.NUMBER%);
document.write("")
}
if (document.forms[0].name=="FEEDBACK")
{}
else
{question%QUESTION.NUMBER%()}
]]>

"+""+"

") } ]]>

"} else {document.forms[0].elements[item+3].value = "Your answer "+document.forms[0].elements[item].value+", should have been "+COR+"

"+ANS+"

"+SHOW+" "} document.forms[0].elements[item+3].value = QT + document.forms[0].elements[item+3].value } function question%QUESTION.NUMBER%() { myNArray = displayarray( 1, 0, 10, 1); n = myNArray[0]; myMArray = displayarray( 1, 0, 10, 1); m=myMArray[0]; elementsn=""; if(n == 0){elementsn= n+" elements"} else {if(n == 1){elementsn= n+" element"} else{elementsn= n+" distinct elements"}}; elementsm=""; if(m == 0){elementsm= m+" elements"} else {if(m == 1){elementsm= m+" element"} else{elementsm= m+" distinct elements"}}; QuestionText%QUESTION.NUMBER% = "Suppose A is a set with "+elementsn+" and B is a set with "+elementsm+". How many elements does

" Correct%QUESTION.NUMBER%=n*m; if(Correct%QUESTION.NUMBER% == 1){cor_noun = " element."}else{cor_noun = " elements."} Feedback%QUESTION.NUMBER% = "

*A × B* denotes the Cartesian product of two sets A and B. It is the set of all ordered pairs *(a, b)*, where a ∈ A and b ∈ B.

If A is a finite set with *n(A)* elements and B is a finite set with *n(B)* elements, the number of elements in the Cartesian product of A and B is given by *n(A × B) = n(A) ⋅ n(B)* where the ⋅ means multiply. So, for an ordered pair *(a, b)* in *A × B*, there are n(A) possibilities for a, and for each of these there are n(B) possibilities for b.

Since A contains "+elementsn+" and B contains "+elementsm+", the Cartesian product has "+n+" ⋅ "+m+" = "+Correct%QUESTION.NUMBER%+cor_noun; //document.write(Correct%QUESTION.NUMBER%); document.write(QuestionText%QUESTION.NUMBER%); document.write("

*n(A × B)* = ")
document.write("")
}
if (document.forms[0].name=="FEEDBACK")
{}
else
{question%QUESTION.NUMBER%()}
]]>

"+""+"

") } // Template updated and developed by Daniel Nichols & Martin Greenhow, Brunel University, July 2004, working // on original templates authored by Dominic Smith of Brunel University, July 2001, with // valuable contributions from Professor David Hewitt of Monash University, Australia. ]]>

"} else {document.forms[0].elements[item+3].value = "Your answer "+document.forms[0].elements[item].value+", should have been "+COR+"

"+ANS+"

"+SHOW+" "} document.forms[0].elements[item+3].value = QT + document.forms[0].elements[item+3].value } function question%QUESTION.NUMBER%() { myNArray = displayarray( 1, 0, 10, 1); n = myNArray[0]; myMArray = displayarray( 1, 0, 10, 1); m=myMArray[0]; elementsn=""; if(n == 0){elementsn= n+" elements"} else {if(n == 1){elementsn= n+" element"} else{elementsn= n+" distinct elements"}}; elementsm=""; if(m == 0){elementsm= m+" elements"} else {if(m == 1){elementsm= m+" element"} else{elementsm= m+" distinct elements"}}; QuestionText%QUESTION.NUMBER% = "Suppose A is a set with "+elementsn+" and B is a set with "+elementsm+". How many elements does

" Correct%QUESTION.NUMBER%=m*n; if(Correct%QUESTION.NUMBER% == 1){cor_noun = " element."}else{cor_noun = " elements."} Feedback%QUESTION.NUMBER% = "

*B × A* denotes the Cartesian product of two sets B and A. It is the set of all ordered pairs *(b, a)*, where b ∈ B and a ∈ A.

If B is a finite set with *n(B)* elements and A is a finite set with *n(A)* elements, the number of elements in the Cartesian product of B and A is given by *n(B × A) = n(B) ⋅ n(A)* where the ⋅ means multiply. So, for an ordered pair *(b, a)* in *B × A*, there are n(B) possibilities for b, and for each of these there are n(A) possibilities for a.

Since B contains "+elementsm+" and A contains "+elementsn+", the Cartesian product has "+m+" ⋅ "+n+" = "+Correct%QUESTION.NUMBER%+cor_noun; //document.write(Correct%QUESTION.NUMBER%); document.write(QuestionText%QUESTION.NUMBER%); document.write("

*n(B × A)* = ")
document.write("")
}
if (document.forms[0].name=="FEEDBACK")
{}
else
{question%QUESTION.NUMBER%()}
]]>

"+""+"

") } // Template updated and developed by Daniel Nichols & Martin Greenhow, Brunel University, July 2004, working // on original templates authored by Dominic Smith of Brunel University, July 2001, with // valuable contributions from Professor David Hewitt of Monash University, Australia. ]]>