0% found this document useful (0 votes)
55 views1 page

Ultimu Studiu La Info

The document summarizes a program that uses Cramer's rule to solve systems of linear equations. The program defines matrices and vectors, calculates determinants recursively, transforms matrices by replacing columns with vectors, then calculates solutions by taking the determinant of the transformed matrix over the original determinant. It provides sample input and output, solving 10 examples of 2x2 systems of linear equations.

Uploaded by

Stanislav Bogza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views1 page

Ultimu Studiu La Info

The document summarizes a program that uses Cramer's rule to solve systems of linear equations. The program defines matrices and vectors, calculates determinants recursively, transforms matrices by replacing columns with vectors, then calculates solutions by taking the determinant of the transformed matrix over the original determinant. It provides sample input and output, solving 10 examples of 2x2 systems of linear equations.

Uploaded by

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

Metoda Cramer de rezolvare a sistemelor de ecuaţii liniare.

10𝑎 + 4𝑏 = 7 5𝑥 − 3𝑦 = 3
31. { } 36. { }
−7𝑎 + 8𝑏 = −5 −3𝑥 + 8𝑦 = 10

−x − 4y = 7 4𝑥 − 4𝑦 = −1
32. { } 37. { }
8x − 8y = 7 −10𝑥 + 6𝑦 = 5

10𝑥 − 3𝑦 = 9 −10𝑢 − 𝑣 = 10
33. { } 38. { }
𝑥 + 4𝑦 = 9 𝑢 + 𝑣 = −2

9𝑥 − 9𝑦 = −4 8𝑥 + 5𝑦 = 6
34. { } 39. { }
−9𝑥 + 5𝑦 = 7 −5𝑥 + 4𝑦 = 7

10𝑥 + 5𝑦 = 1 −7𝑎 + 8𝑏 = 1
35. { } 40. { }
8𝑥 + 10𝑦 = −9 4𝑎 − 9𝑏 = 4

Program P31; Rezultate:


type mat=array[1..3,1..3] of integer;
vec=array[1..3] of integer;
vs=array[1..3] of real;
var a : mat; 31)
b : vec; x[1]=0.704
sol : vs; x[2]=-0.009
p,n : integer;
de : real; 32)
function cdet( x:mat;t:integer):real; x[1]=2.100
var i,j,k,l: integer; x[2]=1.225
s : real;
minor : mat; 33)
begin x[1]=1.465
if t=1 then cdet:=x[1,1] x[2]=1.884
else
begin s:=0; 34)
for k:=1 to t do x[1]=-1.194
begin x[2]=-0.750
for i:=1 to t-1 do
for j:=1 to k-1 do minor[i,j]:=x[i+1,j]; 35)
for i:=1 to t-1 do x[1]=0.917
for j:=k to t-1 do minor[i,j]:=x[i+1,j+1]; x[2]=-1.633
if odd(k) then s:=s+x[1,k]*cdet(minor, t-1)
else s:=s-x[1,k]*cdet(minor, t-1); 36)
end; x[1]=1.742
cdet:=s; x[2]=1.903
end;
end; 37)
function transforma(x:mat;t,l:integer):real; x[1]=-0.875
var i : integer; x[2]=-0.625
begin for i:=1 to t do x[i,l]:=b[i];
transforma:=cdet(x,t); 38)
end; x[1]=-0.889
begin x[2]=-1.111
n:=2;
a[1,1]:= 10; a[1,2]:= 4; b[1]:= 7; 39)
a[2,1]:=-7; a[2,2]:= 8; b[2]:= -5; x[1]=-0.193
de:=cdet(a,n); x[2]=1.509
if de<>0 then
begin for p:=1 to n do sol[p]:= transforma(a,n,p)/de; 40)
for p:=1 to n do writeln('x[',p,']=',sol[p]:0:3); x[1]=-1.323
end x[2]=-1.032
else writeln('Calcul imposibil');
end.

You might also like