" SHOW = "Then

The first term is clearly divisible by "+p+" so all we need to find is ("+a+"+"+b+") mod "+p+" = "+(a+b)+" mod "+p+" = "+Correct%QUESTION.NUMBER%; for (var i=5; i

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

"+ANS+"

"+SHOW+" "} document.forms[0].elements[item+3].value = QuestionText%QUESTION.NUMBER% + document.forms[0].elements[item+3].value } function question%QUESTION.NUMBER%() { p = Math.ceil(50*Math.random())+50; a = Math.floor((p-10)*Math.random())+10; b = Math.floor((p-10)*Math.random())+10; QuestionText%QUESTION.NUMBER% = "Consider two natural numbers

If *x* mod "+p+" = "+a+" and *y* mod "+p+" = "+b+", what is (*x+y*) mod "+p+"?

"
Correct%QUESTION.NUMBER% = (a+b) % p;
document.write(QuestionText%QUESTION.NUMBER%);
document.write("")
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. ]]>

" SHOW = "Then

The first term is clearly divisible by "+p+" so all we need to find is ("+a+"-"+b+") mod "+p+" = "+(a-b)+" mod "+p+" = "+Correct%QUESTION.NUMBER%; for (var i=5; i

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

"+ANS+"

"+SHOW+" "} document.forms[0].elements[item+3].value = QuestionText%QUESTION.NUMBER% + document.forms[0].elements[item+3].value } function question%QUESTION.NUMBER%() { p = Math.ceil(50*Math.random())+50; a = Math.floor((p/2)*Math.random())+1; b = Math.floor((p-50)*Math.random())+50; QuestionText%QUESTION.NUMBER% = "Consider two natural numbers

If *x* mod "+p+" = "+a+" and *y* mod "+p+" = "+b+", what is (*x-y*) mod "+p+"?

"
Correct%QUESTION.NUMBER% = (a-b+p) % p;
document.write(QuestionText%QUESTION.NUMBER%);
document.write(""+"*Input a positive whole number here.*")
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. ]]>

" SHOW = "Then

The first two terms are clearly divisible by "+p+" so all we need to find is "+a+"×"+b+" mod "+p+" = "+a*b+" mod "+p+" = "+Correct%QUESTION.NUMBER%; for (var i=5; i

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

"+ANS+"

"+SHOW+" "} document.forms[0].elements[item+3].value = QuestionText%QUESTION.NUMBER% + document.forms[0].elements[item+3].value } function question%QUESTION.NUMBER%() { p = Math.ceil(50*Math.random())+50; a = Math.floor((p-10)*Math.random())+10; b = Math.floor((p-10)*Math.random())+10; QuestionText%QUESTION.NUMBER% = "Consider two natural numbers

If *x* mod "+p+" = "+a+" and *y* mod "+p+" = "+b+", what is *xy* mod "+p+"?

"
Correct%QUESTION.NUMBER% = (a*b) % p;
document.write(QuestionText%QUESTION.NUMBER%);
document.write("")
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. ]]>