Тёмный
No video :(

The modular inverse via Gauss not Euclid 

Proof of Concept
Подписаться 9 тыс.
Просмотров 2,2 тыс.
50% 1

Опубликовано:

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 4   
@ivolol
@ivolol 2 года назад
if in each step instead of collecting bi, we just multiply the second paired value to a result that starts at 1 (mod p), you can write this as the following python: def mod_inv(a, p): res = 1 while a != 1: q, r = p // a, p % a if r < a - r: a, res = r, (res * -q) % p else: a, res = a - r, (res * (q + 1)) % p return res
@innovationsanonymous8841
@innovationsanonymous8841 3 месяца назад
Combining her notes from the previous video: ``` def mod_inv(a, p): _, x, _ = egcd(a, p) return (x % p + p) % p def egcd(a, b): if is_prime(b): # AKS ? return egcd_reference(a, b) return egcd_gauss(a, b) def egcd_gauss(a, b): x, y, u, v = 0, 1, 1, 0 while a != 0: q1, r1 = b // a, b % a q2, r2 = q1 + 1, a - r1 if r1
@Kaepsele337
@Kaepsele337 2 года назад
Does this work for any finite field?
@ProofofConceptMath
@ProofofConceptMath 2 года назад
Very interesting question! You could imitate the formalism using polynomials instead of integers (the usual model of finite fields). I think this works fine. It's a bit more work than the usual Euclidean algorithm, because you keep around p (which is now a big polynomial), instead of swapping it out for smaller things, like in the usual Euclidean algorithm. (In the prime modulus case also, this algorithm is slower than the euclidean one -- it's of more interest pedagogically than practically.)
Далее
Modular Arithmetic: Under the Hood
17:27
Просмотров 2 тыс.
The extended Euclidean algorithm in one simple idea
10:59
How to get Spongebob El Primo FOR FREE!
01:36
Просмотров 11 млн
Rethinking the real line #SoME3
14:54
Просмотров 96 тыс.
The Most Useful Curve in Mathematics [Logarithms]
23:43
Modular Arithmetic: In Motion
18:48
Просмотров 3 тыс.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Number Theory | Inverses modulo n
8:02
Просмотров 43 тыс.
Modular Arithmetic:  Addition in Motion
14:48
Просмотров 1,4 тыс.
The Euclidean Algorithm:  How and Why, Visually
13:29
Просмотров 31 тыс.