06.09.2021 Views

Elementary Abstract Algebra- Examples and Applications, 2019a

Elementary Abstract Algebra- Examples and Applications, 2019a

Elementary Abstract Algebra- Examples and Applications, 2019a

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

136 CHAPTER 3 MODULAR ARITHMETIC<br />

}<br />

{<br />

//’%’ returns the remainder of the integer division<br />

remainder = b % a;<br />

if (remainder == 0)<br />

return a;<br />

else<br />

return gcdRecurse(a, remainder);<br />

}<br />

else<br />

{<br />

remainder = a % b;<br />

if (remainder == 0)<br />

return b;<br />

else<br />

return gcdRecurse(b, remainder);<br />

}<br />

//By calling itself, it will repeat the process until the remainder is 0<br />

Exercise 3.5.9. Create a spreadsheet (with Excel, LibreOffice, or OpenOffice)<br />

that calculates the gcd of two integers that uses the procedure above.<br />

Excel has a built-in gcd function, but you’re not allowed to use it for this exercise.But<br />

you may use the MOD function: “=MOD(A2,B2)” will compute<br />

the remainder when A2 is divided by B2. You may refer to the spreadsheet<br />

in Figure 3.5.8 for ideas.<br />

♦<br />

3.5.4 Diophantine equations<br />

Let’s look now at another type of problem, which has played a key role in<br />

the history of mathematics.<br />

Definition 3.5.10. A Diophantine equation in the variables m, n is an<br />

equation of the form<br />

a · m + b · n = c<br />

where a, b, c are integers, <strong>and</strong> m <strong>and</strong> n are assumed to have integer values.<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!