Question

Homework 4: please use python to find the answers. 1. Let A= 1 2 3 4 4 6 7 8 9 (a) What is A(2,3) (b) What is AT ? (c) Does A

0 0
Add a comment Improve this question Transcribed image text
Answer #1

### NOTE - EXECUTE THE BOLD COMMANDS T GET THE OUTPUT BELOW THEM ###

import numpy as np

In [3]:

m = [[1,2,3],[4,4,6],[7,8,9]]
#declaring the matrix

In [7]:

 
A = np.array(m)
print('The A(2,3) is : '+str(A[1][2]))
#printing the element at 2,3 location
The m(2,3) is : 6

In [10]:

arr1_transpose = A.transpose()
print(f'Transposed Array:\n{arr1_transpose}')
Transposed Array:
[[1 4 7]
 [2 4 8]
 [3 6 9]]

In [12]:

 
DetA = np.linalg.det(A)
print("The determinant of A is : ",DetA)
The determinant of A is :  12.0

In [13]:

#since DetA>0 so inverse exist 
print("The inverse of A is : ",np.linalg.inv(A))
The inverse of A is :  [[-1.00000000e+00  5.00000000e-01  1.26882631e-16]
 [ 5.00000000e-01 -1.00000000e+00  5.00000000e-01]
 [ 3.33333333e-01  5.00000000e-01 -3.33333333e-01]]

INTENDATION -

In [1] : import numpy as np In [3]: m = [[1,2,3], [4,4,6],[7,8,9]] #declaring the matrix In [7]: A = np.array(m) print(The A

QUESTION 2 -

part 1 and 3

import numpy as np

In [2]:

 
A = [[2,3,4],[1,-1,1],[4,1,-1]]
A = np.array(A)

In [4]:

print("The coeffecient matrix is : \n",A)
#printig the coeffecient matrix
The coeffecient matrix is : 
 [[ 2  3  4]
 [ 1 -1  1]
 [ 4  1 -1]]

In [6]:

 
B = np.array([1, 2, 3])
X = np.linalg.inv(A).dot(B)
#SOLUUTION  BY X = A^-1 B
print("The x y z values in array form are: \n",X)
The x y z values in array form are: 
 [ 1.         -0.71428571  0.28571429]

solution to part 2-

2 *8221 [3 z o Y. ] y Z 3 AX : B 2 3 4 x (3] 2 3 -) st 4 -)

output -

In [1]: import numpy as np In [2]: A = [[2,3,4],[1,-1,1],[4,1,-1]] A = np.array(A) In [4]: print(The coeffecient matrix is :

ASK ANY DOUBTS IN THE COMMENTS SECTION -

Add a comment
Know the answer?
Add Answer to:
Homework 4: please use python to find the answers. 1. Let A= 1 2 3 4...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 2,3, 6, 7 1. Without matrices, solve the following system using the Gaussian elimination method +...

    2,3, 6, 7 1. Without matrices, solve the following system using the Gaussian elimination method + 1 + HP 6x - Sy- -2 2. Consider the following linear system of equation 3x 2 Sy- (a) Write the augmented matrix for this linear system (b) Use row operations to transform the augmented matrix into row.echelon form (label all steps) (c) Use back substitution to solve the linear system. (find x and y) x + 2y 2x = 5 3. Consider the...

  • (1) Use Euclid's algorithm to determine the HCF of 126 and 366. Give details of your...

    (1) Use Euclid's algorithm to determine the HCF of 126 and 366. Give details of your working for each step. (2) Solve the following linear simultaneous equation using determinants (you must calculate Ao, A, and Ay): 2x + 3y = 20 x – 2y = -4 (3) Salvesta koying line (3) Solve the following linear simultaneous equation using determinants (you must calculate Ao, Ar, Ay and Ax): 2x + 3y – 4z = 17 x – y +z = -3...

  • 3. Write the following systems of linear equations using augmented matrix form a. 6x+7y= -9 X-y=...

    3. Write the following systems of linear equations using augmented matrix form a. 6x+7y= -9 X-y= 5 b. 2x-5y= 4 4x+3y= 5 C. x+y+z= 4 2x-y-z= 2 -x+2y+3z= 5 4. Solve the following Systems of linear equations using Cramer's Rule a. 6x-3y=-3 8x-4y= -4 b. 2x-5y= -4 4x+3y= 5 c. 2x-3y+z= 5 X+2y+z= -3 x-3y+2z= 1

  • use linear algebra methods to solve only please 2. Find the value(s) of a (if they...

    use linear algebra methods to solve only please 2. Find the value(s) of a (if they exist) for which the system of equations has: (a) No solution. (b) One unique solution. (c) Infinitely many solutions. x + y - z = 2 x + 2y + z = 3 2x + y - 4z = a

  • For the following exercises, solve a system using the inverse of a 3 x 3 matrix....

    For the following exercises, solve a system using the inverse of a 3 x 3 matrix. 16.4x + 4y + 4z = 40 4 4 х 140 2x - 3y + 4z = -12 -3 4 y - x + 3y + 4z = 9 -1 3 4 2 -12 2 G

  • 5. For the system, 4x + y + 2z = 1 2x + 3y + 4z...

    5. For the system, 4x + y + 2z = 1 2x + 3y + 4z = -5 x – y +3z = 3 Find the rank of the coefficient matrix by calculating the determinant. Use Cramer's theorem to find the solution of this system. (10 points) 6. Find the inverse of the following matrix using Gauss-Jordan method. Verify your result by computing the inverse using the method of determinants. (10 points) 1 2 4 2 4 2 1] 1...

  • these are 3 seperate questions please answer abcd for each 5 31 and v= 2 3...

    these are 3 seperate questions please answer abcd for each 5 31 and v= 2 3 -3 Calculate the dot product of u = 0-2 0 8 -8 -14 Let x = 3 , and z Determine whether z can be written as a linear combination of x and y. In other words, determine whether coefficients a and b exist, such that ax+ by = z Determine a and bif possible. a = -3, 6-2 No solution a=-2,1 a =...

  • 4 Let A12 and b4 14 (a) Find A-1 and use it solve the four equations...

    4 Let A12 and b4 14 (a) Find A-1 and use it solve the four equations Ax-b1, Ax b2 Ax b3, and Ax b4 (b) The four equations in part (a) can be solved by the same set of operations, since the coefficient matrix is the same in each case Solve the four equations in part (a) by row reducing the augmented matrix [A bj b2 b3 b4

  • Your problem is to find the optimal solution to the following linear programming model where X,...

    Your problem is to find the optimal solution to the following linear programming model where X, Y and Z represent the amounts of products X, Y and Z to produce in order to minimize some cost. Min 4X + 2Y + 6Z s.t. 6X + 7Y + 10Z ≤ 80                  (1) 2X + 4Y + 3Z ≤ 35                  (2) 4X + 3Y + 4Z ≥ 30                 (3) 3X + 2Y + 6Z ≥ 40                 (4)        X,Y,Z ≥...

  • JU, I - 4, y = -1 = (4, -1) The solution is the ordered pair...

    JU, I - 4, y = -1 = (4, -1) The solution is the ordered pair (4, -1) Check by substituting these values into the original equations. EXERCISES Use the substitution method to solve each system of linear equations. 1) x = y + 3 x + 7 = 2y 2) y = 2x 3x + y = 10 3) y = 3x 5x - 2y = 1 4) y = x + 4 3x + y = 16 5)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT