Re: help! modular arith and matrixes
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


sci.crypt archive

Re: help! modular arith and matrixes

From: aleterra <aleterra@yahoo.com>
Date: Sun Sep 18 2005 - 23:50:51 CEST

Ok, here's what I got, but I am not sure whether it is ok, could you
take a look at it?

Thanks!

A=(a b)
  (c d)

INV(A) = INV(det A) . (d -b)
                           (-c a )

I have splitted the solution into 4 sections, calculating the
number of matrixes complying det A=1 (using mod 2 and mod 13)
and those complying det A=-1,, also using mod 2 and mod 13.

-----------------------------------------------------------------

For det A=-1 modulo 13

a=-d
b=b
c=c
d=-a

ad-bc= -1

-1 mod 26 = 12 mod 13

a.d + 12.bc = 12 (mod 13)

d = 12 a (mod 13)

=> a has to be a=0 or a=1, otherwise d would be bigger than 12

12.a.a + 12.b.c = 12

a.a+b.c=1

=> a = 1 and b=0 and c=n (being n={0,12})

or a = 1 and c=0 and b=n (being n={0,12})

or a = 0 and b=1 and c=1

counting all the possible matrixes we have 26 possibilities
for det A=-1 mod 13

--------------------------------------------

For det A=-1 mod 2:

a=-d
b=b
c=c
d=-a

-1 mod 26 = 1 mod 2

ad-bc=-1

a=-d then a=-1.d mod 26

then a=1.d mod 2

a.a+bc=1

then the possible values are:

=> a = 1 and b=0 and c=n (being n={0,1})

or a = 1 and c=0 and b=n (being n={0,1})

or a = 0 and b=1 and c=1

counting all the possible matrixes we have 4 possibilities
for det A=-1 mod 2

------------------------------------------------------

For det A=1 mod 13:

a=d
b=-b
c=-c
d=a

b=0
c=0
ad-cb=1

ad=1 mod 13

1 mod 13 = 1,14,27,40,53,66,79....

Then, the possible values with b=0 and c=0 are:

a=1 d=1
a=2 d=7
a=7 d=2
a=9 d=3
a=3 d=9
a=10 d=4
a=4 d=10
a=11 d=6
a=6 d=11

counting all the possible matrixes we have 9 possibilities
for det A=1 mod 13

----------------------------------------------------------
for det A=1 mod 2

b=0
c=0

a.d-cb=1

ad=1 mod 2

1 mod 2= 1,3,....

Possible values a=1 d=1

counting all the possible matrixes we have 1 possibilities
for det A=1 mod 2

----------------------------------------------------------

Now, if we find the number of matrixes for det A=-1:

quantity of matrixes in mod 13 x in mod 2: 26 x 4 = 104

Doing the same for det A=1

quantity of matrixes in mod 13 x in mod 2: 9 x 1 = 9

Adding both quantities: 104+9 = 113 matrixes
Received on Thu Sep 29 21:55:37 2005