Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10...

13
Simultaneous equations 10 Cramers rule J A Rossiter 1 Slides by Anthony Rossiter For a neat organisation of all videos and resources http://controleducation.group.shef.ac.uk/indexwebbook.html

Transcript of Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10...

Page 1: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Simultaneous equations 10 Cramers rule

J A Rossiter

1

Slides by Anthony Rossiter

For a neat organisation of all videos and resources

http://controleducation.group.shef.ac.uk/indexwebbook.html

Page 2: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Introduction

• The previous videos demonstrated that a matrix inverse is straightforward to define, in principle.

• A matrix inverse can then be used to solve linear simultaneous equations.

• However, the computation of the matrix inverse using cofactors and a determinant is computationally highly demanding and inefficient; we want some better alternatives.

• This video introduces Cramer’s rule which is efficient for some cases and therefore worth knowing.

Slides by Anthony Rossiter

2

Page 3: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Cramer’s rule

• Solve linear simultaneous equations represented as:

AX =B

• Assume a solution exists, that is |A|≠0, but we do not want to use the matrix inverse.

Cramer’s rule is good for low dimensional problems (say 2-4 equations) and/or where you only want to solve for a single unknown rather than the entire X vector.

Slides by Anthony Rossiter

3

Page 4: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Solving two equations in 2 unknowns

where a, b, c, d, e, f are given numbers

Multiply equation (i) by d, equation (ii) by b and subtract

Multiply equation (i) by

c, equation (ii) by a and

subtract

Unique solution exists if ad-bc≠0

Page 5: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Cramer’s Rule: Solving of two equations

Arrange all the coefficients in

a matrix.

Which determinants will give

the terms in the expressions

above?

𝑎 𝑏 𝑒𝑐 𝑑 𝑓

ed-bf=-𝑎 𝑏 𝑒𝑐 𝑑 𝑓

af-ec=𝑎 𝑏 𝑒𝑐 𝑑 𝑓

ad-bc=𝑎 𝑏 𝑒𝑐 𝑑 𝑓

Page 6: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Cramer’s rule

So, for the two by two case there is a simple link between the 2 by 3 matrix of coefficients and the solution.

Slides by Anthony Rossiter

6

=

𝑎 𝑏 𝑒𝑐 𝑑 𝑓

However, how do we explain the reversal of order of the columns for ∆x ?

Page 7: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Matrix definitions for Cramer’s ruleEach column of the original matrix is associated to a specific coefficient or the right hand side/constants.

1. To define ∆x replace the column of x-coefficients with the column of constants; take only the 1st 2 columns.

2. To define ∆y replace the column of y-coefficients with the column of constants ; take only the 1st 2 columns.

Slides by Anthony Rossiter

7

𝑎 𝑏 𝑒𝑐 𝑑 𝑓

𝑒 𝑏𝑓 𝑑

𝑎 𝑏 𝑒𝑐 𝑑 𝑓

𝑎 𝑒𝑐 𝑓

Page 8: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Matrix definitions for Cramer’s rule

Analogous operations apply for higher dimensions. Let’s illustrate a 3 x 3.

Slides by Anthony Rossiter

8

𝑎 𝑏 𝑐𝑑 𝑒 𝑓𝑔 ℎ 𝑗

𝑥𝑦𝑧

=𝑘𝑚𝑛

𝑘 𝑏 𝑐𝑚 𝑒 𝑓𝑛 ℎ 𝑗

= ∆𝑥Replace 1st column with

constant coefficients.

Replace 2nd column with

constant coefficients. 𝑎 𝑘 𝑐𝑑 𝑚 𝑓𝑔 𝑛 𝑗

= ∆𝑦

𝑎 𝑏 𝑐𝑑 𝑒 𝑓𝑔 ℎ 𝑗

= ∆

Replace 3nd column with

constant coefficients for ∆z.

Page 9: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Cramer with a 3 equations

Now in summary:

𝑥 =∆𝑥

∆; y =

∆𝑦

∆; z=

∆𝑧

∆;

The next slide gives a further illustration.

Slides by Anthony Rossiter

9

It is assumed that the extensions to higher dimensions

are obvious although would be rarely used in practice.

The computation of so many determinants could be

unwieldly and inefficient in general.

Page 10: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Cramer’s rule: Solving of three equations

Page 11: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Numerical illustration

1 1 11 −1 14 2 1

= 6 = ∆

−2 1 10 −1 13 2 1

= 12 = ∆𝑥

Page 12: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

Summary

• This brief resource introduced the Cramer’s rule for solving linear simultaneous equations.

• Cramer’s rule has the advantage of giving explicit formulae for each unknown coefficient in terms of the variables.

• For low numbers of equations (e.g. 2 or perhaps 3) it can be very efficient.

• However, for high numbers of equations it is likely to be an inefficient approach.

Slides by Anthony Rossiter

12

Page 13: Simultaneous equations 10 Cramers rulecontroleducation.group.shef.ac.uk/maths/simultaneous 10 -cramers r… · •This brief resource introduced the Cramer’s rule for solving linear

© 2018 University of Sheffield

This work is licensed under the Creative Commons Attribution 2.0 UK: England & Wales Licence. To view a copy of this licence, visit http://creativecommons.org/licenses/by/2.0/uk/ or send a letter to: Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.

It should be noted that some of the materials contained within this resource are subject to third party rights and any copyright notices must remain with these materials in the event of reuse or repurposing.

If there are third party images within the resource please do not remove or alter any of the copyright notices or website details shown below the image.

(Please list details of the third party rights contained within this work.

If you include your institutions logo on the cover please include reference to the fact that it is a trade mark and all copyright in that image is reserved.)

Anthony RossiterDepartment of Automatic Control and

Systems EngineeringUniversity of Sheffieldwww.shef.ac.uk/acse

For a neat organisation of all videos and resources

http://controleducation.group.shef.ac.uk/indexwebbook.html