2008年12月15日 星期一

Maths(二)---Matrix Arithmetic and Relations(2)

Cartesian Product

例一.
Let A = {1, 2} and B = {a, b, c},
thenA× B = {1, 2} × {a, b, c}
= {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)

例二.
Let domain = range = {1, 2, 3, 4}.
R(a < a =" b)">


例三. Let A = {1, 2, 3, 4}. Which ordered pairs are in the relation R = {(a, b)} adivides b}? Since (a, b) is in R if and only if a and b are positive integers not exceeding 4 such that a divides b,
we see that R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}


Combining Relations
例一.
Let A = {1, 2, 3} and B = {1, 2, 3, 4}. The relations R1 = {(1, 1), (2, 2), (3, 3)}and R2 = {(1, 1), (1, 2), (1, 3), (1, 4)} can be combined to get

R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)}
R1 ∩ R2 = {(1, 1)}
R1 \ R2 = {(2, 2), (3, 3)}
R2 \ R1 = {(1, 2), (1, 3), (1, 4)}
-(R1 ∪ R2) = {(2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (3, 4)}

Representing Relations using Matrices

Suppose that A = {1, 2, 3} and B = {1, 2}. Let R be the relation from A to B containing (a, b) if a ∈ A, b ∈ B, and a > b. What is the matrix representing Rif a1 = 1, a2 = 2, a3 = 3, b1 = 1 and b2 = 2?



Since R = {(2, 1), (3, 1), (3, 2)}, the matrix for R is MR= {0 0}
{1 0}
{1 1}
The 1s in MR show that the pairs (2, 1), (3, 1) and (3, 2) belong to R. The 0sshow that no other pairs belong to R.


Properties of Binary Relations


例一.
Let A = {x: x is all positive integers}. We may define a binary relation R on A suchthat (a, b) is in R if a - b > 10. Thus, (12, 1) is in R, but (12, 3) is not; neither is (1,12).


Composite Relation


Student-Subject = {(John, DMS), (Mary, DMS), (John, programming),(Paul, programming), (Mary, SAD), (John, SAD)}

Subject-Teacher = {(DMS, Jim Chan), (SAD, Peter Cheung),(Programming, Steve Chow)}.

Thus Student-Teacher
= Subject-Teacher o Student-Subject
= {(John, Jim Chan),(John, Steve Chow), (John, Peter Cheung),(Paul, Steve Chow), (Mary, Jim Chan), (Mary, Peter Cheung)}

沒有留言: