0% found this document useful (0 votes)
28 views7 pages

5

Uploaded by

indra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views7 pages

5

Uploaded by

indra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

To find the value of

x in the equation
(
11111

)
m
o
d

12345
=
1
(11111⋅x)mod12345=1, you can use modular arithmetic. The equation can be written
as:

11111


1
(
m
o
d
12345
)
11111x≡1(mod12345)

This is equivalent to finding the modular multiplicative inverse of 11111 modulo


12345.

To find the modular inverse, you can use the extended Euclidean algorithm. The
algorithm will find two integers

a and

b such that
11111

+
12345

=
gcd
(
11111
,
12345
)
11111a+12345b=gcd(11111,12345). If
gcd
(
11111
,
12345
)
=
1
gcd(11111,12345)=1, then

a is the modular inverse of 11111 modulo 12345.

Applying the extended Euclidean algorithm:

Initialize:

=
11111
a=11111,

=
12345
b=12345
Set

1
=
0
,

1
=
1
,

2
=
1
,

2
=
0
x
1

=0,y
1

=1,x
2

=1,y
2

=0
Iteration:

Until


0
b

=0:

=


q=⌊a/b⌋
Update

a,b as

m
o
d

a=b,b=amodb
Update

1
,

2
x
1

,x
2

as

1
=

2
,

2
=

1

2
x
1
=x
2

,x
2

=x
1

−qx
2

Update

1
,

2
y
1

,y
2

as

1
=

2
,

2
=

1

2
y
1

=y
2

,y
2

=y
1

−qy
2

Result:
If
gcd
(
11111
,
12345
)
=
1
gcd(11111,12345)=1, then the

1
x
1

value is the modular inverse.


Let's apply the algorithm:

Iteration 1:

=
0
q=0,

=
11111
a=11111,

=
12345
b=12345

1
=
1
x
1

=1,

2
=
0
x
2

=0,

1
=
0
y
1

=0,

2
=
1
y
2

=1

Iteration 2:

=
0
q=0,

=
12345
a=12345,

=
11111
b=11111

1
=
0
x
1

=0,

2
=
1
x
2

=1,

1
=
1
y
1

=1,

2
=
0
y
2

=0

Now,
gcd
(
11111
,
12345
)
=
1
gcd(11111,12345)=1, and the

1
x
1

value is 1. Therefore, the modular inverse of 11111 modulo 12345 is 1.

So,

=
1
x=1 is the solution to the equation
(
11111

)
m
o
d

12345
=
1
(11111⋅x)mod12345=1.

You might also like