Thursday, June 15, 2017

Binary Addition, Subraction,Multiplication,Division

Binary Addition

It is a key for binary subtraction, multiplication, division. There are four rules of binary addition.
Addition Table In fourth case, a binary addition is creating a sum of (1 + 1 = 10) i.e. 0 is written in the given column and a carry of 1 over to the next column.

Example − Addition

Addition Example

Binary Subtraction

Subtraction and Borrow, these two words will be used very frequently for the binary subtraction. There are four rules of binary subtraction.
Subtraction Table

Example − Subtraction

Subtraction Example

Rules of Binary Subtraction

  • 0 - 0 = 0
  • 0 - 1 = 1, and borrow 1 from the next more significant bit
  • 1 - 0 = 1
  • 1 - 1 = 0
For example,
00100101 - 00010001 = 00010100                  0  borrows
  0  0  1 10  0  1  0  1    =   37(base 10)
- 0  0  0  1  0  0  0  1
   =   17(base 10)
  0  0  0  1  0  1  0  0    =   20(base 10)

 
00110011 - 00010110 = 00011101              0 10  1  borrows
  0  0  1  1  0 10  1  1    =   51(base 10)
- 0  0  0  1  0  1  1  0
   =   22(base 10)
  0  0  0  1  1  1  0  1    =   29(base 10)

Binary Multiplication

Binary multiplication is similar to decimal multiplication. It is simpler than decimal multiplication because only 0s and 1s are involved. There are four rules of binary multiplication.
Multiplication Table

Example − Multiplication

Multiplication Example

Binary Division

Binary division is similar to decimal division. It is called as the long division procedure.

Example − Division


Division Example


 Exercises

Binary Addition

**Reminder: 1 + 1 = 10**

Questions

1. 101 + 11 =
2. 111 + 111 =
3. 1010 + 1010 =
4. 11101 + 1010 =
5. 11111 + 11111 =

Binary Subtraction

**Reminder: 10 - 1 = 1**

Questions

6. 110 - 10 =
7. 101 - 11 =
8. 1001 - 11 =
9. 1101 - 11 =
10. 10001 - 100 =



Binary Multiplication

**Hint: very similar to decimal multiplication**

Questions

11. 10 x 10 =
12. 100 x 11 =
13. 101 x 10 =
14. 1011 x 11 =
15. 11011 x 101 =



Binary Division

**Hint: very similar to decimal division**

Questions

16. 100 / 10 =
17. 111 / 11 =
18. 1010 / 100 =
19. 1101 / 11 =
20. 10111 / 10 =






Wednesday, June 14, 2017

Number System 1


Convert the following binary numbers to octal.
A.  111110110
B.  1000001
C.  10000010
D.  1100010
Convert the following binary numbers to hexadecimal.
A.  10101001
B.  11100111
C.  01101110
D.  01121111
Convert the following hexadecimal numbers to octal.
A.  A9
B.  E7
C.  6E
Convert the following octal numbers to hexadecimal.
A.  777
B.  605
C.  443
D.  521
E.  1
Convert the following decimal numbers to octal.
A.  901
B.  321
C.  1492
D.  1066
E.  2001
Convert the following decimal numbers to binary.
A.  45
B.  69
C.  1066
D.  99
E.  1
Convert the following decimal numbers to hexadecimal.
A.  1066
B.  1939
C.  1
D.  998
E.  43

Number Sytems

You probably already know what a number system is - ever hear of binary numbers or hexadecimal numbers? Simply put, a number system is a way to represent numbers. We are used to using the base-10 number system, which is also called decimal. Other common number systems include base-16 (hexadecimal), base-8 (octal), and base-2 (binary).

In this article, I'll explain what these different systems are, how to work with them, and why knowing about them will help you.


You may have noticed a pattern by now. Let's look at what is going on mathematically, using 2347 as an example.
  • As you saw, there are 2 groups of a thousand. Not coincidentally, 1000 = 10*10*10 which can also be written as 103.
  • There are 3 groups of a hundred. Again, not coincidentally, 100 = 10*10 or 102.
  • There are 4 groups of ten, and, 10 = 101.
  • Finally, there are 7 groups of one, and 1 = 100. (That may seem strange, but any number to the power of 0 equals 1, by definition.)
This is essentially the definition of base-10. To get a value of a number in base-10, we simply follow that pattern. Here are a few more examples:
  • 892 = 8*102+9*101+2*100
  • 1147 = 1*103+1*102+4*101+7*100
  • 53 = 5*101+3*100
