<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=211Lecture5</id>
	<title>211Lecture5 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=211Lecture5"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=211Lecture5&amp;action=history"/>
	<updated>2026-05-19T09:02:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=211Lecture5&amp;diff=288&amp;oldid=prev</id>
		<title>Mark: 1 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=211Lecture5&amp;diff=288&amp;oldid=prev"/>
		<updated>2008-03-08T22:35:28Z</updated>

		<summary type="html">&lt;p&gt;1 revision(s)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:35, 8 March 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key mediawiki-mw_:diff:1.41:old-287:rev-288 --&gt;
&lt;/table&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=211Lecture5&amp;diff=287&amp;oldid=prev</id>
		<title>Mark at 03:47, 24 July 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=211Lecture5&amp;diff=287&amp;oldid=prev"/>
		<updated>2006-07-24T03:47:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Euclidean Algorithm==&lt;br /&gt;
&lt;br /&gt;
In this section we provide the well known Euclidean algorithm that appeared around 300 BC.&lt;br /&gt;
The algorithm determines the greatest common divisor of two integers. The algorithm is used&lt;br /&gt;
frequently in programming, integer arithmetic, number theory, and other areas of computing&lt;br /&gt;
and mathematics. In this section our goal is to learn the algorithm and prove its correctness.&lt;br /&gt;
We start with the following definition.&lt;br /&gt;
&lt;br /&gt;
===The algorithm===&lt;br /&gt;
&lt;br /&gt;
# If n = m then output n as gcd(n,m) and stop&lt;br /&gt;
# If n &amp;gt; m then initialize a = n and b = m. Otherwise, initialize a = m and b = n.&lt;br /&gt;
# Apply the division theorem to a and b by finding integers q and r such that a = q · b + r, where 0 � r &amp;lt; b.&lt;br /&gt;
# If r = 0 then output b as gcd(n,m) and stop. Otherwise, set a = b and b = r. Go to line 3.&lt;br /&gt;
&lt;br /&gt;
====Example====&lt;br /&gt;
n=123, m=156&lt;br /&gt;
&lt;br /&gt;
a=156, b=123&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
156= 1.123+33&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First remainder is r=33, q =1&lt;br /&gt;
&lt;br /&gt;
a2=123, b2=33&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
123= 3.33+24&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Second value of r=24, q=3&lt;br /&gt;
&lt;br /&gt;
a3=33, b3=24&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
33=1.24+9&lt;br /&gt;
&lt;br /&gt;
24=2.9+6&lt;br /&gt;
&lt;br /&gt;
9=1.6+3&lt;br /&gt;
&lt;br /&gt;
a5=9 b5=6, r5=3,15=1&lt;br /&gt;
&lt;br /&gt;
6=2.3+0    r=0 so output b&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Modulo Arithmatic==&lt;br /&gt;
&lt;br /&gt;
In this section we introduce the modulo arithmetic discovered by Gauss at the end of the eighteenth&lt;br /&gt;
century. Modulo arithmetic is nowadays applied in number theory, abstract algebra,&lt;br /&gt;
cryptography, etc. The fundamental arithmetic operations performed by most computers are&lt;br /&gt;
actually modulo arithmetic operations, where the modulus is 232. For example, arithmetic operations&lt;br /&gt;
on integers of most programming languages such as Java or C are all taken modulo 232.&lt;br /&gt;
Therefore, for us it is useful to understand and learn some of the basics of modulo arithmetic.&lt;br /&gt;
&lt;br /&gt;
0&lt;br /&gt;
+¯0 =¯0, ¯0 +¯1 =¯1, ¯1 +¯0 =¯1, and ¯1 +¯1 =¯0,&lt;br /&gt;
and&lt;br /&gt;
¯0&lt;br /&gt;
·¯0 =¯0, ¯0 ·¯1 =¯0, ¯1 ·¯0 =¯0, and ¯1 ·¯1 =¯1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Definition 3. Say that integers n and m are congruent modulo p if p is a factor of n − m.&lt;br /&gt;
&lt;br /&gt;
say for p=3&lt;br /&gt;
&lt;br /&gt;
{0,3,-3,6,-6,9,-9,12,-12}&lt;br /&gt;
&lt;br /&gt;
{1,4,-2,7,-5,10,-8}&amp;lt;- such that when divided by 3 the remainder is 0.&lt;br /&gt;
&lt;br /&gt;
Theorem 6. &amp;#039;&amp;#039;&amp;#039;Integers n and m are congruent modulo p&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;if and only if&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;when divided by p both&lt;br /&gt;
give the same remainder.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
To prove the theorem we must show that &lt;br /&gt;
# If A then B&lt;br /&gt;
# If B then A&lt;br /&gt;
&lt;br /&gt;
Take n,m congrigent mod. p  n-m=kp fore some k. We want to show that when divided by p, m,n give the same remainder.&lt;br /&gt;
&lt;br /&gt;
Divide n,m by p. &lt;br /&gt;
 n=q1.p+r1&lt;br /&gt;
 m=q2.p+r2&lt;br /&gt;
We want to show r1=r2&lt;br /&gt;
&lt;br /&gt;
n-m=(q1-q2).p+(r1-r2) [can be divided through by p]&lt;br /&gt;
&lt;br /&gt;
rest in lecture notes.&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>