Apteronotus
- 201
- 0
Hi
Just a simple Mod question.
Is (ka)mod kb = k(a mod b)?
Thanks
Just a simple Mod question.
Is (ka)mod kb = k(a mod b)?
Thanks
The discussion revolves around the mathematical question of whether the expression (ka) mod kb is equal to k(a mod b). Participants explore this question through various examples, counterexamples, and proofs, focusing on the properties of the modulus operation and its implications in different scenarios.
Participants do not reach a consensus on the equality of (ka) mod kb and k(a mod b). Multiple competing views are presented, with some arguing for the equality and others against it, leading to an unresolved discussion.
Participants highlight that the validity of the equality may depend on specific conditions, such as the values of k, a, and b, and the assumptions made regarding their properties.
This discussion may be of interest to those studying modular arithmetic, number theory, or related mathematical fields, particularly in understanding the nuances of modulus operations and their properties.
Apteronotus said:Yes I do believe I am correct. Suppose
ka mod kb = c
and
a mod b = d
then this means that
ka = Z(kb)+c
and
a = Z(b)+d
where Z is an integer
Hence c/k=d, and if this is true then
ka mod kb = c = kd = k(a mod b)
Thank you for your reply anyway.
kntsy said:This is a special case.
[itex]ka=Z(kb)+c[/itex] and [itex]a=Z'(b)+d[/itex],where[itex]Z,Z'\in\mathbb Z[/itex]
But generally,[itex]Z\not =Z'[/itex]
JSuarez said:..., hence (kb mod ka) = a mod b, for [itex]k\geq 0[/itex].
HallsofIvy said:(ka) mod kb is the remainder when ka is divided by kb. Obviously, ka/kb= a/b and so has the same remainder as a divided by b. Therefore, the answer to your question is "no". What is true is that (ka) mod kb= a mod b.
zgozvrm said:And, by the way, the answer (if it was unclear by reading through this thread), is "yes"
k * (a mod b) = (ka) mod (kb) for ALL a, b, k such that k<>0 and b<>0 (otherwise, you will have a divide-by-zero error)