You are on page 1of 48

Discrete

Math
Harders
2013-2014
Copyright
i
2013
This book is a combination of information from various websites as well as
the University of Nebraska - Lincolns NMSSI summer Discrete Mathematics
for Middle School Teachers course.
Chapter 1
Set Theory
Introduction to Sets
Forget everything you know about numbers.
In fact, forget you even know what a number is.
This is where mathematics starts.
Instead of math with numbers, we will now think about math with
things.
What is a set? Well, simply put, it's a collection.
First you specify a common property among "things" (this word will be dened
later) and then you gather up all the "things" that have this common property.
For example, the items you wear: these would include shoes, socks, hat, shirt,
pants, and so on.
I'm sure you could come up with at least a
hundred.
This is known as a set.
Or another example would
be types of ngers. This set would include thumb, index,
middle, ring, and pinky.
So it is just things grouped together with a certain property
in common.
Section 1
OBJECTIVES
1. Identify a set.
2. Name sets.
3. Find subsets of sets.
4. Determine proper subsets.
Basics of Sets
3
There is a fairly simple notation for sets. You simply list each
element, separated by a comma, and then put some curly
brackets around the whole thing.
The curly brackets { } are sometimes called "set brackets" or
"braces".
This is the notation for the two previous examples:
{socks, shoes, watches, shirts, ...}
{thumb, index, middle, ring, pinky}
Notice how the rst example has the "..." (three dots together).
The three dots ... are called an ellipsis, and mean "continue on".
So that means the rst example continues on ... for innity.
NOTE: (OK, there isn't really an innite amount of things you could wear, but I'm not entirely sure
about that! After an hour of thinking of di"erent things, I'm still not sure. So let's just say it
is innite for this example.)
So:
" The rst set {socks, shoes, watches, shirts, ...} we
call an innite set,
" the second set {thumb, index, middle, ring, pinky} we
call a nite set.
But sometimes the "..." can be used in the middle to save writing
long lists:
Example: the set of letters:
{a, b, c, ..., x, y, z}
In this case it is a nite set (there are only 26 letters, right?)
4
Special Numerical Sets
So what does this have to do with mathematics? When we
dene a set, all we have to specify is a common characteristic.
Who says we cant do that with numbers?
Set of even numbers: {..., -4, -2, 0, 2, 4, ...}
Set of odd numbers: {..., -3, -1, 1, 3, ...}
Set of prime numbers: {2, 3, 5, 7, 11, 13, 17, ...}
Positive multiples of three that are less than 10: {3, 6, 9}
And the list can go on forever. We can come up with all sorts of
sets with all sorts of numbers.
Why are sets important?
Sets are the fundamental property of mathematics. Now as a
word of warning, sets, by themselves, seem pretty pointless. But
its only when you apply sets in di$erent situations do they
become the powerful building block of mathematics that they are.
5
Review 1.1 Sets
Check Answer
Which set correctly lists the fall sports o"ered
at school?
A. football, volleyball, softball, cross country, girls
golf, tennis
B. {football, volleyball, softball, cross country, girls
golf, tennis, ...}
C. {football, volleyball, softball, cross country, girls
golf, tennis}
Set Notation
When talking about sets, it is fairly standard to
use Capital Letters to represent the set, and
lowercase letters to represent an element in that
set.
So for example, A is a set, and a is an element in
A. Same with B and b, and C and c.
Also, when we say an element a is in a set A, we use the symbol
to show it.
And if something is not in a set use .
Ex: Set A is {1, 2, 3}. You can see that 1 A, but 5 A.
So can sets be considered equal?
YES! Two sets are equal if they have precisely the same
members. Now, at rst glance they may not seem equal but if
you look closely they might be!
6
A =
{a,..
/
/
Review 1.2 Equal sets
Check Answer
Are sets A and B equal?

A is the set whose members are the rst


four positive whole numbers.
B = {4, 2, 1, 3}
A. Yes
B. No
Lets check. Both sets contained 1, both contained 2, both
contained 3, and both contained 4. And we have checked every
element of both sets, so YES they are equal!
A = B
The equal signs represents that set A is equal to set B.
Now its your turn:
Subsets
When we dene a set, if we take pieces of that set, we can form
what is called a subset.
So for example, we have the set {1, 2, 3, 4, 5}. A subset of this is
{1, 2, 3}. Another subset is {3, 4} or even another, {1}. However,
{1, 6} is not a subset, since it contains an element (6) which is not
in the parent set. In general:
A is a subset of B if and only if every element of A is in B.
So let's use this denition in some examples.
__________________________________________________________
Is A a subset of B, where A = {1, 3, 4} and B = {1, 4, 3, 2}?
1 is in A, and 1 is in B as well. So far so good.
3 is in A and 3 is also in B.
4 is in A, and 4 is in B.
That's all the elements of A, and every single one is in B, so we're
done.
Yes, A is a subset of B
Note: 2 is in B, but 2 is not in A. But remember, that doesn't matter, we only look
at the elements in A.
7
Review 1.3 Equal Sets
Check Answer
List 4 sets that would be equal to set A.
A = {1, 3, 5, 7, 9}
A.
B.
C.
D.
Let's try a harder example.
Let A be all multiples of 4 and B be all multiples of 2. Is A a
subset of B? And is B a subset of A?
Well, we can't check every element in these sets, because
they have an innite number of elements. So we need to get
an idea of what the elements look like in each, and then
compare them.
The sets are:
" A = {..., -8, -4, 0, 4, 8, ...}
" B = {..., -8, -6, -4, -2, 0, 2, 4, 6, 8, ...}
By pairing o$ members of the two sets, we can see that every
member of A is also a member of B, but every member of B is not
a member of A:
%
So:
A is a subset of B, but B is not a subset of A
Try these ones:
True or False? Let A be the set of vowels and let B = {a
positive, prime, number that is less than 100}
a A a B
4 A 4 B
11 A 11 B
b A b A
Is A = B?
Proper Subsets
If we look at the denition of subsets and let our mind wander a
bit, we come to a weird conclusion.
Let A be a set. Is every element in A an element in A?
(Yes, I wrote that correctly.)
Well, umm, yes of course, right?
So wouldn't that mean that A is a subset of A?
8
This doesn't seem very proper, does it? We want our subsets to
be proper. So we introduce (what else but) proper subsets.
A is a proper subset of B if and only if every element in A is also
in B, and there exists at least one element in B that is not in A.
This little piece at the end is only there to make sure that A is not
a proper subset of itself. Otherwise, a proper subset is exactly the
same as a normal subset.
Example:
{1, 2, 3} is a subset of {1, 2, 3},
but is not a proper subset of {1, 2, 3}.
Example:
{1, 2, 3} is a proper subset of {1, 2, 3, 4}
because the element 4 is not in the rst set.
Note: You should notice that if A is a proper subset of B, then
it is also a subset of B.
When we say A is a subset of B we write A B
Or we can say that A is not a subset of B by A B
When we talk about proper subsets, we take out the line
underneath and so it becomes A B or if we want to say the
opposite, A B
Empty Set or Null Set
This is probably the weirdest thing about sets.
As an example, think of the set of
piano keys on a guitar.
"But wait!" you say, "There are no
piano keys on a guitar!"
And right you are. It is a set with no
elements.
This is known as the Empty Set (or Null Set). There aren't any
elements in it. Not one. Zero.
It is represented by . Or by { } (a set with no elements)
Some other examples of the empty set are the set of countries
south of the south pole.
9
/
/
So what's so weird about the empty set? Well, that part comes
next.
So let's go back to our denition of subsets. We have a set A. We
won't dene it any more than that, it could be any set. Is the
empty set a subset of A?
Going back to our denition of subsets, if every element in the
empty set is also in A, then the empty set is a subset of A. But
what if we have no elements?
It takes an introduction to logic to understand this, but this
statement is one that is "vacuously" or "trivially" true.
A good way to think about it is: we can't nd any elements in
the empty set that aren't in A, so it must be that all elements
in the empty set are in A.
So the answer to the posed question is a resounding yes.
The empty set is a subset of every set, including the empty
set itself.
Order
No, not the order of the elements. In sets it does not matter what
order the elements are in.
Example: {1,2,3,4) is the same set as {3,1,4,2}
When we say "order" in sets we mean the size of the set.
Just as there are nite and innite sets, each has nite and innite
order.
For nite sets, we represent the order by a number, the number
of elements.
Example: {10, 20, 30, 40} has an order of 4.
For innite sets, all we can say is that the order is innite.
__________________________________________________________
Practice Set of Problems -- click here
Activity: Finding subsets -- click here
10
When we do arithmetic with numbers, we begin with the operations of addition,
subtraction, multiplication, and division. With sets, our basic operations are union,
intersection, and complement.
" If A and B are two sets, the union of A and B, written A ! B, is the set of all
elements that are in A or in B or in both.
" The intersection of A and B, written A " B, is the set of all elements that
are in both A and B.
" If A and B have no elements in common, we say that A and B are disjoint
and we write A " B= .
The third basic set operation is the complement. (Notice the spelling is di$erent
than the kind of compliment you give someone when you say "nice hair-do.")
" The complement of a set A contains all the elements that are not in A. So,
the complement of a set A, written A
C
or A or ~A, is dened to be the set of
all elements in the universal set that are not in A.
Section 2
OBJECTIVES
1. Find the union of sets.
2. Find the intersection of sets.
3. Find the complement of sets.
4. Utilize Venn Diagrams.
5. Explore the principle of inclusion-exclusion.
Set Operations
11
12
Sometimes Venn Diagrams help you to
visualize set operations. Venn
Diagrams were created by an English
logician named John Venn. He felt
that seeing a picture made things
more logical.
Note: For notation purposes
in mathematics when you want to say
not, we use ~.
Lets practice a few.
Examples: Perform the following set computations, giving
all your answers using the listing method.
a) {n: n is an integer, positive or negative with n
2
< 10}
b) {1,3,6,2,5} " {6,1,7}
c) {n: n is a square number and n < 50} " {m: m is an even
integer}
d) {1,4,6} ! {1,2, 5,7}
e) Letting U = {1,2,3,4,5,6,7,8,9,10} and A = {3,6,5,7,2}, then A
C
=
13
Laws of Sets
Just like in algebra there are laws in set theory. Most of them are
very similar to the laws you already know, but some will be brand
new.
Commutative
A B = B A
A B = B A
Associative
(A B) C = A (B C)
(A B) C = A (B C)
Distributive
A (B C) = (A B) (A C)
A (B C) = (A B) (A C)
Idempotent
A A = A
A A = A
Identity
A = A
A =
A U = A
A U = U
Involution
(A
C
)
C
= A
Complement
A A
C
= U
A A
C
=
U
C
=

