0% found this document useful (0 votes)
6 views10 pages

Maths Lab 5

The document outlines an experiment focused on solving systems of linear equations using Python, including methods for calculation, verification, and graphical representation. It provides solutions for three sets of equations, tests the consistency of another set, and concludes the findings. Additionally, it includes instructions for writing Python programs to verify solutions and consistency of the equations presented.

Uploaded by

Yash Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views10 pages

Maths Lab 5

The document outlines an experiment focused on solving systems of linear equations using Python, including methods for calculation, verification, and graphical representation. It provides solutions for three sets of equations, tests the consistency of another set, and concludes the findings. Additionally, it includes instructions for writing Python programs to verify solutions and consistency of the equations presented.

Uploaded by

Yash Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

EXPERIMENT :- 5

AIM OF EXPERIMENT:- System of Linear Equations in python (Testing


Consistency, Numerical Solutions and Graphical Representation)

Q1) Solve the following system of linear equations by calculation using any method:

a) - 5x - 4y = 5
9x - 10y = - 9

b) 4x + y = 50
5x - 2y = 30

c) x - 2y = - 100
5x - 2y = 300

ANS:- a) Step 1: Multiply equations to align coefficients


Multiply the first equation by 9 and the second equation by 5 to make the coefficients
of x equal:
(−5x−4y)×9 = −45x−36y = 45
(9x−10y)×5 = 45x−50y =−45

Step 2: Add the equations


(−45 x – 36 y) + ( 45 x – 50 y) = 45+(−45)
−86 y = 0
Y=0
Step 3: Substitute y=0 into the first equation:
−5 x − 4(0) = 5
−5 x = 5
X = −1
Solution: x=−1, y=0
b) Step 1: Multiply the first equation by 2:
(4 x + y ) × 2 = 8x + 2y =100
Step 2: Add to the second equation:
(8 x+ 2 y)+ (5 x – 2 y) =100+30
13 x = 130
X =10
Step 3: Substitute x=10x = 10x=10 into the first equation:
4(10) + y = 50
40 + y = 50
Y = 10
Solution: x = 10, y = 10

c) Step 1: Subtract the first equation from the second:


( 5 x − 2y) − ( x − 2y) = 300−(−100)
5 x − 2 y − x + 2 y = 400
4 x = 400
X = 100
Step 2: Substitute x=100x = 100x=100 into the first equation:
100 − 2y = −100
−2y = −200
Y = 100
Solution: x = 100, y = 100
Q2) Write a python program to verify the solution of the above system of
linear equations.
ANS:-
Q3) 1) Write a python program for graphical representation and solutions of the
following system of linear equations.

a) - 5x - 4y = 5
9x - 10y = - 9

b) 4x + y = 50
5x - 2y = 30

c) x - 2y = - 100
5x - 2y = 300
ANS:-

a)
b)
c)
Q4) Test the consistency the following system of linear equations by calculation:
a) x + y + z = 4
2x - y + 3z = 5
3x + 2y + 5z = 10
x-y+z=2
b) x + 2y + 3z = 10
2x - y + z = 5
3x + y - 2z = 7
c) x + y + z = 6
2x + 2y + 2z = 12
3x + 3y + 3z = 18
ANS:-
(a) Checking Consistency
x+y+z=4
2x−y+3z=5
3x+2y+5z=10
x−y+z=2
This system has four equations and three unknowns, which suggests it may be
inconsistent or dependent.
Forming the matrices:

Since the number of equa ons exceeds the number of unknowns, we check
rank condi ons. If the rank of AAA is less than the number of equa ons, the
system is inconsistent.
Conclusion: The system is inconsistent (no solu on).
(b) Checking Consistency
x+2y+3z=10
2x−y+z=5
3x+y−2z=7

By performing row operations, we find that rank (A) = rank ( [ A ∣ B ] ) = 3, which


equals the number of unknowns.
Conclusion: The system is consistent with a unique solution.
(c) Checking Consistency
x+y+z=6
2x+2y+2z=12
3x+3y+3z=18
Since all rows are proportional, rank(A)=1and rank([A∣B])=1 , which is less than 3.
Conclusion: The system is consistent with infinitely many solutions (dependent
system).
Q5) Write a python program to verify the consistency of the above system of
linear equations
ANS:-

SUBMITTED BY:-
NAME:- ASHUTOSH PRADHAN
REGD. NO. :- 2301020856
SEM :- 4TH
GROUP :- 6
BRANCH :- CSE(AIML)

You might also like