<jupyter_start><jupyter_text><jupyter_code>import numpy as np<jupyter_output><empty_output><jupyter_text>Question 1<jupyter_code>A = np.eye(5) #this is a syntax that will display an identity matrix with a length of 5
print(A)<jupyter_output>[[1. 0. 0. 0. 0.]
 [0. 1. 0. 0. 0.]
 [0. 0. 1. 0. 0.]
 [0. 0. 0. 1. 0.]
 [0. 0. 0. 0. 1.]]<jupyter_text>Question 2<jupyter_code>B1 = np.array([[3,4,6,5],[0,8,3,2],[0,0,4,3],[0,0,0,6]])
print(B1)<jupyter_output>[[3 4 6 5]
 [0 8 3 2]
 [0 0 4 3]
 [0 0 0 6]]<jupyter_text>Question 3<jupyter_code>B2 = np.array([[1,2,6],[2,8,4],[6,4,5]])
print(B2)<jupyter_output>[[1 2 6]
 [2 8 4]
 [6 4 5]]<jupyter_text>Question 4<jupyter_code>C = np.array([[1,2,3],[2,3,3],[3,4,-2]]) #the given matrix C
print(C)

invC = np.linalg.inv(C) # this is the line that would convert matrix C to its inverse
print(" ")
print("Inverse")
print(" ")
print(invC)<jupyter_output>[[ 1  2  3]
 [ 2  3  3]
 [ 3  4 -2]]
 
Inverse
 
[[-3.6  3.2 -0.6]
 [ 2.6 -2.2  0.6]
 [-0.2  0.4 -0.2]]<jupyter_text>Question 5<jupyter_code>C = np.array([[1,2,3],[2,3,3],[3,4,-2]]) #the given matrix C the same in the previous number
print(C)

detC = np.linalg.det(C) # the command to solve the determinant
print(" ")
print("Determinant")
print(" ")
print(detC)<jupyter_output>[[ 1  2  3]
 [ 2  3  3]
 [ 3  4 -2]]
 
Determinant
 
5.000000000000001<jupyter_text>Question 6<jupyter_code>D = np.array([[5,4,1,3.4],[10,9,4,8.8],[10,13,15,19.2]]) ##this is the given matrix
print(D)

sqrtD = np.sqrt(D) # this line contains the command to find the roots of the given matrix
print(" ")
print("Roots")
print(" ")
print(sqrtD)<jupyter_output>[[ 5.   4.   1.   3.4]
 [10.   9.   4.   8.8]
 [10.  13.  15.  19.2]]
 
Roots
 
[[2.23606798 2.         1.         1.84390889]
 [3.16227766 3.         2.         2.96647939]
 [3.16227766 3.60555128 3.87298335 4.38178046]]
{'fraction_non_alphanumeric': 0.20575461454940283, 'fraction_numerical': 0.1482084690553746, 'mean_word_length': 3.539408866995074, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '84417', 'license': 'Apache-2.0', 'n_tokens_mistral': 1022, 'n_tokens_neox': 884, 'n_words': 207, 'path': 'Midterm_Exam.ipynb', 'repo_name': 'YushirohMurasakih/Linear-Algebra-58020', 'size': '1842'}