C
= U
De Morgans Laws
(A B)
C
= A
C
B
C
(A B)
C
= A
C
B
C
14
Examples: Find the set described using the laws of sets.
a) B ( A) =
b) (A
C
U)
C
=
c) (C A) (B A) =
d) (A B) (A B
C
) =
e) (A B) (A B
C
)
C
=
f) A (A B) =
Like previously stated sometimes it is easier to visualize the sets
using a Venn Diagram. Lets say we have the following sets:
U={a,b,c,d,e,f,g,h}
P={c,f}
Q={a,c,d,e,f,h}
R={c,d,h}
What would this look like in a Venn Diagram?
P b g
R c f Q
a e
d h
Now when making a Venn Diagram there is one rule you have to
follow, leave no sets (circles) empty. Lets try to draw that picture.
15
b
g
a f
e c d
h
Lets make a few more Venn Diagrams so we have enough
practice with it.
Practice -- Venn Diagrams -- Counting the Kids
Explore -- Principle of Inclusion-Exclusion
16
Chapter 2
Combinatorics
Combinatorics is the branch of mathematics
studying the enumeration, combination, and
permutation of sets of elements and the
mathematical relations that characterize their
properties.
This rst section of the chapter will focus on the basics of probability. Before you
can learn combinatorics the basics must be understood.
Probability is the likelihood that something will happen. Many events can't be
predicted with total certainty. The best we can do is say how likely they are to
happen, using the idea of probability.
Tossing a Coin%
When a coin is tossed, there are two possible outcomes:
heads (H) or tails (T).
We say that the probability of the coin landing H is &. And the
probability of the coin landing T is &. This should hopefully be
easy to understand.
Rolling a Dice%
When a single die is thrown, there are six possible
outcomes: 1, 2, 3, 4, 5, 6.
The probability of any one of them is 1/6.
%
Section 1
OBJECTIVES
1. Find basic probabilities.
2. Find outcomes of multiple events.
3. Compare permutations and combinations.
Probability Revisited
18
One note probability is always between 0 and 1. 0 being not
likely at all and 1 being it will always happen.
Lets try a few:
Find each probability.
P(rolling a 4) P(rolling a even)
P(rolling a 5 or more) P(rolling a 7)
What if I wanted to nd the probability of rolling a 3 and getting a
heads on the coin?
In this case you would have a 1/6 of rolling a 3 and a 1/2
chance of getting a heads. If you multiply these
probabilities you would have a 1/12 chance of rolling a three
and getting heads.
The Counting Principle
When there are m ways to do one thing, and n ways to do
another, then there are m$n ways of doing both.
This again should be something you are familiar with. But lets
take a look at some example. Remember you can always draw a
tree diagram to help count the total outcomes but utilizing the
counting principle makes things much easier!
Example: You have 3 shirts and 4 pants.
That means 3'4=12 di$erent outts.
%
Example: There are 6 avors of ice-cream, and 3 di$erent cones.
That means 6'3=18 di$erent single-scoop ice-creams
you could order.
Example:

