Matrices and Modulus
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Matrices and Modulus
I need assistance. Can anyone tell me what the inverse of the matrix
| 7 2 |
| 1 1 |
( lol ascii art )
is, in mod 26? I know the determinant is 5, so I just need to find a number that I can multiply 5 by to get 1 (mod 26). The problem is, it can't be a float because it's working towards a decryption matrix... It has to be an integer.
Any ideas? I'm sure there's at least one maths genius out there .
| 7 2 |
| 1 1 |
( lol ascii art )
is, in mod 26? I know the determinant is 5, so I just need to find a number that I can multiply 5 by to get 1 (mod 26). The problem is, it can't be a float because it's working towards a decryption matrix... It has to be an integer.
Any ideas? I'm sure there's at least one maths genius out there .
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Hey, that's correct! Thanks so much!
How on earth did you figure that out?
Edit: wait. It's not right. The inverse of the initial matrix comes out as
Multiplying against the initial matrix should return the identiy matrix:
But it doesn't... Any ideas? I've been at this for a day and a half and it's sending me crazy.
How on earth did you figure that out?
Edit: wait. It's not right. The inverse of the initial matrix comes out as
Code: Select all
| 21 10 |
| 5 17 |
Code: Select all
| 1 0 |
| 0 1 |
Algebra + search with pruning:
5 * x = 26 * y + 1
Well, 26 * y has to end in either of the digits 4 or 9 (since 5 * anything always ends in 0 or 5, talking decimal here of course). 9 is out of the question, which just leaves 4, for which we can pick any number with last digit as 4, e.g. y = 4 => x = (1 + 26 * 4)/5 => x = 21.
.
5 * x = 26 * y + 1
Well, 26 * y has to end in either of the digits 4 or 9 (since 5 * anything always ends in 0 or 5, talking decimal here of course). 9 is out of the question, which just leaves 4, for which we can pick any number with last digit as 4, e.g. y = 4 => x = (1 + 26 * 4)/5 => x = 21.
.
Last edited by Zekrazey1 on Sat Apr 21, 2007 1:32 am, edited 1 time in total.
Wait a second, multiplying them does come out to the identity.
21 10 7 2
5 17 1 1
=
21 * 7 + 10 * 1 21 * 2 + 10 * 1
5 * 7 + 17 * 1 5 * 2 + 17 * 1
=
157 52
52 27
=
26 * 6 + 1 26 * 2 + 0
26 * 2 + 0 26 * 1 + 1
=
I (given mod 26)
21 10 7 2
5 17 1 1
=
21 * 7 + 10 * 1 21 * 2 + 10 * 1
5 * 7 + 17 * 1 5 * 2 + 17 * 1
=
157 52
52 27
=
26 * 6 + 1 26 * 2 + 0
26 * 2 + 0 26 * 1 + 1
=
I (given mod 26)
Last edited by Zekrazey1 on Sat Apr 21, 2007 1:43 am, edited 3 times in total.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
I can't get that:
I'm seriously confused.
Code: Select all
| 105 0 |
| 0 105 |
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Hey. I just got it! I took the inverse of the initial value and found the value of it in mod 26... I used this: http://wims.unice.fr/wims/wims.cgi.
Now, I just have to figure out why it didn't work every other time
Edit: oh. I just found out. I forgot about mod 26.
Now, I just have to figure out why it didn't work every other time
Edit: oh. I just found out. I forgot about mod 26.