Gram Schmidt Cryptohack !new! Jun 2026

Gram Schmidt Cryptohack !new! Jun 2026

: CryptoBook - Gram-Schmidt Orthogonalization provides the mathematical foundations used within the CryptoHack curriculum.

basis = [[1,2], [3,4]] orthogonal = gram_schmidt(basis) for u in orthogonal: print([float(x) for x in u]) # For readability # But submit as Fractions: (Fraction(1,1), Fraction(2,1)) # and (Fraction(4,5), Fraction(-2,5)) gram schmidt cryptohack

: Set the first orthogonal vector equal to the first input vector: u1=v1u sub 1 equals v sub 1 Iterate : For each subsequent vector Calculate the projection coefficients μijmu sub i j end-sub 1)) # and (Fraction(4

Compute ( \mu_2,1 ): [ \mu_2,1 = \fracv_2 \cdot u_1u_1 \cdot u_1 = \frac3\cdot1 + 4\cdot21^2 + 2^2 = \frac3 + 81 + 4 = \frac115 ] Thus, [ u_2 = v_2 - \frac115 u_1 = (3,4) - \frac115(1,2) = \left(3 - \frac115,\ 4 - \frac225\right) = \left(\frac45, -\frac25\right) ] 1 ): [ \mu_2