Math 2.0

concept

Modular exponentiation

Summary

Modular exponentiation computes be mod mb^e \bmod m for integers bb, e≥0e \ge 0 and m≥1m \ge 1. The binary method writes ee in base 22. It squares bb again and again modulo mm, and it multiplies the squares b2ib^{2^i} for the bits ii of ee that are 11. It needs about 2log⁡2e2 \log_2 e multiplications modulo mm, and each intermediate number is smaller than m2m^2.

Remarks

The method is correct because of compatibility with multiplication: one can reduce modulo mm after each multiplication. The Fermat primality test, the RSA cryptosystem and the Diffie–Hellman key exchange all use modular exponentiation. The inverse problem, to find ee from bb, mm and be mod mb^e \bmod m, is the discrete logarithm problem. It seems much harder.

Explanations

L1 human

To compute 313 mod 73^{13} \bmod 7, write 13=8+4+113 = 8 + 4 + 1. The squares are 31≡33^1 \equiv 3, 32≡23^2 \equiv 2, 34≡43^4 \equiv 4 and 38≡23^8 \equiv 2. Then 313≡2⋅4⋅3=24≡3(mod7)3^{13} \equiv 2 \cdot 4 \cdot 3 = 24 \equiv 3 \pmod 7. You never need the large number 313=15943233^{13} = 1594323.

What this node needs for W1
  • an inventory row: the row of the inventory that the node accounts for (0 of 1)

The writing levels say how complete the text of a node is. They do not measure its truth.

What depends on this

3 nodes use this node, directly or through other nodes.

Sources

  1. Web https://en.wikipedia.org/wiki/Modular_exponentiation, Right-to-left binary method