Re: Modular Exponentiation?
- From: magidin@xxxxxxxxxxxxxxxxx (Arturo Magidin)
- Date: Fri, 3 Nov 2006 19:15:01 +0000 (UTC)
In article <1162580362.106473.200470@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
<artlogic@xxxxxxxxx> wrote:
I'm sorry if this is the wrong place to post this, but I wondered if
someone could verify if this statement is true or false:
(X^Y) mod N = (((((X mod N) * X) mod N) * X) mod N) * ... caried out Y
times.
Be aware that you are using "mod" as an operator; in mathematics, this is almost
never the case. That is a common practice of Computer Science. But in
mathematics, "mod" represents a binary relation: we say a = b (mod N)
if and only if N divides a-b.
I will use your convention, though.
So you think of "mod N" as a function that, given an integer, returns
the remainder of dividing that integer by N.
The answer is "yes". This is far more obvious with the mathematical
notion, because
If a=b (mod N) and c=d (mod N), then ac = bd (mod N)
Proof: N|a-b since a=b (mod N). N|c*(a-b) = ac-bc.
Also, N|c-d, and therefore N|b*(c-d) = bc-bd.
Since N divides both ac-bc and bc-bd, then N divides the sum,
N|(ac-bc)+(bc-bd) = ac-bd.
So ac = bd (mod N).
In particular, if a=b (mod N), then a^n = b^n (mod N) for every
integer n.
Now, let t be the remainder of dividing X by N. Then your "X mod N"
means "t". Since X = t (mod N) (prove it), it follows that X^Y=t^Y
(mod N).
And X^Y = X^{Y-1)*t = X^{Y-2}*t^2 = X^{Y-r}*t^{r} (mod N) for any
integer 0<= r <= Y. With this you can prove what you want.
--
======================================================================
"It's not denial. I'm just very selective about
what I accept as reality."
--- Calvin ("Calvin and Hobbes" by Bill Watterson)
======================================================================
Arturo Magidin
magidin-at-member-ams-org
.
- Follow-Ups:
- Re: Modular Exponentiation?
- From: Helmut Richter
- Re: Modular Exponentiation?
- References:
- Modular Exponentiation?
- From: artlogic
- Modular Exponentiation?
- Prev by Date: Re: Solution for The Great Snowplow Chase
- Next by Date: Re: Elementary proof for -ve x -ve = +ve
- Previous by thread: Re: Modular Exponentiation?
- Next by thread: Re: Modular Exponentiation?
- Index(es):
Relevant Pages
|