Proof of Altered Division Algorithm

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 2K views
tylerc1991
Messages
158
Reaction score
0

Homework Statement



Show that, for positive integers [itex]a[/itex] and [itex]b[/itex], there exists unique integers [itex]q[/itex] and [itex]r[/itex] such that

[itex]a = bq + r[/itex] and [itex]-b/2 < r \leq b/2[/itex].

Homework Equations



We can assume the standard division algorithm holds. That is, for integers [itex]a[/itex] and [itex]b[/itex], there exists unique integers [itex]q[/itex] and [itex]r[/itex] such that

[itex]a = bq + r[/itex] and [itex]0 \leq r < b[/itex].

Let [itex][\cdot][/itex] represent the floor function.

The Attempt at a Solution



Suppose [itex]a[/itex] and [itex]b[/itex] are positive integers. By the division algorithm, there exists unique integers [itex]q[/itex] and [itex]r[/itex] such that

[itex]a = bq + r[/itex] and [itex]0 \leq r < b[/itex].

At this point, I let [itex]r' = [b/2] - r[/itex]. Since [itex]0 \leq r[/itex], we have that [itex]-r \leq 0[/itex], which implies [itex][b/2] - r = r' \leq [b/2] \leq b/2[/itex] by the definition of the floor function. Also, since [itex]r < b[/itex], we see that [itex]-r > -b[/itex], which implies [itex][b/2] - r > [b/2] - b = [-b/2] \geq -b/2[/itex].

This is where I get stuck. I have found an integer [itex]r'[/itex] that gives [itex]-b/2 < r' \leq b/2[/itex], but now I have to find an integer [itex]q'[/itex] to satisfy [itex]a = bq' + r'[/itex]. Any ideas?
 
Last edited:
Physics news on Phys.org
tylerc1991 said:

Homework Statement



Show that, for positive integers [itex]a[/itex] and [itex]b[/itex], there exists unique integers [itex]q[/itex] and [itex]r[/itex] such that

[itex]a = bq + r[/itex] and [itex]-b/2 < r \leq b/2[/itex].

Homework Equations



We can assume the standard division algorithm holds. That is, for integers [itex]a[/itex] and [itex]b[/itex], there exists unique integers [itex]q[/itex] and [itex]r[/itex] such that

[itex]a = bq + r[/itex] and [itex]0 \leq r < b[/itex].

Let [itex][\cdot][/itex] represent the floor function.

The Attempt at a Solution



Suppose [itex]a[/itex] and [itex]b[/itex] are positive integers. By the division algorithm, there exists unique integers [itex]q[/itex] and [itex]r[/itex] such that

[itex]a = bq + r[/itex] and [itex]0 \leq r < b[/itex].

At this point, I let [itex]r' = [b/2] - r[/itex]. Since [itex]0 \leq r[/itex], we have that [itex]-r \leq 0[/itex], which implies [itex][b/2] - r = r' \leq [b/2] \leq b/2[/itex] by the definition of the floor function. Also, since [itex]r < b[/itex], we see that [itex]-r > -b[/itex], which implies [itex][b/2] - r > [b/2] - b = [-b/2] \geq -b/2[/itex].

This is where I get stuck. I have found an integer [itex]r'[/itex] that gives [itex]-b/2 < r' \leq b/2[/itex], but now I have to find an integer [itex]q'[/itex] to satisfy [itex]a = bq' + r'[/itex]. Any ideas?

The r' you have, will not work as the remainder of the altered algorithm. I don't know if that's what you intended or not.
 
SammyS said:
The r' you have, will not work as the remainder of the altered algorithm. I don't know if that's what you intended or not.

Right. The solution above doesn't work. I ended up choosing r' depending on what r - b was, which gives the desired result. Hopefully that helps anyone who has this problem in the future.
 
tylerc1991 said:
Right. The solution above doesn't work. I ended up choosing r' depending on what r - b was, which gives the desired result. Hopefully that helps anyone who has this problem in the future.
Right !

or ...
Let r ' = r , q ' = q

If r ' > b/2 then: r ' = r - b and q ' = q + 1 .