Question: Question 2 . Let L be the lattice generated by the basis B = { ( 3 , 1 , - 2 ) , (

Question 2. Let L be the lattice generated by the basis
B={(3,1,-2),(1,-3,5),(4,2,1)}.
Which of the following sets are also bases for the same lattice L?
(1)B1={(5,13,-13),(0,-4,2),(-7,-13,18)}
(2)B2={(4,-2,3),(6,6,-6),(-2,-4,7)}
Prove your answer for each. If the basis generates the same lattice, find the
change of basis matrix A such that the matrix B whose columns are the
vectors of B(in order) and matrix Bi the matrix with columns given by Bi,
then B=BiA. In this case, compute the Hadamard constants of each basis,
and determine which is the better basis for L.
Alice and Bob use the GGH cryptosystem to communicate. Alice's private
key, the dimension n, the matrix of column vectors V=([v1,v2,cdots,vn]), and
public key W=VE where E is a matrix of elementary column operations, is
given in the file hw10-data.txt. Encoding and decoding functions, encode
and decode, are also given. Bob sends Alice an encrypted message e given by
e=Wm+r
where m is the vector correspoding to the encoded message. Notice that since
W is also a basis for L, and minZn, the vector WminL=Zv1+cdots+Zvn.
####################### FUNCTIONS #######################
### You can safely run this entire block at any point ###
### until you see the next block begin below. ###
def H(m):
"""
This function returns the Hadamard constant of the (assumed square)
matrix m.
"""
n = m.dimensions()[0]
return RR(abs(m.det())/prod([RR(norm(m.column(i))) for i in range(n)]))^(1/n)
def encode(s):
s = str(s)
if len(s)> n:
print('Error, string too long.')
return
return vector(ZZ,[ord(s[i])-64 for i in range(len(s))]+[-64 for i in range(n-len(s))])
def decode(s):
v =[]
for i in range(len(s)):
if s[i]==-64:
return ''.join(v)
v.append(chr(s[i]+64))
return ''.join(v)
def printmatrix(M):
"""
This gives an output you can copy/paste and get back
as a matrix by saying matrix((the output here))
"""
return [[ x for x in M.row(i)] for i in range(n)]
def KnapsackMatrix(M, S):
"""
Return the row matrix which corresponds to the knapsack problem
"""
v =[]
n = len(M)
for i in range(n):
t =[0 for j in range(n+1)]
t[i]=2
t[n]= M[i]
v.append(t)
t =[1 for j in range(n+1)]
t[n]= S
v.append(t)
### End of functions block ###
###################################################
#################### PROBLEMS 1-9 ####################
V = matrix([[-3,9,-17,-2,-11,-5,-8,0,10,-1,2,5,-8,18,7,5,0,-14,-5,-10,-16,-16,6,1,-1,20,-12,-6,8,-3,19,4,-18,-6,-16,9,-5,-3,14,-9,-14,17,7,11,10,-12,12,11,11,16],[-20,17,7,9,13,13,1,13,-2,12,-3,-5,7,17,-15,-7,16,-4,14,20,-11,-10,5,-13,-1,-12,-6,-8,-18,17,15,-6,-17,17,-18,6,-11,-7,5,0,-2,15,1,-10,-8,8,-5,6,-15,-4],[-6,-6,-2,12,10,7,-7,20,19,5,6,-11,12,16,5,-4,18,10,5,3,-18,3,-10,-15,18,-8,-10,-4,-6,17,-9,-17,-16,-7,-4,13,2,5,-16,3,0,3,20,14,-3,-5,9,-14,19,-7],[18,7,11,7,-20,11,-1,-6,-18,20,-6,-8,-9,-18,-8,10,-12,-18,2,-12,-1,-2,12,16,13,16,16,-17,-6,-17,5,20,8,11,0,-8,11,-7,-7,1,8,20,3,0,-1,-9,-12,-3,9,8],[-14,15,-17,14,-5,-18,-14,-2,13,12,5,4,15,3,15,-14,-11,-11,20,15,8,19,-12,4,1,6,-11,7,3,9,0,5,-4,3,19,7,6,18,9,3,-1,-6,14,-16,-14,13,-12,-5,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!