1.5k likes | 1.58k Views
ENM 503 Modeling Linear Systems. With Graphs. Let’s solve a problem.
E N D
ENM 503 Modeling Linear Systems With Graphs rd
Let’s solve a problem 24 dogs are in a kennel. 12 dogs are black, 6 dogs have short tails, and 15 dogs have long hair. There is only 1 dog that is black with a short tail and long hair. 2 dogs are black with short tails and do not have long hair. 2 dogs have short tails and long hair but are not black. If all the dogs in the kennel have at least one of the mentioned characteristics, how many dogs are black with long hair but do not have short tails? B = 12; ST = 6; LH = 15; BSTLH = 1; BST~LH = 2; ~BSTLH = 2 BLH~ST = ? rd
This solution is for the dogs 9 - x + 2 + 1 + 1 + 2 + x + 12 - x = 24 27 - x = 24 x = 3 , Well I'll be dog-gone! rd
Cartesian Product The Cartesian product of two sets, A and B, is the set of all ordered pairs (a, b) with a A and b B. A x B = { (a, b) | a A, and b B }. A x B is the set of all ordered pairs whose first component is in A and whose second component is in B. rd
Cartesian Product - examples 1. If A = {a, b} and B = {1, 2, 3}, then A x B = { (a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3) }. 2. Let S = {H, T}. (H stands for Heads, T stands for Tails) S x S = { (H,H), (H,T), (T,H), T,T) }. If S is the set of outcomes of tossing a coin once, then S x S is the set of outcomes of tossing a coin twice. rd
another example The set of outcomes of rolling a die S = {1, 2, 3, 4, 5, 6} The set of outcomes of rolling a pair of dice S x S = {(1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(1, 6), (2, 1),(2, 2),(2, 3),(2,4), (2, 5),(2, 6),(3, 1),(3, 2),(3, 3),(3, 4),(3, 5),(3, 6),(4, 1),(4, 2), (4, 3),(4, 4),(4, 5),(4, 6),(5, 1),(5, 2),(5, 3),(5, 4),(5, 5),(5, 6), (6, 1),(6, 2),(6, 3),(6, 4),(6, 5),(6, 6)} rd
A Cartesian Product Theorem If A, B, and C are any sets, then (A + B)C = AC + BC Quick student exercise: Demonstrate the truth of this theorem by creating an example. That is, show both sets have the same ordered pairs. Another quick student exercise: Demonstrate that A(BC) = (AB)(AC) is true or not true. rd
Power Sets Let U be the universal set. Then the set whose elements are all the subsets in U is called the power set of U and is denoted by PU. There are 2n elements in the set PU where n is the number of elements in U (power-set (upto 5)) ((1 2 3 4 5) (1 3 4 5) (1 2 4 5) (2 3 4 5) (1 2 3 4) (1 2 3 5) (2 3 4) (1 4 5) (2 4 5) (3 4 5) (2 3 5) (1 2 3) (1 2 5) (1 3 4) (1 3 5) (1 2 4) (2 5) (2 4) (3 5) (4 5) (3 4) (1 4) (1 5) (1 3) (1 2) (2 3) (5) (4) (2) (1) (3) NIL) (length *) 32 rd
Power Set (Reals) > |Power Set| Power Set of a set > cardinality of set Let S = {1 2 3 4 5} of 5 elements Then the Power set of S is (power-set (upto 5)) ((1 2 3 4 5) (1 3 4 5) (1 2 4 5) (2 3 4 5) (1 2 3 4) (1 2 3 5) (2 3 4) (1 4 5) (2 4 5) (3 4 5) (2 3 5) (1 2 3) (1 2 5) (1 3 4) (1 3 5) (1 2 4) (2 5) (2 4) (3 5) (4 5) (3 4) (1 4) (1 5) (1 3) (1 2) (2 3) (5) (4) (2) (1) (3) NIL) (length *) 32 Thus the power set of the Reals cannot be put into a 1-1 correspondence with the Reals. rd
The Mandatory Example Let U = {a,b,c,d} (powerset '(a b c d)) Then PU = { , {a}, {b}, {c}, {d}, {a,b}, {a,c}, {a,d}, {b,c}, {b,d}, {c,d}, (a,b,c} {a,b,d}, {a,c,d}, {b,c,d}, {a,b,c,d} } rd
More of the mandatory example Assume that {a,b,c,d} represent a committee of 4 members, each having a single vote where a simple majority vote is required. The each element of PU can be viewed as a voting coalition. Then W = { (a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}, {a,b,c,d} } is the set of winning coalitions and W’ = { , {a}, {b}, {c}, {d}, {a,b}, {a,c}, {a,d}, {b,c}, {b,d}, {c,d}} is the set of non-winning coalitions. L = {, {a}, {b}, {c}, {d} } W’ is a losing coalition (its complement is a winning coalition), and B = {{a,b}, {a,c}, {a,d}, {b,c}, {b,d}, {c,d} } W’ is a blocking coalition. rd
A Quick Review A set is a collection of items, referred to as the elements of the set. x A means that x is an element of the set A. x A means that x is not an element of the set A. B = A means that A and B have the same elements. B A means that B is a subset of A; every element of B is also an element of A. B A means that B is a propersubset of A; in other words, B A, but B A. Ø is the empty set, the set containing no elements. It is a subset of every set. A finite set is a set that has finitely many elements. An infinite set is a set that does not have finitely many elements. rd
Definition of a function • A function takes an element from a set and maps it to a UNIQUE element in another set f maps R to Z R Z Domain f Range or Co-domain f(4.3) 4 4.3 Pre-image of 4 rd Image of 4.3
Function arithmetic • Let f1(x) = 2x 2x • Let f2(x) = x2 + X2 • f1+f2 = (f1+f2)(x) = f1(x)+f2(x) = 2x+x2 • f1* f2 = (f1* f2)(x) = f1(x) * f2(x) = 2x * x2 = 2x3 rd
a e i o 1 2 3 4 5 a e i o 1 2 3 4 5 A one-to-one function A function that is not one-to-one One-to-one functions • A function is one-to-one if each element in the co-domain or range has a unique pre-image rd
a e i o 1 2 3 4 5 A one-to-one function More on one-to-one • Injective is synonymous with one-to-one • “A function is injective” • A function is an injection if it is one-to-one • Note that there can be un-used elements in the co-domain (range) rd
a e i o u 1 2 3 4 a e i o 1 2 3 4 5 An onto function A function that is not onto Onto functions • A function is onto if each element in the range is an image of some pre-image rd
a e i o u 1 2 3 4 An onto function More on onto • Surjective is synonymous with onto • “A function is surjective” • A function is an surjection if it is onto • Note that there can be multiple used elements in the range rd
a b c 1 2 3 4 a b c d 1 2 3 a b c d a b c d 1 2 3 4 1 2 3 4 a b c 1 2 3 4 Onto vs. one-to-one • Are the following functions onto, one-to-one, both, or neither? 1-to-1, not onto Both 1-to-1 and onto Not a valid function rd Onto, not 1-to-1 Neither 1-to-1 nor onto
a b c d 1 2 3 4 Bijections • Consider a function that isboth one-to-one and onto: • Such a function is a one-to-one correspondence, or a bijection rd
Identity functions • A function such that the image and the pre-image are ALWAYS equal • f(x) = 1*x • f(x) = x + 0 • The domain and the range must be the same set. rd
Inverse functions Let f(x) = 2*x f R R f-1 f(4.3) 8.6 4.3 f-1(8.6) Then f-1(x) = x/2; f f-1=2*(x/2) = x; f-1 f = (2x/2) = x rd
Example Inverses Let y = f(x) = 3x + 5 Then x = (y – 5)/3 Interchange x with y to get the inverse g(x) = (x – 5)/3 is the inverse. Note f g = 3(x – 5)/3 + 5 = x and g f = (3x + 5 - 5)/3 = x eln x = x and lnex = x rd
Function may its own inverse y = f(x) = 1/x x = 1/y Interchange to get g(x) = 1/x g f = 1/(1/x) = x f g = 1/(1/x) = x rd
a b c 1 2 3 4 a b c d 1 2 3 More on inverse functions • Can we define the inverse of the following functions? • An inverse function can ONLY be done defined on a bijection • (1-1 and onto). What is f-1(2)? Not onto! What is f-1(2)? Not 1-to-1! rd
Few Examples • f: ZZ • f(x) = x • f(x) = 2x • f(x) = x+1 • f: RR • f(x) = 2x • f(x) = x2 • f(x) = x3 • f: RR+ {0} • f(x) = x2 rd
Definition of a function • A function takes an unique element from a set and maps it to an element in another set f maps R to Z R Z Domain f Range Co-domain f(4.3) 4 4.3 Pre-image of 4 rd Image of 4.3
Compositions of functions (f ○ g)(x) = f(g(x)) f ○ g A B C g f g(a) f(b) a f(g(a)) b = g(a) (f ○ g)(a) (sqrt (* 6 (F (square (+ 1 2))))) rd
Compositions of functions Let f(x) = 2x+3 Let g(x) = 3x+2 f ○ g R R R g f g(1) f(5) f(g(1))=13 1 g(1)=5 (f ○ g)(1) f(g(x)) = 2(3x+2)+3 = 6x+7; g(f(x) = 3(2x+3)+ 2 = 6x + 11 rd
Compositions of functions • Does f(g(x)) = g(f(x))? • Let f(x) = 2x+3 Let g(x) = 3x+2 • f(g(x)) = 2(3x+2)+3 = 6x+7 • g(f(x)) = 3(2x+3)+2 = 6x+11 • Function composition is not commutative! Not equal! rd
f(x)=3 Graphs of functions x=1 Let f(x)=2x+1 Plot (x, f(x)) This is a plot of f(x) f(x)=5 x=2 rd
Equations of Lines Point & slope ~ y – y1 = m(x – x1) Two-points ~ y – y1 = [(y2 - y1)/(x2 – x1)] (x2 - x1) Slope & y-intercept ~ y = mx + b Standard form ~ ax + by + c = 0 m = -a/b Parallel lines have the same slope. Perpendicular lines have slopes that are negative reciprocals of one another; i.e., m1 * m2 = -1. rd
Matrix Operations • Addition • Subtraction • Multiplication • Inverse rd
Addition rd
Addition rd
Addition Conformability • To add two matrices A and B: • # of rows in A = # of rows in B • # of columns in A = # of columns in B rd
Subtraction rd
Subtraction rd
Subtraction Conformability • To subtract two matrices A and B: • # of rows in A = # of rows in B • # of columns in A = # of columns in B rd
Multiplication Conformability • Regular Multiplication • To multiply two matrices A and B: • # of columns in A = # of rows in B • Multiply: A (m x n) by B (n by p) rd
Inner Product of a Vector • (Column) Vector c (n x 1) rd
Outer Product of a Vector • (Column) vector c (n x 1) rd