Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is what I have so far: (display Problem 2a. ) (newline)(newline) (display Solution:) (newline) (display (define (det2x2 a b c d) (- (* a

image text in transcribed

image text in transcribed

This is what I have so far:

(display "Problem 2a. ") (newline)(newline) (display "Solution:") (newline) (display "(define (det2x2 a b c d) (- (* a d) (* b c))) ")

(define (det2x2 a b c d) (- (* a d) (* b c)))

(newline) (display "Tests ") (display "---------------- ") (newline)

(display " (det2x2 2 -4 -6 12) = ") (det2x2 2 -4 -6 12) (newline)(newline)

(display " (det2x2 -3 1 2 7) = ") (det2x2 -3 1 2 7) (newline)(newline)

(display " (det2x2 1 0 0 1) = ") (det2x2 1 0 0 1)

2. A matrix is a rectangular grid of numbers organized into rows and columns. Matrices are an important tool in algebra and are often used to solve systems of linear equations. Below are examples of a couple of 2 x 2 matrices (matrices with 2 rows and 2 columns) that we will call M and N. _(2 -4 M = 16 12 ) N= ( 2 7) (a) A special value associated with any 2 x 2 matrix is the determinant. Given a generic 2 x 2 matrix, the determinant can be computed using the following formula: det | (a b) lc d) = ad bc Using the formula, we can compute the determinant of matrix M above as (2)(12) (-4)(-6) = 0. Write a Scheme procedure det2x2 to compute the determinant of a generic 2 x 2 matrix. Assume that the matrix elements a, b, c and d are given as four formal parameters. Compute the determinant of N. (b) A matrix is called invertible if its determinant is non-zero. Write a procedure that checks whether or not a generic 2 x 2 matrix is invertible. Verify that N is invertible and M is not invertible. (Note: you may want to use one or more of the primitive functions =, , each of which compares two numbers and evaluates to the boolean value #t or #f. There are also logical connectives and, or, and not for combining boolean values.) (c) A powerful property of matrices is that certain kinds of matrices may be meaningfully multiplied together to get another matrix. (It turns out that matrix multiplication is intimately related to composition of linear functions, but you won't need this interpretation to complete the assignment.) In particular, it is possible to multiply 2 x 2 matrices. Assume we have two matrices: The product of these matrices is defined to be (aja2 + b1c2ajb2 + b1d2 c1a2 + d1c2c1b2+d1d2) Given two 2 x 2 matrices, we wish to determine whether or not their product A B will be invertible. There are two ways to do this 1. Compute the product, as described above; then compute its determinant. 2. It is a remarkable fact that for two matrices A and B, det(A B) = det(A) det(B). Thus, we can compute the determinant of A B directly from the determinants of A and B. Give two different Scheme procedures to compute whether the product of a pair of matrices is invertible, one for each of the two methods described above. Assume elements a1, 61, Ci, d, a2, b2, C2 and d2 are given as eight formal parameters. (d) The determinant of a 3 x 3 matrix can be computed from the following formula: la b cl (d el det d e f = a x det ) - b x det ) +cx det \g h) - g h il df de C : 2) - ax det (. 1) ox de (5) ?) +ex de ($ 2.) 9 / Fill in the body of the following procedure to find the determinant of a 3 x 3 matrix: (define (det 3x3 a b c def gh i) ; your code here What is the determinant of 70 8 5 5 -11 1 -6 4 1) ? 2. A matrix is a rectangular grid of numbers organized into rows and columns. Matrices are an important tool in algebra and are often used to solve systems of linear equations. Below are examples of a couple of 2 x 2 matrices (matrices with 2 rows and 2 columns) that we will call M and N. _(2 -4 M = 16 12 ) N= ( 2 7) (a) A special value associated with any 2 x 2 matrix is the determinant. Given a generic 2 x 2 matrix, the determinant can be computed using the following formula: det | (a b) lc d) = ad bc Using the formula, we can compute the determinant of matrix M above as (2)(12) (-4)(-6) = 0. Write a Scheme procedure det2x2 to compute the determinant of a generic 2 x 2 matrix. Assume that the matrix elements a, b, c and d are given as four formal parameters. Compute the determinant of N. (b) A matrix is called invertible if its determinant is non-zero. Write a procedure that checks whether or not a generic 2 x 2 matrix is invertible. Verify that N is invertible and M is not invertible. (Note: you may want to use one or more of the primitive functions =, , each of which compares two numbers and evaluates to the boolean value #t or #f. There are also logical connectives and, or, and not for combining boolean values.) (c) A powerful property of matrices is that certain kinds of matrices may be meaningfully multiplied together to get another matrix. (It turns out that matrix multiplication is intimately related to composition of linear functions, but you won't need this interpretation to complete the assignment.) In particular, it is possible to multiply 2 x 2 matrices. Assume we have two matrices: The product of these matrices is defined to be (aja2 + b1c2ajb2 + b1d2 c1a2 + d1c2c1b2+d1d2) Given two 2 x 2 matrices, we wish to determine whether or not their product A B will be invertible. There are two ways to do this 1. Compute the product, as described above; then compute its determinant. 2. It is a remarkable fact that for two matrices A and B, det(A B) = det(A) det(B). Thus, we can compute the determinant of A B directly from the determinants of A and B. Give two different Scheme procedures to compute whether the product of a pair of matrices is invertible, one for each of the two methods described above. Assume elements a1, 61, Ci, d, a2, b2, C2 and d2 are given as eight formal parameters. (d) The determinant of a 3 x 3 matrix can be computed from the following formula: la b cl (d el det d e f = a x det ) - b x det ) +cx det \g h) - g h il df de C : 2) - ax det (. 1) ox de (5) ?) +ex de ($ 2.) 9 / Fill in the body of the following procedure to find the determinant of a 3 x 3 matrix: (define (det 3x3 a b c def gh i) ; your code here What is the determinant of 70 8 5 5 -11 1 -6 4 1)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions