90 likes | 99 Views
Explore Thomas Jefferson's cipher with shift-based encoding, Hill Cipher using matrices, and Modular Matrix Math in an interactive lesson. Learn how to encode and decode messages using mathematical principles.
E N D
Governor’s School for the Sciences Mathematics Day 6
POTD: Thomas Jefferson • 1743-1826 (America) • Statesman • Architect • Naturalist • Linguist • Inventor • Mathematician? (Probably not)
Jefferson (?) Cipher • Jefferson did invent a mechanical encoding device where the encoding of each letter in the message is based on a key word • Our variation uses the key word as a rotating set of shifts for the addition cipher • Changes letter distribution; decipherer needs to know the key word
Example • Key word: MATH = 12,0,19,7 • Message: GSS ROCKSM: G S S R O C K S#: 6 18 18 17 14 2 10 18K:12 0 19 7 12 0 19 7E:18 18 11 24 0 2 19 25C: S S L Y A C T Z • Enciphered message: SSLYACTZ
Hill Cipher • Work with two letters at a time, using a 2x2 matrix to do the encoding • Letters: a, b Encoded Letters: A,B • A = n1*a + n2*b, B = n3*a + n4*b • All arithmetic is done mod 26
Example • GSS ROCKS = 6,18,18,17,14,2,10,18 • Encoding matrix = [1, 2; 3 5]; • Boardwork to get 16, 4, 0, 9, 18, 0, 20, 16 QEAJSAUQ • How about deciphering?
Modular Matrix Math • If A is a 2x2 matrix [a,b;c,d] then det(A) = ad-bc A-1 = (1/det(A))*[d,-b;-c,a] • If A is a matrix with integer entries det(A)*A-1has integer entries • A-1 (mod 26) is computed as (det(A))-1*(det(A)*A-1) where (det(A))-1 is the multiplicative inverse of det(A)
Examples • A = [1,2;3,5] det(A) = 5-6=-1=25 (det(A))-1 = 25 det(A)*A-1 = [5,-2;-3,1] A-1 = 25*[5,-2;-3,1] = [21,2;3,25] • A = [3,4;1,3] det(A) = 3*3-4*1 = 5 (det(A))-1 = 21 det(A)*A-1 = [3,-4;-1,3] A-1 = 21*[3,-4;-1,3] = [11,20;5,11]
Quiz Bowl Time Team 3 vs. Dr. Collins team one p vs. Denominators of Doom