19
Maybe this one would be easier to see if we drew a tree diagram.
There are 30 outcomes. If we would have used in the counting
principle we would have taken 2x5x3 = 30. Either way you get
the same result.
How would your results change if you didnt have black o$ered as
a color choice in the hatchback but it was still o$ered in the
sedan?
How would the counting principle be used to obtain this result.
Well if we take the 5 colors times the three models we would have
15 options for the sedan. Likewise if we take the 4 colors times
the three options we have 12 hatchbacks. SO together we would
have
5x3 + 4x3 = 15 + 12 = 27 total cars.
Practice Set of problems on Probability -- click here
Combinatorics Intro Activity
Flag Trademarks
20
Five Number Summary
The ve number summary is taken from a set of data and tells us how spread out
the data is. The ve number summary consists of:
Mean -- average of the data
Median -- middle of the data
Mode -- most common of the data
Minimum & Maximum -- lowest and highest of the data
Interquartiles -- median between the low/high and median
How does this work? Lets look at a set of data.
3, 4, 4, 5, 6, 8, 8
Mean = 3+4+4+5+6+8+10 =40 / 7 = 5.714
Median = 5
Mode = 4 and 8
Section 2
OBJECTIVES
1. Find a ve number summary.
2. Make a box and whisker plot.
3. Analyze histograms and stem plots.
4. Find standard deviation.
Data Revisited
21
Minimum = 3 Maximum = 8
Interquartiles = 4 and 8 (see below)
Note: Q2 is the same as the median. Q1 and Q3 are the
interquartiles.
Lets see another example.
1, 3, 3, 4, 5, 6, 6, 7, 8, 8
Mean = 1+3+3+4+5+6+6+7+8+8 = 51 / 10 = 5.1
Median = is between 5 and 6 so 5+6 = 11 / 2 = 5.5
Mode = 3 and 6 and 8
Minimum = 1 Maximum = 8
Interquartiles = 3 and 7 (see below)
This may seem very messy at rst but the more box and whisker
plots you draw the better you will get at them. They really do help
you see the data set and analyze it better.
22
Mode Mean
Maximum
Interquartiles
Interquartiles
Minimum
Median
Now we can put this together using a box and whisker
plot.
Standard Deviation
Standard deviation is a measure of how spread out data is. To
nd the mean you follow a process (its easiest if you use a table).
1. Put the numbers in order from smallest to biggest
2. Find the mean.
3. Take each number minus the mean
4. Square those di$erences
5. Find the new mean (variance)
6. Square root the variance.
**So why do we follow these steps. This website has a
great explanation if you are interested.
Lets try a few here.
23
Binomial Theorem
What happens when you multiply a binomial times itself multiple many times?
Answer.... dont worry I will explain this all
First remember a binomial is a polynomial with two terms.
When you multiply a binomial by itself multiple times you can
use the binomial theorem as a short cut to nding the answer.
It works nicely because there is a pattern. Lets try to discover
this pattern.
We will start with a simple binomial A+B but remember this could be any binomial.
Section 3
OBJECTIVES
1. Expand binomials using the binomial
theorem.
2. Explore Pascals Triangle and its uses.
3. Find connections between the binomial
expansions and pascals triangle.
Binomial Theorem
24
Let us start with an exponent of 0 and build upwards.
Exponent of 0
When an exponent is 0, you get 1:
(a + b)
0
= 1
Exponent of 1
When the exponent is 1, you get the original value, unchanged:
(a + b)
1
= a + b
Exponent of 2
An exponent of 2 means to multiply by itself (see how to multiply
polynomials):
(a + b)
2
= (a + b)(a + b) = a
2
+ 2ab + b
2
Exponent of 3
For an exponent of 3 just multiply again:
(a + b)
3
= (a + b)(a + b)(a + b)
= (a + b)(a
2
+ 2ab + b
2
) = a
3
+ 3a
2
b + 3ab
2
+ b
3
%
We have enough now to start talking about the pattern.
The Pattern
In the last result we got: a
3
+ 3a
2
b + 3ab
2
+ b
3
Now, notice the exponents of a. They start at 3 and go down: 3,
2, 1, 0:
Likewise the exponents of b go upwards: 0, 1, 2, 3:
If we number the terms 0 to n, we get this:
k=0 k=1 k=2 k=3
a
3
a
2
a 1
1 b b
2
b
3
Which can be brought together into this:
25
So far we have: a
3
+ a
2
b + ab
2
+ b
3
But we really need: a
3
+ 3a
2
b + 3ab
2
+ b
3
We are missing the coe(cients. If you look back at the results
from before we would have:
Now just look at the coe(cients
Armed with this information try an exponent of 4.
which is correct!! We can use this pattern to nd exponents of 5,
6, 7, ....you name it!
Our last step is to write it all as a formula.
But hang on, how do we write a formula for "nd the coe(cient
from Pascal's Triangle" ... ?
Well, there is such a formula:
26
%
It is commonly called "n choose k"
because it is how many ways to choose
k elements from a set of n.
The "!" means "factorial", for example 4! = 1'2'3'4 = 24
And it matches to Pascal's Triangle like this:
(Note how the top row is row zero and also the leftmost column is
zero!)
The last step is to put all the terms together into one formula.
But we are adding lots of terms together ... can that be done
using one formula?
Yes! The handy Sigma Notation allows us to sum up as many
terms as we want:

Now it can all go into one formula:

The Binomial Theorem


Lets try a few examples.
27
Pascals Triangles
One of the most interesting
Number Patterns is Pascal's
Triangle (named after Blaise
Pascal, a famous French
Mathematician and
Philosopher).
To build the triangle, start with
"1" at the top, then continue
placing numbers below it in a
triangular pattern.

Each number is just the two numbers above it added together


(except for the edges, which are all "1").
In your notes I would suggest writing out the rst 8 rows.
Within Pascals Triangle there are many di$erent patterns. Lets
nd the patterns.
This may seem very overwhelming, but we are going to explore
this further with a few activities.
Binary Strings and Zig-Zag Paths
Combinations, Pascals Triangle, and the Binomial Theorem
28
Chapter 3
Graph Theory
Graph theory is the study of graphs which are
mathematical structures to represent
relationships between objects.
Terminology: What is a vertex-edge graph? A vertex-edge graph (or graph) is a set
of points called vertices and line segments or arcs called edges that connect
vertices. A single point is referred to as a vertex. It is possible to have an edge that
begins and ends at the same vertex; we refer to this as a loop. It is also possible to
have more than one edge between a pair of points. Graphs that do not have
multiple edges and no loops are referred to as simple graphs and will be our
primary focus.
We are going to use multiple packets to learn this material as it is hard to transfer
the pictures without distorting them to this book.
Section 1
OBJECTIVES
1. Determine the type of graph and whether it
is complete or connected.
2. Use graphs as models.
3. Determine if a graph is a path or circuit and
the type.
Vertex - Edge Graphs
30
Chapter 4
Recursion
Lets start this chapter with a game.
The rules are simple. You want to
move all the disks over to the last
tower. But you cant place a larger
disk onto a smaller disk. Lets try it!
Think you have the idea mastered.
How about a more di(cult one now.
To solve these Tower of Hanoi
problems you created a rule for
yourself to move the discs and a strategy. This is known as using recursion.
Lets look at a few packets of recursion.
Section 1
OBJECTIVES
1. Find the recursive and explicit rule for a
sequence.
2. Prove the recursive rule and explicit rule.
3. Analyze the Towers of Hanoi
4. Find geometric series given a geometric
sequence.
Recursion and Iteration Sequences
32
Chapter 5
Voting
Methods
Method 1: Choice by majority is the winner who has over 50% of the rst-place
votes.
Method 2: Choice by plurality is the winner who has the most rst-place votes.
Method 3: Choice by single runo$ Select the two options with the largest numbers
of rst place votes and conduct a runo$ between these two options.
Method 4: Choice by sequential runo$. At each step of the runo$ process, we will
eliminate the choice with the smallest number of rst-place votes and redistribute
those votes to the remaining options on the basis of voter preferences.
Method 5: Choice by weighted rankings (Borda count). We will give a di$erent
weight or point value to each of the di$erent rankings and then sum the points for
each option. If there are 4 preferences, then we will give a weight of 4 points to a
rst-place ranking, a weight of 3 points to a second-place ranking, a weight of 2
points to a third-place ranking and a weight of 1 point to a fourth-place ranking.
Method 6: Choice by pairwise comparisons. In attempting to choose the "best"
option among several, we might hope that the option we pick would beat all or
most of the other options in a one-on-one vote.
Section 1
OBJECTIVES
1. Understand and utilize the 6 di"erent voting
methods.
2. Determine the most fair method of voting.
Voting Methods
34
Apportionment is a method used to fairly distribute the number of
representatives each state has in the House of Representatives. It can also be
used to fairly distribute any number of items.
A short history lesson for you:
1790 - The House of Representatives was to have 105 members. The goal was
and still is today to nd each states fair share. The House is re-apportioned every
10 years after the US census data is collected.
1790-1830 the Je$erson method was used
1840 the Webster method was used
1850-1900 the Hamilton method was used
1910 the Webster method was used again
1920 -- the missing years -- the House of Representatives failed to reapportion
1930 the Webster method was used again
1940-2010 the Hill-Huntington method was used
Section 2
OBJECTIVES
1. Compare and understand the di"erent
methods of apportionment.
2. Determine the most fair method.
Apportionment
35
But why are there so many methods used and what happened in
1920?? All apportionment plans enacted by the House of
Representatives have created controversy. Even todays method
of Hill-Huntington was challenged in 1992 by Montana because it
lost a representative to Washington.
Lets go through another packet to explore each of these
methods. Which method seems to be the most fair to you?
36
Chapter 6
Matrices
A matrix is an array of numbers.
This one has 2 Rows and 3 Columns.
We talk about one matrix or several matrices. We can perform many calculations
with a matrix.
Adding
To add two matrices, just add the numbers in the matching positions.
Section 1
OBJECTIVES
1. Organize data into a matrix.
2. Add and subtract matrices.
3. Transpose matrices.
Basic Matrix Operations
38
Note the two matrices must be the same size to add otherwise
you wouldnt have matching positions.
Subtracting
To subtract you do the exact same except you subtract the
matching positions.
Multiplying
To multiply a matrix by a scalar, you just multiply every term by
the scalar.
We will save multiplying a matrix by another matrix for the next
lesson because it has quite a few steps to it.
Dividing
Actually you dont divide matrices, instead division is thought of
as multiplying by an inverse. Again, this is a bit more complicated
so we will wait until we have learned to multiply two matrices.
Transposing a Matrix
To "transpose" a matrix, just swap the rows and columns. We put
a "T" in the top right-hand corner to mean transpose:
Notation
A matrix is usually shown by a capital letter (such as A, or B)
Each entry (or "element") is shown by a lower case letter with a
"subscript" of row,column:
39
Rows and Columns
So which is the row and which is the column?
" Rows go left-right
" Columns go up-down
You can also remember that rows come
before columns by the word"arc": A
r,c

Practice Problems
40
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:
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 nally sum them up.
Section 2
OBJECTIVES
1. Multiply two matrices.
2. Use dot products.
Multiplying Two Matrices
41
Want to see another example? Here it is for the 1st row and 2nd
column:
(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:
DONE!
Why Do It This Way?
This may seem an odd and complicated way of multiplying, but it
is necessary!
I can give you a real-life example to illustrate why we multiply
matrices in this way.
Example: The local shop sells 3 types of pies.
" Beef pies cost $3 each
" Chicken pies cost $4 each
" Vegetable pies cost $2 each
And this is how many they
sold in 4 days:
Now think about this ...
the value of sales for
Monday is calculated this way:
Beef pie value + Chicken pie value + Vegetable pie value
$3'13 + $4'8 + $2'6 = $83
42
So it is, in fact, the "dot product" of prices and how many were
sold:
($3, $4, $2) " (13, 8, 6) = $3'13 + $4'8 + $2'6 = $83
We match the price to how many sold, multiply each, then sum
the result.
%
In other words:
" The sales for Monday were: Beef pies: $3'13=$39,
Chicken pies: $4'8=$32, and Vegetable pies: $2'6=$12. Together
that is $39 + $32 + $12 = $83
" And for Tueday: $3'9 + $4'7 + $2'4 = $63
" And for Wednesday: $3'7 + $4'4 + $2'0 = $37
" And for Thursday: $3'15 + $4'6 + $2'3 = $75
So it is important to match each price to each quantity.
Now you know why we use the "dot product".
%
And here is the full result in Matrix form:
They sold $83 worth of pies on Monday, $63 on Tuesday, etc.
Rows and Columns
To show how many rows and columns a matrix has we often write
rows'columns.
Example: This matrix is 2'3 (2 rows by 3 columns):
When we do multiplication:
" The number of columns of the 1st matrix must equal
the number of rows of the 2nd matrix.
" And the result will have the same number of rows as
the 1st matrix, and the same number of columns as the 2nd
matrix.
43
Example:
In that example we multiplied a 1'3 matrix by a 3'4 matrix (note
the 3s are the same), and the result was a 1'4 matrix.
In General:
To multiply an m$n matrix by an n$p matrix, the ns must be the
same, and the result is an m$p matrix.
Notes: Matrix multiplication is not commutative all the time.
Make sure you check by multiplying the matrices.
Identity Matrix
The Identity Matrix is the matrix equivalent of the number 1
This would be 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.
It is a special matrix, because when you multiply by it, the original
is unchanged:
A $ I = A
I $ A = A
Practice Problems
44
What is an inverse?
The Inverse of a Matrix is the same idea as the reciprocal of a number:
But we dont write 1/A (because remember we dont divide matrices), instead we
write it A
-1
for the inverse:
So the true denition of a matrix inverse is as follows:
The Inverse of A is A
-1
only when:
A ' A
-1
= A
-1
' A = I
Sometimes there is no Inverse at all.
Section 3
OBJECTIVES
1. Find the inverse of a matrix.
2. Find the determinant of a matrix.
3. Use Gauss-Jordan method to nd the
inverse of a 3x3 or 4x4 matrix.
Inverse Matrices
45
2x2 Matrix Inverse
Ok, so how do we calculate the inverse? Well, for a 2x2 matrix
In other words swap the positions of a and d, put negatives in
front of b and c, and divide everything by the determinant (ad-bc)
Example:
A real life example:
A group travelled on a bus, at $3 per child and $3.20 per adult for
a total of $118.40.
They took the train back at $3.50 per child and $3.60 per adult for
a total of $135.20.
How many children, and how many adults?
First, let us set up the matrices (be careful to get the rows and
columns correct!):
This is just like the example above:
XA = B
So to solve it we need the inverse of "A":
46
Now we have the inverse we can solve using:
X = BA
-1
There were 16 children and 22 adults!
The answer almost appears like magic. But it is based on good
mathematics.
FYI: Calculations like that (but using much larger matrices)
help Engineers design buildings, are used in video
games and computer animations to make things look
3-dimensional, and many other places.
The Inverse may not exist
First of all, to have an Inverse the Matrix must be "Square" (same
number of rows and columns).
But also the determinant cannot be zero (or you would end up
dividing by zero). How about this:
24-24? That equals 0, and 1/0 is undened.
We cannot go any further! This Matrix has no Inverse.
Such a Matrix is called "Singular", which only happens when the
determinant is zero.
And it makes sense ... look at the numbers: the second row is just
double the rst row, and does not add any new information.
Finding the inverse of a 3x3 or 4x4 matrix is possible but much
harder. Often another method is used known as Gauss-Jordan.
Practice Problems
Gauss-Jordan Method
47

You might also like