当前位置:网站首页>[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
边栏推荐
- Joint set search: merge intervals and ask whether two numbers are in the same set
- 因子选股-打分模型
- Truncated sentences of leetcode simple questions
- Writing skills of multi plate rotation strategy -- strategy writing learning materials
- Php+mysql registration landing page development complete code
- 2022 chemical automation control instrument examination summary and chemical automation control instrument certificate examination
- Redraw and reflow
- Reptile exercise 02
- 带有注意力RPN和多关系检测器的小样本目标检测网络(提供源码和数据及下载)...
- Sdl2 + OpenGL glsl practice (Continued)
猜你喜欢

Redis persistence principle

Web security - CSRF (token)

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

2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical

Small sample target detection network with attention RPN and multi relationship detector (provide source code, data and download)

Introduction to message queuing (MQ)

会员积分商城系统的功能介绍

Learning practice: comprehensive application of cycle and branch structure (I)

Leetcode simple question: check whether the array is sorted and rotated

Php+mysql registration landing page development complete code
随机推荐
[BMZCTF-pwn] 18-RCTF-2017-Recho
A outsourcing boy's mid-2022 summary
Two drawing interfaces - 1 Matlab style interface
Basic use of continuous integration server Jenkins
FISCO bcos zero knowledge proof Fiat Shamir instance source code
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
[set theory] binary relationship (definition field | value field | inverse operation | inverse synthesis operation | restriction | image | single root | single value | nature of synthesis operation)
Kingbasees plug-in KDB of Jincang database_ exists_ expand
Use the benchmarksql tool to perform a data prompt on kingbases. The jdbc driver cannot be found
金仓数据库KingbaseES 插件kdb_exists_expand
Some information about the developer environment in Chengdu
data2vec! New milestone of unified mode
普通本科大学生活避坑指南
Web security - CSRF (token)
多板块轮动策略编写技巧----策略编写学习教材
[fxcg] inflation differences will still lead to the differentiation of monetary policies in various countries
Library management system based on SSM
有道云笔记
Leetcode simple question: the key with the longest key duration
Symbol of array element product of leetcode simple problem