1.5 Algoritmo de Euclides con menor resto. - TEC-Digital
1.5 Algoritmo de Euclides con menor resto. - TEC-Digital
1.5 Algoritmo de Euclides con menor resto. - TEC-Digital
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Por ejemplo, si a = 144 y b = 89,<br />
Revista digital Matemática, Educación e I nternet (www.cidse.itcr.ac.cr/revistamate/). Vol 10, No 2. , Marzo 2010. 5<br />
144 = 89 · 1 + 55, r2 = 55 < b = 89<br />
144 = 89 · 2 − 34, r1 = 34 < b = 89<br />
Si a = 144 y b = −89, entonces q = �144/(−89)� + 1 = −2 + 1 = −1 y q + sgn(b) = −2.<br />
Entonces,<br />
144 = −89 · −1 + 55, r2 = 55 < |b| = 89<br />
144 = −89 · −2 − 34, r1 = 34 < |b| = 89<br />
Cálculo <strong>de</strong>l <strong>menor</strong> <strong>resto</strong>. En la sección <strong>1.5</strong> vamos a necesitar el teorema <strong>de</strong> la división pero <strong>con</strong><br />
el <strong>menor</strong> <strong>resto</strong>. Para simplificar los cálculos, queremos calcular el <strong>menor</strong> <strong>resto</strong> usando una fórmula<br />
directa. Consi<strong>de</strong>remos la ecuación 1.4. Como se observa en la figura 1.4, uno <strong>de</strong> los <strong>resto</strong>s es<br />
<strong>menor</strong> que |b|/2. Si r = Mín{r1, r2} entonces, existe q ′ ∈ Z tal que<br />
bq<br />
a = bq ′ ± r <strong>con</strong> 0 ≤ r ≤ |b|/2.<br />
r2<br />
|b|<br />
Figura 1.4<br />
a<br />
r1<br />
|b|/2<br />
Para los cálculos que vamos a hacer aquí solo necesitamos tratar el caso en que a ≥ 0 y b > 0.<br />
Para comparar los <strong>resto</strong>s a − b · �a/b� y b · (�a/b� + 1) − a usamos el hecho <strong>de</strong> que a/b =<br />
�a/b� + pfrac(a/b).<br />
Así,<br />
• El <strong>menor</strong> <strong>resto</strong> es a − b · �a/b� si pfrac(a/b) ≤ 1/2. En efecto,<br />
a − b · �a/b� ≤ b · (�a/b� + 1) − a<br />
2a ≤ 2b · �a/b� + b<br />
2a/b ≤ 2�a/b� + 1, como a/b = �a/b� + pfrac(a/b),<br />
pfrac(a/b) ≤ 1/2.<br />
• De manera análoga, a − b · �a/b� ≥ b · (�a/b� + 1) − a si pfrac(a/b) ≥ 1/2.