Admittedly, this all seems a little silly. We all know what value a base-10 number is because we always use base-10, and it comes naturally to us. As we'll see soon, though, if we understand the patterns in the background of base-10, we can understand other bases better.

Binary to Octal and Octal to Binary Conversion


We know that binary and octal are two different kinds of number systems whose bases are 2 and 8 respectively, i.e. they use 2 and 8 digits respectively to represent their numbers and these numbers are 0, 1 (for binary) and 0, 1, 2, 3, 4, 5, 6, 7 (for octal). Now we can transform any numbers of these number system to other type of number system directly without going through the decimal numbers. What is being tried to said here that to transform a binary number into octal number we can first convert it into decimal number and then convert that number into octal number or we can convert the binary number directly into octal number, certainly the second method is more adaptable. This is also true for the reverse function, i.e. to transform an octal number into binary number. The two methods are described in the following articles.
 
Binary to Octal
the binary numbers are comprised of only 0 and 1 we have to first divide the binary number into group of 3 digits starting from the right most side, and balancing the number of digits by putting appropriate number of zeroes. Now we have certain numbers of group of binary numbers, then we have to convert those groups into decimal numbers and write in the same order in which they used to be. Now this is the octal equivalent of that binary number. If we consider an example, this will be very easy to understand.
Let us take a binary number say 1011010012
Now dividing it into group of three digits we will find the following pattern
101|101|001
Now writing the equivalent decimal number of each group we get
5 | 5 | 1
So the equivalent octal number is 5518

Octal to Binary Conversion

Now if we just imagine the reverse of the above explained operation we will be able to find out the method for converting octal number into binary number ourselves. In this case each of the digits of the octal number is converted into its equivalent binary number and they are merged into the same order they were when they were as octal numbers, the leftmost zeroes are omitted from the number and we get the equivalent binary number. An example is given hereby to explain the method easily.
Let us take a number 348
Now the binary equivalent of 3 is 011 and that of 4 is 100.
So, the desired binary equivalent of the octal number is 111002.


Decimal to Octal Conversion

Any decimal number can be converted into octal number system by dividing it by the largest possible power of 8.
 
The remainder then again divided by the largest possible power of 8, this method is repeated until the power of 8 is 1 and the remainder obtained is less than 8. The result is obtained by arranging the         obtained quotients as they are acquired. The method will be clear by a simple example                        Let us convert 13010 into octal number First of all                                                                               we have to divide it by the largest possible power of 8 i.e. 82
130 / 82 = 2
130 - 82×2 = 2
2 / 81 = 0
2 - 0 = 2
2/80 = 2
So the octal equivalent of 13010 is 2028

Octal to Decimal Conversion

Similarly any octal number can be converted into decimal number. The method is quite similar to the transformation of any binary number to decimal number, the only difference is that in this case the 2 s will be replaced by 8 and everything else i.e. the methods will remain same. So it is quite clear if we want to change any octal number into decimal number we have to start multiplying the digits of the number from right hand side with increasing powers of 8 staring from 0 and finally summing up all the products. The method will be clearer with an example.
Suppose we want to convert 1238 into decimal number, so we have to follow the procedure as shown below
1238 = 1×82 + 2×81 + 3×80 = 64 + 16 + 3 = 73
So, the decimal equivalent of the number 1238 is 7310

Binary to Hexadecimal and Hex to Binary Conversion


As we are going through the basics of the digital electronics the first and very important part is understanding the different types of number system. As we have already discussed about the properties of various number system and interrelation among some of them, now this is the time to interrelate binary and hexadecimal number system. The conversion from one number system is quite easy and we will discuss both the cases in the following articles i.e. from binary to hexadecimal and from hexadecimal to binary conversion.

Binary to hexadecimal Conversion

To convert a binary number to hexadecimal number first we have to divide the digits of the binary number into groups of four taking from the right most side of the number and in the last group the number of digits is made four by putting zeroes in the left most side.
 
After that the groups are converted into decimal numbers individually and written side by side in the same order as they were previously, now we have got the desired equivalent hexadecimal number of the binary number, an example will make it all clear for us.

We take any binary number suppose 1000101001012
Breaking it into groups of 4 we get
1000|1010|0101
Now converting all the groups into decimal numbers individually we get
8 | 10 | 5
So the desired hexadecimal equivalent of the binary number 1000101001012 is 8A516

Hexadecimal to Binary Conversion

Similarly the vice versa operation is also possible, i.e. we can convert any hexadecimal number into its equivalent binary number directly without any intermediate steps. The method is pretty easy, first of all we have to convert every digit of the hexadecimal number into its equivalent binary numbers (making every group a group of four by adding 0s to the left of the number). After all the digits are converted into binary numbers they are merged according to their positions to make the final binary number which is equivalent to the hexadecimal number is obtained. Now we will try to understand the method with the help of an example.
3DC16 is the hexadecimal number which we want to convert into binary. We know D and C are equivalent to 13 and 12 respectively in decimal number system.
Now converting each digit into its binary equivalent number we get
0011|1101|1100
Now merging all these groups binary numbers to make the final binary number we get 11110111002 which is the binary equivalence of the hexadecimal number 3DC16

Hexadecimal to Decimal and Decimal to Hexadecimal Conversion


The hexadecimal system is a number system with base 16. This number system is greatly used by modern computer system.

We already know about the decimal number system, binary number system and octal number system. Like those there is another number system called hexadecimal number system. As the name suggests there are 16 symbols in this number system starting from 0. Before explaining the number system we should know why this number system came into existence. The natural tendency of human is to use decimal number system because they are familiar with this as the use of 0 is very easy and the operations are user friendly. And the computer systems used binary systems earlier because there are only two states on and off. But as the dependency on computer grew up and different mathematical programs and different softwares needed to be developed there came the need to develop a number system having base larger than decimal and 16 was chosen because the bits, bytes are multiples of it.
Now days this number system is used in HTML and CSS, hexadecimal notations are used in them. This number system was first used around 1956 in Bendix G-15 computer. Now coming to the representation of hexadecimal number system, in this number system there are 16 basic digits by which all the numbers can be represented, these are 0, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F the first 10 digits are similar to decimal number system but the last 6 digits represent 10, 11, 12, 13, 14 and 15 respectively. Any number in hexadecimal number system can be converted into numbers of other number system very easily, the procedures are given in the next article.

Here in the decimal system, we use symbol 1 and 0 side by side that is 10 to represent • • • • • • • • • • + •
That is nine plus one. After that we will have 11 then 12 and so on. That means after nine or 9 we bring back first non - zero digit of symbol that is 1 at left side and repeat all the symbols from 0 to 9 at its right side to represent next ten higher numbers from ten to nineteen (10 - 19). After 19 we put 2 at left and repeat again 0 to 9 to represent next ten higher numbers from twenty to twenty nine (20 - 29). Decimal number system is very basic number system as ten symbols or digits are used in different combinations to represent all the numbers, this system is said to be of base ten (10). Now think about a number system where you are told to use sixteen symbols instead of 10 symbols. Then what will be your basic construction of the new number system ? For that first we have to find out 16 symbols to represent the basic digits of that new number system. We can create new series of symbols for that, but if we do so it will be very much difficult to remember. That difficulty can be solved if we use commonly used symbols for that purpose. So we can simply use 0 to 9 of decimal system to represents first ten digits 0 to 9 of this new number system. But for other 6 higher digits there are no symbols available in decimal system so we have to search for them from some commonly used system. We can easily get them from our alphabetical system that means we can use A, B, C, D, E and F as next 6 higher digits (from 10 to 15) in this new number system. The system where total 16 basic digits are used is known as hexadecimal number system.


















A ⇒




B ⇒



C ⇒


D ⇒

E ⇒
F ⇒

In hexadecimal system we use 16 symbols to represent all numbers. These symbols are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F. After F we use 10 for next higher number 16. Then next increment is 11 which used to represent next natural number 17 and so on.
Hence in hexadecimal system just after F, the first digit becomes 1 and second digit will repeat from 0 to F one by one to represent natural numbers 16 to 31. That means, 10 ⇒ 16, 11 ⇒ 17, 12 ⇒ 18, 13 ⇒ 19, 14 ⇒ 20, 15 ⇒ 21, 16 ⇒ 22, 17 ⇒ 23, 18 ⇒ 24, 19 ⇒ 25, 1A ⇒ 26, 1B ⇒ 27, 1C ⇒ 28, 1D ⇒ 29, 1E ⇒ 30, 1F ⇒ 31. After this the first digit will increase to 2 and again second digit will repeat from 0 to F one by one to represent natural numbers 32 to 47 and so on.

Decimal to Hexadecimal Conversion

As we have already stated in the previous articles on number systems that all the number systems are inter related, so as the decimal and hexadecimal numbers. Any number in decimal number system can be converted into hexadecimal number system. The procedure is given below.
If we try to understand the procedure with an example and step by step then it will be easier and better for us.
Let us first take any decimal number suppose we have taken 7510 and now we want to convert it into hexadecimal number, first we have to divide it by 16
75/16 = quotient 4, remainder 11
As the quotient is less than 16, we have to stop here and the equivalent hexadecimal number will be
4B8 = 7510
Now we will discuss the method for a slightly bigger number,
Suppose the number is 169310
Now we divide it by 16
1693/16 = quotient = 105, remainder = 13(D)
Now we have to divide the quotient again by 16 and see the result
105/16 = quotient = 6 remainder = 9
As the quotient is less than 16 the calculation part is completed and we can now directly write the result
169310 = 69D16
So the decimal number has been converted into a hexadecimal number.From above explanation it can be understood that, hexadecimal number is the summation of products of different digit with their respective multipliers. The multipliers are 160, 161, 162, ........from right hand side or list significant bit (LSB). Let's have an example 4D2 and this would be expressed as







If we divide decimal 1234 by 16, we will get 77 as quotient and 2 as remainder. Then if we divide decimal 77 by 16, we will get 4 as quotient and 13 or D as remainder. Now if we write side by side from last quotient to first reminder we will get 4D2 which is hexadecimal or hex equivalent of the number 1234.

Hexadecimal to Decimal Conversion

In a similar way any hexadecimal number can be converted into a decimal number. We will look into the process with an example.
But before beginning it should be made clear that before conversion of hexadecimal number all the letters of the number should be taken as their numerical values in decimal number system, i.e. if a digit in hexadecimal number is A then we have to take it as 10, now an example will make the whole procedure clear.
Let us take any hexadecimal number 45B116, we have to convert it into decimal number, so starting from the right most digit we have to start multiplying the digits with ascending power of 16 starting from 0.
So the taken number will be operated as




 In this procedure any hexadecimal number can be converted into decimal number.
The value hexadecimal number is determined by multiplying every digit of the hex number by its respective multiplier. We start from LSB or right most digit and multiply it with 160, then come to the next digit at left of LSB and multiply it with 161 and after that we come to the further left digit and multiply 162 with it. We continue this up to MSB or left most bit. The add all this product and finally we get decimal equivalent of hexadecimal number. This one of the easiest process of hexadecimal to decimal conversion.
Think about the hex number 4D2. Here the least significant bit of the number is 2 so we will multiply that with 160 or 1. Then come to the next left digit that is D OR 13 and we will multiply it with 161 or 16. Lastly we will multiply the left most digit or MSB i.e. 4 with 162. Now if we add these three terms, finally we will get the dedcimal equivalent of the said hexadecimal number. This is what Hexadecimal to Decimal Conversion Hence,









Tuesday, March 5, 2013

Matrices


Definition of Matrix

A matrix is a collection of numbers arranged into a fixed number of rows and columns. Usually the numbers are real numbers. In general, matrices can contain complex numbers but we won't see those
here. Here is an example of a matrix:
The upper left corner of the matrix is row 1 column 1. In the above matrix the element at row 1 col 1 is the value a1,1. The element at row 2 column 3 is the value a2,3.

Names for Matrices

If you sometimes forget whether rows or columns come first, just remember that matrices are build out of rowman columns. A matrix can be given a name. In printed text, the name for a matrix is usually a capital letter in bold face, like A or M. Sometimes as a reminder the dimensions are written to the right of the letter, as in B3x3.
The elements of a matrix also have names, usually a lowercase letter the same as the matrix name, with the position of the element written as a subscript. So, for example, the 3x3 matrix A might be written as:

Sometimes you write A = [aij] to say that the elements of matrix A are named aij.

 



Square Matrix :
     Any matrix that has equal number of rows and columns is called square matrix. E.g: 2x2, 3x3 matrix.


2x2 Square Matrix3x3 Square Matrix
a11a12
a21a22
2 rows & 2 columns
b11b12b13
b21b22b23
b31b32b33
3 rows & 3 columns



Diagonal Matrix :
     A Diagonal matrix is a square matrix with numbers on the leading diagonal and zeros in all other places.

Diagonal Matrix
200
030
008


Identity Matrix :
     An identity matrix is a square matrix denoted as I. It has ones (1) down the leading diagonal and zeros in all other places.

2x2 identity3x3 identity
10
01
100
010
001

Note: Any matrix multiplied by its identity matrix leaves the matrix unchanged.
It is similar to multiplying a number by 1.
i.e AI = A (where A is a matrix)

22
53
x
10
01
=
22
53
Zero (Null) Matrix :
      A zero or null matrix is a matrix with 0 as the element for all its cells (rows and columns).

Zero (null) Matrix
000
000
000


Symmetric Matrix :
      A symmetric matrix is a matrix where aij = aji. i.e an element at the ith row, jth columns should be equal to the element at the jth row, ith columns.

Symmetric Matrix
123
245
356


Equality Matrix :
     For any two matrices to be said as equal matrices they should be of same size and have same values.

Matrix Equality

For two matrices to be equal, they must have
  1. The same dimensions.
  2. Corresponding elements must be equal.
In other words, say that An x m = [aij] and that Bp x q = [bij].
Then A = B if and only if n=p, m=q, and aij=bij for all i and j in range.
Here are two matrices which are not equal even though they have the same elements.
 
 
   
Matrix Addition
If two matrices have the same number of rows and same number of columns, then the matrix sum can be computed:
If A is an MxN matrix, and B is also an MxN matrix, then their sum is an MxN matrix formed by adding corresponding elements of A and B
Here is an example of this:
 
 

Addition and Subtraction example

  Multiplication of a Matrix by a Scalar

A matrix can be multiplied by a scalar (by a real number) as follows:
To multiply a matrix by a scalar, multiply each element of the matrix by the scalar.
Here is an example of this. (In this example, the variable a is a scalar.)



Multiplying a Matrix by Another Matrix

But to multiply a matrix by another matrix you need to do the "dot product" of rows and columns ... what does that mean? Let me show you with an example:
To work out the answer for the 1st row and 1st column:
Matrix Multiply
The "Dot Product" is where you multiply matching members, then sum up:
(1, 2, 3) • (7, 9, 11) = 1×7 + 2×9 + 3×11 = 58
We match the 1st members (1 and 7), multiply them, likewise for the 2nd members (2 and 9) and the 3rd members (3 and 11), and finally sum them up.
Want to see another example? Here it is for the 1st row and 2nd column:
Matrix Multiply
(1, 2, 3) • (8, 10, 12) = 1×8 + 2×10 + 3×12 = 64
We can do the same thing for the 2nd row and 1st column:
(4, 5, 6) • (7, 9, 11) = 4×7 + 5×9 + 6×11 = 139
And for the 2nd row and 2nd column:
(4, 5, 6) • (8, 10, 12) = 4×8 + 5×10 + 6×12 = 154
And we get:
Matrix Multiply

Matrix Subtraction

If A and B have the same number of rows and columns, then A - B is defined as A + (-B). Usually you think of this as:
To form A - B, from each element of A subtract the corresponding element of B.
Here is a partly finished example:
 
 

Transpose

The transpose of a matrix is a new matrix whose rows are the columns of the original (which makes its columns the rows of the original). Here is a matrix and its transpose:




The superscript "T" means "transpose". Another way to look at the transpose is that the element at row r column c in the original is placed at row c column r of the transpose. The element arc of the original matrix becomes element acr in the transposed matrix.
Usually we will work with square matrices, and it is usually square matrices that will be transposed. However, non-square matrices can be transposed, as well:

Rule for Transpose

If a transposed matrix is itself transposed, you get the original back:

This illustrates the rule (AT)T = A.

Determinant

The determinant of a matrix is a special number that can be calculated from the matrix. It tells us things about the matrix that are useful in system linear equations, in calculus and more.
The symbol for determinant is two vertical lines either side.
Example:
|A| means the determinant of the matrix A

Calculating the Determinant

First of all the matrix must be square (i.e. have the same number of rows as columns). Then it is just a matter of basic arithmetic. Here is how:

For  2×2 Matrix

For a 2×2 matrix (2 rows and 2 columns):
A Matrix
The determinant is:
|A| = ad - bc
"The determinant of A equals a times d minus b times c"
It is easy to remember when you think of a cross:
  • Blue means positive (+ad),
  • Red means negative (-bc)
A Matrix

Example:

A Matrix
|B| = 4×8 - 6×3
= 32-18
= 14

For  3×3 Matrix

For a 3×3 matrix (3 rows and 3 columns):
A Matrix
The determinant is:
|A| = a(ei - fh) - b(di - fg) + c(dh - eg)
"The determinant of A equals ... etc"
It may look complicated, but there is a pattern:
A Matrix
To work out the determinant of a 3×3 matrix:
  • Multiply a by the determinant of the 2×2 matrix that is not in a's row or column.
  • Likewise for b, and for c
  • Add them up, but remember that b has a negative sign!
As a formula (remember the vertical bars || mean "determinant of"):

"The determinant of A equals a times the determinant of ... etc"

Example:

A Matrix
|C| = 6×(-2×7 - 5×8) - 1×(4×7 - 5×2) + 1×(4×8 - -2×2)
= 6×(-54) - 1×(18) + 1×(36)
= -306

Inverse of a Matrix
using Minors, Cofactors and Adjoint

You can calculate the Inverse of a Matrix by 1) calculating the Matrix of Minors, 2) then turn that into the Matrix of Cofactors, 3) then the Adjoint, and 4) multiply that by 1/Determinant.
But it is best explained by working through an example!

Example: find the Inverse of A:

It needs 4 steps. It is all simple arithmetic but there is a lot of it, so try not to make a mistake!

Step 1: Matrix of Minors

The first step is to create a "Matrix of Minors":
For each element of the matrix:
Put those determinants into a matrix (the "Matrix of Minors")

Determinants

For a 2×2 matrix (2 rows and 2 columns) the determinant is easy: ad-bc
Think of a cross:
  • Blue means positive (+ad),
  • Red means negative (-bc)
A Matrix

The Calculations

Here are the first two, and last two, calculations of the "Matrix of Minors" (notice how I ignore the values in the current row and columns, and calculate the determinant using the remaining values):
And here is the calculation for the whole matrix:

Step 2: Matrix of Cofactors

This is easy! Just apply a "checkerboard" of minuses to the "Matrix of Minors". In other words, you need to change the sign of alternate cells, like this:

Step 3: Adjoint (also called Adjugate)

Now "Transpose" all elements of the previous matrix... in other words swap their positions over the diagonal (the diagonal stays the same):

Step 4: Multiply by 1/Determinant

Now find the determinant of the original matrix. This isn't too hard, because we already calculated the determinants of the smaller parts when we did "Matrix of Minors".
A Matrix
So: multiply the top row elements by their matching "minor" determinants:
Determinant = 3×2 - 0×2 + 2×2 = 10


And now multiply the Adjugate by 1/Determinant:










 


Inverse of a Matrix
using Elementary Row Operations

Also called the Gauss-Jordan method.
This is a fun way to find the Inverse of a Matrix ...
... play around with the rows
(adding, multiplying and swapping them)
until you make your Matrix A
into the Identity Matrix I.
And by ALSO doing the changes to an
Identity Matrix it magically turns
into the Inverse!

The "Elementary Row Operations" are simple things like adding rows, multiplying and swapping ... but let me show you with an example!

Example: find the Inverse of "A":

We start with the matrix A, and write it down with an Identity Matrix I next to it:

(This is called the "Augmented Matrix")

Identity Matrix

The "Identity Matrix" is the matrix equivalent of the number "1":
Identity Matrix
A 3x3 Identity Matrix
  • It is "square" (has same number of rows as columns),
  • It has 1s on the diagonal and 0s everywhere else.
  • It's symbol is the capital letter I.

Now we do our best to turn "A" (the Matrix on the left) into an Identity Matrix. The goal is to make Matrix A have 1s on the diagonal and 0s elsewhere (an Identity Matrix) ... and the right hand side comes along for the ride, with every operation being done on it as well.
But we can only do these "Elementary Row Operations":
  • swap rows
  • multiply or divide each element in a a row by a constant
  • replace a row by adding or subtracting a multiple of another row to it
And we must do it to the whole row, like this:

Start with A next to I

In this example my first step was to add row 2 to row 1,

then divide row 1 by 5,

Then take 2 times the first row,
and subtract it from the second row,

Multiply second row by -1/2,

Now swap the second and third row,


Last, subtract the third row from the second row,

And we are done!
And matrix A has been made into an Identity Matrix ...
... and at the same time an Identity Matrix got made into A-1