(a) Verify that c1=[0,0,3], c2=[0,3,0], c3=[3,0,0] are linearly independent vectors.

Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
icon
Related questions
Question

Pyhton Help)Linear Independence

(a) Verify that c1= [0,0,3], c2= [0,3,0], c3=[3,0,0] are linearly independent vectors.
Note: An explanation (~100 words) should be enough.
(b) Recall the definition of orthonormal vectors. Show that the following set forms an orthonormal vectors coding a new function in
Python which returns whether a given set is orthonormal or not.
5
6
1
1
##defining the required packages and the vectors to be checked.
2
import numpy as np
3 from numpy import linalg
4 ##defining the above vectors.
5
A = np.array((1/np.sqrt(2), 0,1/np.sqrt(2)))
6
B = np.array((0,1,0))
7
C = np.array((-1/np.sqrt(2),0,1/np.sqrt(2)))
√2
1#The function takes in 3 input 3D vectors and computes whether they are orthonormal or not.
2 #The function will output 1 if its orthonormal, and 0 if not.
3 def orthonormal_vectors (a,b,c):
##write your code
SHOSE
4 F ##HINT: sometimes, python can overcalculate the results for real numbers like square roots etc. it is fine to
use np.isclose() function
here
=
Transcribed Image Text:(a) Verify that c1= [0,0,3], c2= [0,3,0], c3=[3,0,0] are linearly independent vectors. Note: An explanation (~100 words) should be enough. (b) Recall the definition of orthonormal vectors. Show that the following set forms an orthonormal vectors coding a new function in Python which returns whether a given set is orthonormal or not. 5 6 1 1 ##defining the required packages and the vectors to be checked. 2 import numpy as np 3 from numpy import linalg 4 ##defining the above vectors. 5 A = np.array((1/np.sqrt(2), 0,1/np.sqrt(2))) 6 B = np.array((0,1,0)) 7 C = np.array((-1/np.sqrt(2),0,1/np.sqrt(2))) √2 1#The function takes in 3 input 3D vectors and computes whether they are orthonormal or not. 2 #The function will output 1 if its orthonormal, and 0 if not. 3 def orthonormal_vectors (a,b,c): ##write your code SHOSE 4 F ##HINT: sometimes, python can overcalculate the results for real numbers like square roots etc. it is fine to use np.isclose() function here =
In -
1 ##defining the required packages and the vectors to be checked.
2
import numpy as np.
from numpy import linalg
In
In
3
4
5
6
7
##defining the above vectors.
A = np.array((1/np.sqrt(2),0,1/np. sqrt(2)))
B = np.array((0,1,0))
C = np.array((-1/np.sqrt(2), 0,1/np.sqrt(2)))
5
6
7
1#The function takes in 3 input 3D vectors and computes whether they are orthonormal or not.
2
#The function will output 1 if its orthonormal, and 0 if not.
3 def orthonormal_vectors (a,b,c):
48 ##HINT: sometimes, python can overcalculate the results for real numbers like square roots etc. it is fine to
use np.isclose() function
8 A
5
6
70
8
9
##write your code ...... here
#return whether they form an orthonormal vectors or not (the output variable has to return 0 or 1 based on the
conditions) (fill in the value or variable in ... to return the value)
return
1# Do not change code below - Just run this cell after running the cell above.
2 #on successful implementation it must output 'Success'
3 try:
4
if orthonormal_vectors (A, B, C) == 1:
print('Success')
else:
print('Failure')
06 A 3 A 19 16
except:
print('Incomplete implementation')
Transcribed Image Text:In - 1 ##defining the required packages and the vectors to be checked. 2 import numpy as np. from numpy import linalg In In 3 4 5 6 7 ##defining the above vectors. A = np.array((1/np.sqrt(2),0,1/np. sqrt(2))) B = np.array((0,1,0)) C = np.array((-1/np.sqrt(2), 0,1/np.sqrt(2))) 5 6 7 1#The function takes in 3 input 3D vectors and computes whether they are orthonormal or not. 2 #The function will output 1 if its orthonormal, and 0 if not. 3 def orthonormal_vectors (a,b,c): 48 ##HINT: sometimes, python can overcalculate the results for real numbers like square roots etc. it is fine to use np.isclose() function 8 A 5 6 70 8 9 ##write your code ...... here #return whether they form an orthonormal vectors or not (the output variable has to return 0 or 1 based on the conditions) (fill in the value or variable in ... to return the value) return 1# Do not change code below - Just run this cell after running the cell above. 2 #on successful implementation it must output 'Success' 3 try: 4 if orthonormal_vectors (A, B, C) == 1: print('Success') else: print('Failure') 06 A 3 A 19 16 except: print('Incomplete implementation')
Expert Solution
steps

Step by step

Solved in 3 steps with 16 images

Blurred answer
Similar questions
Recommended textbooks for you
Advanced Engineering Mathematics
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
Numerical Methods for Engineers
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
Introductory Mathematics for Engineering Applicat…
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
Mathematics For Machine Technology
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Basic Technical Mathematics
Basic Technical Mathematics
Advanced Math
ISBN:
9780134437705
Author:
Washington
Publisher:
PEARSON
Topology
Topology
Advanced Math
ISBN:
9780134689517
Author:
Munkres, James R.
Publisher:
Pearson,