Ask Question

How can you solve real world mathematical problems using two linear equations in two variables

+1
Answers (1)
  1. 26 September, 13:37
    0
    import numpy as np

    a = int (input ("Enter a"))

    b = int (input ("Enter b"))

    c = int (input ("Enter c"))

    d = int (input ("Enter d"))

    c1 = int (input ("Enter c1"))

    c2 = int (input ("Enter c2"))

    array1 = [[a, b],[c, d]]

    A = np. array (array1)

    B = np. array ([c1, c2])

    X = np. linalg. inv (A). dot (B)

    print (X)

    Explanation:

    let ax + by = c1

    cx + dy = c2

    We have used the above NumPy library that has the methods for matrix calculation, and here we have used matrix multiplication, and the inverse of a matrix to find the value of x and y.

    We know AX=B

    X = inv A. B

    And this we have used above. We can calculate inv A and do matrix multiplication using NumPy. And thus we get the above solution.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “How can you solve real world mathematical problems using two linear equations in two variables ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers