当前位置:网站首页>[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa
[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa
2022-07-03 04:37:00 【Programmer community】
List of articles
- One 、 The relational matrix
- Two 、 Example of relational matrix
- 3、 ... and 、 Properties of relation matrix
- Four 、 Relational matrix operation
- 5、 ... and 、 The diagram
- 6、 ... and 、 Diagram example
- 7、 ... and 、 Relationships represent related properties
One 、 The relational matrix
A
=
{
a
1
,
a
2
,
⋯
,
a
n
}
,
R
⊆
A
×
A
A = \{ a_1, a_2 , \cdots , a_n \} , R \subseteq A \times A
A={ a1,a2,⋯,an},R⊆A×A
R
R
R Use The relational matrix Express :
M
(
R
)
=
(
r
i
j
)
n
×
n
M(R) = (r_{ij})_{n\times n}
M(R)=(rij)n×n
Relation matrix value :
M
(
R
)
(
i
,
j
)
=
r
i
j
=
{
1
,
a
i
R
a
j
0
,
nothing
Turn off
system
M(R)(i, j) = r_{ij} =\begin{cases} 1, & a_i R a_j \\ 0, & It doesn't matter \end{cases}
M(R)(i,j)=rij={ 1,0,aiRaj nothing Turn off system
Description of relation matrix definition :
A
A
A It's a
n
n
n Meta set ( There are
n
n
n Elements ) ,
R
R
R yes
A
A
A The binary relationship on ,
R
R
R The relation matrix of is
n
×
n
n \times n
n×n Matrix of , The first
i
i
i Xing di
j
j
j Element at column position
r
i
j
r_{ij}
rij The value can only be
0
0
0 or
1
1
1 ;
Description of relation matrix value :
If
r
i
j
=
1
r_{ij} = 1
rij=1 , shows
A
A
A Collection The first
i
i
i Elements and
j
j
j Elements have relationships
R
R
R , Write it down as :
a
i
R
a
j
a_i R a_j
aiRaj ;
If
r
i
j
=
0
r_{ij} = 0
rij=0 , shows
A
A
A Collection The first
i
i
i Elements and
j
j
j Elements don't matter
R
R
R ;
The essence of relational matrix : In the relation matrix , Each line corresponds to
A
A
A The elements in the collection , Each column also corresponds to
A
A
A The elements in the collection , The value of the position where the rows intersect (
0
0
0 or
1
1
1 ) Express
A
A
A In the set
i
i
i Elements and
j
j
j Whether there is a relationship between the ordered pairs of elements
R
R
R ;
Two 、 Example of relational matrix
A
=
{
a
,
b
,
c
}
A = \{ a, b, c \}
A={ a,b,c}
R
1
=
{
<
a
,
a
>
,
<
a
,
b
>
,
<
b
,
a
>
,
<
b
,
c
>
}
R_1 = \{ <a, a>, <a,b> , <b,a> , <b,c> \}
R1={ <a,a>,<a,b>,<b,a>,<b,c>}
R
2
=
{
<
a
,
b
>
,
<
a
,
c
>
,
<
b
,
c
>
}
R_2 = \{ <a,b> , <a,c> , <b,c> \}
R2={ <a,b>,<a,c>,<b,c>}
Use the relation matrix to express the above
R
1
,
R
2
R_1 , R_2
R1,R2 Two relationships :
R
1
=
{
<
a
,
a
>
,
<
a
,
b
>
,
<
b
,
a
>
,
<
b
,
c
>
}
R_1 = \{ <a, a>, <a,b> , <b,a> , <b,c> \}
R1={ <a,a>,<a,b>,<b,a>,<b,c>} among :
<
a
,
a
>
<a, a>
<a,a> :
a
a
a It's No
1
1
1 Elements ,
a
a
a It's No
1
1
1 Elements , The first
1
1
1 Xing di
1
1
1 The column elements are
1
1
1
<
a
,
b
>
<a, b>
<a,b> :
a
a
a It's No
1
1
1 Elements ,
b
b
b It's No
2
2
2 Elements , The first
1
1
1 Xing di
2
2
2 The column elements are
1
1
1
<
b
,
a
>
<b, a>
<b,a> :
b
b
b It's No
2
2
2 Elements ,
a
a
a It's No
1
1
1 Elements , The first
2
2
2 Xing di
1
1
1 The column elements are
1
1
1
<
b
,
c
>
<b, c>
<b,c> :
b
b
b It's No
2
2
2 Elements ,
c
c
c It's No
3
3
3 Elements , The first
2
2
2 Xing di
3
3
3 The column elements are
1
1
1
- The rest are all
0
0
0
M
(
R
1
)
=
[
1
1
0
1
0
1
0
0
0
]
M(R_1) = \begin{bmatrix} 1 & 1 & 0 \\\\ 1 & 0 & 1 \\\\ 0 & 0 & 0 \end{bmatrix}
M(R1)=⎣⎢⎢⎢⎢⎡110100010⎦⎥⎥⎥⎥⎤
R
2
=
{
<
a
,
b
>
,
<
a
,
c
>
,
<
b
,
c
>
}
R_2 = \{ <a,b> , <a,c> , <b,c> \}
R2={ <a,b>,<a,c>,<b,c>} among :
<
a
,
b
>
<a, b>
<a,b> :
a
a
a It's No
1
1
1 Elements ,
b
b
b It's No
2
2
2 Elements , The first
1
1
1 Xing di
2
2
2 The column elements are
1
1
1
<
a
,
c
>
<a, c>
<a,c> :
a
a
a It's No
1
1
1 Elements ,
c
c
c It's No
3
3
3 Elements , The first
1
1
1 Xing di
3
3
3 The column elements are
1
1
1
<
b
,
c
>
<b, c>
<b,c> :
b
b
b It's No
2
2
2 Elements ,
c
c
c It's No
3
3
3 Elements , The first
2
2
2 Xing di
3
3
3 The column elements are
1
1
1
- The rest are all
0
0
0
M
(
R
2
)
=
[
0
1
1
0
0
1
0
0
0
]
M(R_2) = \begin{bmatrix} 0 & 1 & 1 \\\\ 0 & 0 & 1 \\\\ 0 & 0 & 0 \end{bmatrix}
M(R2)=⎣⎢⎢⎢⎢⎡000100110⎦⎥⎥⎥⎥⎤
3、 ... and 、 Properties of relation matrix
Ordered pair set expression And The relational matrix Can only be mutually determined
Property one : Inverse operation related properties
M
(
R
−
1
)
=
(
M
(
R
)
)
T
M(R^{-1}) = (M(R))^T
M(R−1)=(M(R))T
M
(
R
−
1
)
M(R^{-1})
M(R−1) The inverse of the relationship Of The relational matrix
And
(
M
(
R
)
)
T
(M(R))^T
(M(R))T The relational matrix Of The inverse
These two matrices are equal ;
Property two : Properties related to composition operation
M
(
R
1
∘
R
2
)
=
M
(
R
2
)
∙
M
(
R
1
)
M(R_1 \circ R_2) = M(R_2) \bullet M(R_1)
M(R1∘R2)=M(R2)∙M(R1)
∙
\bullet
∙ It's matrix Logical multiplication , Calculation matrix
r
i
j
r_{ij}
rij Value The first
i
i
i That's ok multiply The first
j
j
j Column , Bit by bit Logical multiplication , Then multiply the logic and the result is Logical addition ;
Above Logical multiplication uses
∧
\land
∧ operation , Logical addition uses
∨
\lor
∨ operation ;
Four 、 Relational matrix operation
A
=
{
a
,
b
,
c
}
A = \{ a, b, c \}
A={ a,b,c}
R
1
=
{
<
a
,
a
>
,
<
a
,
b
>
,
<
b
,
a
>
,
<
b
,
c
>
}
R_1 = \{ <a, a>, <a,b> , <b,a> , <b,c> \}
R1={ <a,a>,<a,b>,<b,a>,<b,c>}
R
2
=
{
<
a
,
b
>
,
<
a
,
c
>
,
<
b
,
c
>
}
R_2 = \{ <a,b> , <a,c> , <b,c> \}
R2={ <a,b>,<a,c>,<b,c>}
In the example above , Two relational matrices have been found ;
M
(
R
1
)
=
[
1
1
0
1
0
1
0
0
0
]
M(R_1) = \begin{bmatrix} 1 & 1 & 0 \\\\ 1 & 0 & 1 \\\\ 0 & 0 & 0 \end{bmatrix}
M(R1)=⎣⎢⎢⎢⎢⎡110100010⎦⎥⎥⎥⎥⎤ ,
M
(
R
2
)
=
[
0
1
1
0
0
1
0
0
0
]
M(R_2) = \begin{bmatrix} 0 & 1 & 1 \\\\ 0 & 0 & 1 \\\\ 0 & 0 & 0 \end{bmatrix}
M(R2)=⎣⎢⎢⎢⎢⎡000100110⎦⎥⎥⎥⎥⎤
1. seek
M
(
R
−
1
)
,
M
(
R
2
−
1
)
M(R^{-1}) , M(R_2^{-1})
M(R−1),M(R2−1)
Directly transpose the matrix , Can get Inverse relation matrix of relation ;
M
(
R
1
−
1
)
=
(
M
(
R
1
)
)
T
=
[
1
1
0
1
0
0
0
1
0
]
M(R_1^{-1}) = (M(R_1))^T = \begin{bmatrix} 1 & 1 & 0 \\\\ 1 & 0 & 0 \\\\ 0 & 1 & 0 \end{bmatrix}
M(R1−1)=(M(R1))T=⎣⎢⎢⎢⎢⎡110101000⎦⎥⎥⎥⎥⎤
M
(
R
2
−
1
)
=
(
M
(
R
2
)
)
T
=
[
0
0
0
1
0
0
1
1
0
]
M(R_2^{-1}) = (M(R_2))^T = \begin{bmatrix} 0 & 0 & 0 \\\\ 1 & 0 & 0 \\\\ 1 & 1 & 0 \end{bmatrix}
M(R2−1)=(M(R2))T=⎣⎢⎢⎢⎢⎡011001000⎦⎥⎥⎥⎥⎤
R
1
−
1
=
{
<
a
,
a
>
,
<
a
,
b
>
,
<
b
,
a
>
,
<
c
,
b
>
}
R_1^{-1} = \{ <a, a> , <a, b> , <b,a> , <c,b> \}
R1−1={ <a,a>,<a,b>,<b,a>,<c,b>}
R
2
−
1
=
{
<
b
,
a
>
,
<
c
,
a
>
,
<
c
,
b
>
}
R_2^{-1} = \{ <b, a> , <c,a> , <c,b> \}
R2−1={ <b,a>,<c,a>,<c,b>}
2. seek
M
(
R
1
∘
R
1
)
M( R_1 \circ R_1 )
M(R1∘R1)
M
(
R
1
∘
R
1
)
=
M
(
R
1
)
∙
M
(
R
1
)
M( R_1 \circ R_1 ) = M(R_1) \bullet M(R_1)
M(R1∘R1)=M(R1)∙M(R1)
Among them
∙
\bullet
∙ Is the logical multiplication of two matrices , Addition uses
∨
\lor
∨ , Multiplication uses
∧
\land
∧
M
(
R
1
)
∙
M
(
R
1
)
=
[
1
1
0
1
0
1
0
0
0
]
∙
[
1
1
0
1
0
1
0
0
0
]
=
[
1
1
1
1
1
0
0
0
0
]
M(R_1) \bullet M(R_1) = \begin{bmatrix} 1 & 1 & 0 \\\\ 1 & 0 & 1 \\\\ 0 & 0 & 0 \end{bmatrix} \bullet \begin{bmatrix} 1 & 1 & 0 \\\\ 1 & 0 & 1 \\\\ 0 & 0 & 0 \end{bmatrix} = \begin{bmatrix} 1 & 1 & 1 \\\\ 1 & 1 & 0 \\\\ 0 & 0 & 0 \end{bmatrix}
M(R1)∙M(R1)=⎣⎢⎢⎢⎢⎡110100010⎦⎥⎥⎥⎥⎤∙⎣⎢⎢⎢⎢⎡110100010⎦⎥⎥⎥⎥⎤=⎣⎢⎢⎢⎢⎡110110100⎦⎥⎥⎥⎥⎤
Logical multiplication of matrices : The second of the result matrix
i
i
i That's ok , The first
j
j
j The value of the column element is , The first
i
i
i The three elements of a row Respectively with the previous
j
j
j The three elements of the column , Then the three results are or calculated , The end result is The order of the matrix
i
i
i That's ok , The first
j
j
j Value of column element ;
R
1
∘
R
1
=
{
<
a
,
a
>
,
<
a
,
b
>
,
<
a
,
c
>
,
<
b
,
a
>
,
<
b
,
b
>
}
R_1 \circ R_1 = \{ <a,a> , <a,b> , <a,c> , <b,a>, <b,b> \}
R1∘R1={ <a,a>,<a,b>,<a,c>,<b,a>,<b,b>}
3. seek
M
(
R
1
∘
R
2
)
M( R_1 \circ R_2 )
M(R1∘R2)
M
(
R
1
∘
R
2
)
=
M
(
R
2
)
∙
M
(
R
1
)
M( R_1 \circ R_2 ) = M(R_2) \bullet M(R_1)
M(R1∘R2)=M(R2)∙M(R1)
Among them
∙
\bullet
∙ Is the logical multiplication of two matrices , Addition uses
∨
\lor
∨ , Multiplication uses
∧
\land
∧
Particular attention , The order of synthesis is reverse synthesis , The latter relation matrix comes first , The former relation matrix is later
M
(
R
1
)
∙
M
(
R
2
)
=
[
0
1
1
0
0
1
0
0
0
]
∙
[
1
1
0
1
0
1
0
0
0
]
=
[
1
0
1
0
0
0
0
0
0
]
M(R_1) \bullet M(R_2) =\begin{bmatrix} 0 & 1 & 1 \\\\ 0 & 0 & 1 \\\\ 0 & 0 & 0 \end{bmatrix} \bullet \begin{bmatrix} 1 & 1 & 0 \\\\ 1 & 0 & 1 \\\\ 0 & 0 & 0 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 1 \\\\ 0 & 0 & 0 \\\\ 0 & 0 & 0 \end{bmatrix}
M(R1)∙M(R2)=⎣⎢⎢⎢⎢⎡000100110⎦⎥⎥⎥⎥⎤∙⎣⎢⎢⎢⎢⎡110100010⎦⎥⎥⎥⎥⎤=⎣⎢⎢⎢⎢⎡100000100⎦⎥⎥⎥⎥⎤
Logical multiplication of matrices : The second of the result matrix
i
i
i That's ok , The first
j
j
j The value of the column element is , The first
i
i
i The three elements of a row Respectively with the previous
j
j
j The three elements of the column , Then the three results are or calculated , The end result is The order of the matrix
i
i
i That's ok , The first
j
j
j Value of column element ;
R
1
∘
R
2
=
{
<
a
,
a
>
,
<
a
,
c
>
}
R_1 \circ R_2 = \{ <a,a>, <a,c> \}
R1∘R2={ <a,a>,<a,c>}
5、 ... and 、 The diagram
A
=
{
a
1
,
a
2
,
⋯
,
a
n
}
,
R
⊆
A
×
A
A = \{ a_1, a_2 , \cdots , a_n \} , R \subseteq A \times A
A={ a1,a2,⋯,an},R⊆A×A
R
R
R Diagram for :
- The vertices :
∘
\circ
∘ Express
A
A
A The elements in the collection ;
- There is a directional side :
→
\rightarrow
→ Express
R
R
R The elements in ;
a
i
R
a
j
a_i R a_j
aiRaj It's from the apex
a
i
a_i
ai To The vertices
a
j
a_j
aj The directed side of
<
a
i
,
a
j
>
<a_i , a_j>
<ai,aj> ;
6、 ... and 、 Diagram example
A
=
{
a
,
b
,
c
}
A = \{ a, b, c \}
A={ a,b,c}
R
1
=
{
<
a
,
a
>
,
<
a
,
b
>
,
<
b
,
a
>
,
<
b
,
c
>
}
R_1 = \{ <a, a> , <a,b> , <b,a> , <b,c> \}
R1={ <a,a>,<a,b>,<b,a>,<b,c>} Diagram representation :

R
2
=
{
<
a
,
b
>
,
<
a
,
c
>
,
<
b
,
c
>
}
R_2 = \{ <a,b>, <a,c>, <b,c> \}
R2={ <a,b>,<a,c>,<b,c>} Use diagrams to represent :

R
1
−
1
=
{
<
a
,
a
>
,
<
a
,
b
>
,
<
b
,
a
>
,
<
c
,
b
>
}
R_1^{-1} = \{ <a,a>, <a,b>, <b,a> , <c,b> \}
R1−1={ <a,a>,<a,b>,<b,a>,<c,b>}

R
2
−
1
=
{
<
b
,
a
>
,
<
c
,
a
>
,
<
c
,
b
>
}
R_2^{-1} = \{ <b,a> , <c,a> , <c,b> \}
R2−1={ <b,a>,<c,a>,<c,b>}

7、 ... and 、 Relationships represent related properties
A
A
A The elements in the collection , After calibration sequence , That is, the
A
A
A Relationship on ,
R
⊆
A
×
A
R \subseteq A \times A
R⊆A×A , It has the following properties :
- The diagram
G
(
R
)
G(R)
R
R
R Set expression of ( Ordered pair set ) , Sure Sole determination ;
G(R) And Relational
- Relationship
R
R
R Set expression of , The relational matrix
M
(
R
)
M(R)
M(R) , The diagram
G
(
R
)
G(R)
G(R) , They all correspond to each other ;
R
⊆
A
×
B
R \subseteq A \times B
R⊆A×B
- aggregate
A
A
A There is
n
n
n Elements ,
∣
A
∣
=
n
|A| = n
∣A∣=n
- aggregate
B
B
B There is
m
m
m Elements ,
∣
B
∣
=
m
|B| = m
∣B∣=m
- The relational matrix
M
(
R
)
M(R)
M(R) yes
n
×
m
n \times m
n×m Order matrix ;
- The diagram
G
(
R
)
G(R)
G(R) All directional edges are from
A
A
A The elements in the collection Point to
B
B
B The elements in the collection
边栏推荐
- The simple problem of leetcode: dismantling bombs
- Redis persistence principle
- 2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical
- What's wrong with SD card data damage? How to recover SD card data damage
- Pyqt control part (II)
- [set theory] Cartesian product (concept of Cartesian product | examples of Cartesian product | properties of Cartesian product | non commutativity | non associativity | distribution law | ordered pair
- 【SQL注入点】注入点出现位置、判断
- [literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
- Reptile exercise 02
- Youdao cloud notes
猜你喜欢

Function introduction of member points mall system

The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit

Network security textual research recommendation

Number of 1 in binary (simple difficulty)

Leetcode simple question: check whether the string is an array prefix

2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination

Internationalization and localization, dark mode and dark mode in compose

Some information about the developer environment in Chengdu

Arthas watch grabs a field / attribute of the input parameter

Human resource management system based on JSP
随机推荐
stm32逆向入门
[set theory] Cartesian product (concept of Cartesian product | examples of Cartesian product | properties of Cartesian product | non commutativity | non associativity | distribution law | ordered pair
Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
2022-02-12 (338. Bit count)
vulnhub HA: Natraj
Sdl2 + OpenGL glsl practice (Continued)
Joint search set: the number of points in connected blocks (the number of points in a set)
data2vec! New milestone of unified mode
[fxcg] market analysis today
Summary of training competition (Lao Li's collection of questions)
有道云笔记
[software testing-6] & Test Management
Kubernetes源码分析(一)
Ffmpeg tanscoding transcoding
Kingbasees plug-in KDB of Jincang database_ exists_ expand
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
2022 registration of G2 utility boiler stoker examination and G2 utility boiler stoker reexamination examination
FFMpeg example
怎么用Kotlin去提高生产力:Kotlin Tips
使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found