Can we find matrix modular inverse as

?

Related question/answer

# | User | Rating |
---|---|---|

1 | tourist | 3434 |

2 | fateice | 3337 |

3 | Um_nik | 3292 |

4 | OO0OOO00O0OOO0O0…O | 3280 |

5 | Syloviaely | 3274 |

6 | Petr | 3223 |

7 | Swistakk | 3105 |

8 | mnbvmar | 3096 |

9 | yosupo | 3091 |

10 | dotorya | 3081 |

# | User | Contrib. |
---|---|---|

1 | rng_58 | 164 |

2 | tourist | 163 |

3 | csacademy | 153 |

4 | Petr | 150 |

5 | Swistakk | 149 |

6 | Um_nik | 144 |

7 | Nickolas | 142 |

7 | Vovuh | 142 |

9 | BledDest | 138 |

9 | PikMike | 138 |

9 | matthew99 | 138 |

9 | Errichto | 138 |

Can we find matrix modular inverse as

?

Related question/answer

↑

↓

Codeforces (c) Copyright 2010-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jul/18/2018 17:33:44 (d1).

Desktop version, switch to mobile version.

User lists

Name |
---|

clearly no?

A= 2*I where I is the identity

P = 5

A^3 = (2*I)^3 = 8*I, while A^-1 = (0.5*I).

. For scalar matrices it's true: it's just a usual Fermat's Little Theorem.

right, sorry my bad for giving such a poor example as i wanted to ease calculation.

For diagonal matrices it's also true. For diagonalisable invertible matrices, it looks OK, surprisingly. For matrices not diagonalisable, it is in general false. See e.g.

To the power a it is

therefore the inverse is given for the power a=p-1 and not p-2 (yeah it's close, but...)

For arbitrary matrices it's false. For example, .

M^{p - 1}= 2^{(p - 1) / 2}E. If 2 isn't a square modulop,M^{p - 1}≠E.Also you can use Lagrange's theorem for group. The order of this group is (

p^{n}- 1)(p^{n}-p)... (p^{n}-p^{n - 1}). Forn= 2 we getA^{(p2 - 1)(p2 - p)}=E. Doesn't look like the best estimation, though.Thank you :)

The fact that the right hand side always exists and the left hand side doesn't have to exist hints that it shouldn't be so.

Look up the Jordan form. Not only does it tell you when it's possible to use FLT, it basically gives you a formula for matrix powers (in , not ). Of course, computing the Jordan form is itself difficult and you're better off just using fast exponentiation.