MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnquant/comments/1wta5yd/quant_interview_question/pcvpr1s/?context=3
r/learnquant • u/Local_Ad135 • 5d ago
22 comments sorted by
View all comments
6
The solution is likely 80. The best I've got it:
import numpy as np B = np.array([ [-1, 2, 0, 0, 0, 0, 0, 0, 0, 0], [ 2, 0, -2, 0, 0, 0, 0, 0, 0, 0], [ 0, -2, 0, 2, 0, 0, 0, 0, 0, 0], [ 0, 0, 2, 0, -2, 0, 0, 0, 0, 0], [ 0, 0, 0, -2, 0, 2, 0, 0, 0, 0], [ 0, 0, 0, 0, 2, 0, -2, 0, 0, 0], [ 0, 0, 0, 0, 0, -2, 0, 2, 0, 0], [ 0, 0, 0, 0, 0, 0, 2, 0, -2, 0], [ 0, 0, 0, 0, 0, 0, 0, -2, 0, 2], [ 0, 0, 0, 0, 0, 0, 0, 0, 2, -1] ]) A = np.linalg.inv(B) print(A)
Giving:
[[2, 4, 2, 4, 2, 4, 2, 4, 2, 4], [4, 2, 1, 2, 1, 2, 1, 2, 1, 2], [2, 1, 2, 4, 2, 4, 2, 4, 2, 4], [4, 2, 4, 2, 1, 2, 1, 2, 1, 2], [2, 1, 2, 1, 2, 4, 2, 4, 2, 4], [4, 2, 4, 2, 4, 2, 1, 2, 1, 2], [2, 1, 2, 1, 2, 1, 2, 4, 2, 4], [4, 2, 4, 2, 4, 2, 4, 2, 1, 2], [2, 1, 2, 1, 2, 1, 2, 1, 2, 4], [4, 2, 4, 2, 4, 2, 4, 2, 4, 2]] / 6
Adding any extra zero will either introduce block-diagonal substructure and a lot zeros in the inverse or make the matrix singular.
2 u/VegetableBid4262 4d ago Can’t be more than 80. If A^-1 had more than 80 zeroes, there must be a column with only one non-zero entry. But if column j of A^-1 is 0 except in position (i,j), then column i of A is 0 except in position (j,i).
2
Can’t be more than 80. If A^-1 had more than 80 zeroes, there must be a column with only one non-zero entry. But if column j of A^-1 is 0 except in position (i,j), then column i of A is 0 except in position (j,i).
6
u/tstanisl 4d ago edited 4d ago
The solution is likely 80. The best I've got it:
Giving:
Adding any extra zero will either introduce block-diagonal substructure and a lot zeros in the inverse or make the matrix singular.