Your Task: Assuming A E Rnxn is a Matrix object, and b ER" is a Vec object, implement a function solve_qr(A, b) that use

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Your Task: Assuming A E Rnxn is a Matrix object, and b ER" is a Vec object, implement a function solve_qr(A, b) that use

Post by answerhappygod »

Your Task Assuming A E Rnxn Is A Matrix Object And B Er Is A Vec Object Implement A Function Solve Qr A B That Use 1
Your Task Assuming A E Rnxn Is A Matrix Object And B Er Is A Vec Object Implement A Function Solve Qr A B That Use 1 (99.94 KiB) Viewed 51 times
Your Task: Assuming A E Rnxn is a Matrix object, and b ER" is a Vec object, implement a function solve_qr(A, b) that uses the QR-factorization of A to compute and return the solution to the system Aă = V. Hints: 1. If A = QR, then Aă: = b becomes QR = b. What happens if we multiply both sides of the equation by the transpose of Q? i.e., What does QʻQRÍ = Q* simplify to? 2. Part of your code for the solvers in CA #6 will come in handy. = In [ ]: def solve_qr(a, b): # todo pass In [ ]: "TESTER CELL" = A = Matrix( [[2, -2, 18], [2, 1, 0], [1, 2, 0]]) X_true Vec( [3, 4, 5]) b = A * x_true print("Expected:", x_true) X = solve_qr(A, b) print("Returned:", x)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply