离散数学集训-day2(补档)
作者:互联网
作业1
(1)令
A
=
{
1
,
2
,
5
,
8
,
9
}
\mathbf{A}=\{1,2,5,8,9\}
A={1,2,5,8,9},写出
A
\mathbf{A}
A 上的 “模 2 同余” 关系及相应的划分
R
=
{
(
1
,
1
)
,
(
1
,
5
)
,
(
1
,
9
)
,
(
2
,
2
)
,
(
2
,
8
)
,
(
5
,
1
)
,
(
5
,
5
)
,
(
5
,
9
)
,
(
8
,
2
)
,
(
8
,
8
)
,
(
9
,
1
)
,
(
9
,
5
)
,
(
9
,
9
)
}
\mathbf{R}=\{(1,1),(1,5),(1,9),(2,2),(2,8),(5,1),(5,5),(5,9),(8,2),(8,8),(9,1),(9,5),(9,9)\}
R={(1,1),(1,5),(1,9),(2,2),(2,8),(5,1),(5,5),(5,9),(8,2),(8,8),(9,1),(9,5),(9,9)}
P
=
{
{
1
,
5
,
9
}
,
{
2
,
8
}
}
\mathcal{P}=\{\{1,5,9\},\{2,8\}\}
P={{1,5,9},{2,8}}
(2)令
A
=
{
1
,
2
,
5
,
8
,
9
}
\mathbf{A}=\{1,2,5,8,9\}
A={1,2,5,8,9}, 自己给定两个关系
R
1
\mathbf{R}_1
R1和
R
2
\mathbf{R}_2
R2
并计算
R
1
∘
R
2
\mathbf{R}_1∘\mathbf{R}_2
R1∘R2,
R
1
+
\mathbf{R}_1^+
R1+与
R
1
∗
\mathbf{R}_1^*
R1∗
R
1
=
{
(
a
,
b
)
∈
A
×
A
∣
a
/
2
=
b
/
2
}
=
{
(
2
,
2
)
,
(
2
,
8
)
,
(
8
,
2
)
,
(
8
,
8
)
}
\mathbf{R}_1=\{(a, b) \in \mathbf{A} \times \mathbf{A} \mid a / 2=b / 2\}=\{(2,2),(2,8),(8,2),(8,8)\}
R1={(a,b)∈A×A∣a/2=b/2}={(2,2),(2,8),(8,2),(8,8)}
R
1
=
{
(
a
,
b
)
∈
A
×
A
∣
a
=
b
m
o
d
3
}
=
{
(
2
,
2
)
,
(
2
,
5
)
,
(
2
,
8
)
,
(
5
,
2
)
,
(
5
,
5
)
,
(
5
,
8
)
,
(
8
,
2
)
,
(
8
,
5
)
,
(
8
,
8
)
}
\mathbf{R}_1=\{(a, b) \in \mathbf{A} \times \mathbf{A} \mid a =b \mod 3\}=\{(2,2),(2,5),(2,8),(5,2),(5,5),(5,8),(8,2),(8,5),(8,8)\}
R1={(a,b)∈A×A∣a=bmod3}={(2,2),(2,5),(2,8),(5,2),(5,5),(5,8),(8,2),(8,5),(8,8)}
R
1
+
=
⋃
i
=
1
∣
A
∣
R
i
=
R
1
∪
R
2
∪
R
3
∪
R
4
∪
R
5
=
{
(
2
,
2
)
,
(
2
,
8
)
,
(
8
,
8
)
}
\mathbf{R}_1^+=\bigcup_{i=1}^{|\mathbf{A}|} \mathbf{R}^{i}=\mathbf{R}^{1} \cup \mathbf{R}^{2} \cup \mathbf{R}^{3} \cup \mathbf{R}^{4} \cup \mathbf{R}^{5}=\{(2,2),(2,8),(8,8)\}
R1+=⋃i=1∣A∣Ri=R1∪R2∪R3∪R4∪R5={(2,2),(2,8),(8,8)}
R
1
∗
=
R
1
+
∪
A
0
=
{
(
2
,
2
)
,
(
2
,
8
)
,
(
8
,
8
)
}
\mathbf{R}_1^*=\mathbf{R}_1^+\cup \mathbf{A}^0=\{(2,2),(2,8),(8,8)\}
R1∗=R1+∪A0={(2,2),(2,8),(8,8)}
作业2
(1)给定一个矩阵并计算其各种范数
给定矩阵
X
=
[
1
2
3
4
]
\mathbf{X}=\begin{bmatrix} 1&2\\ 3&4\\ \end{bmatrix}
X=[1324]
l
0
=
∣
∣
X
∣
∣
0
=
4
l_0=||\mathbf{X}||_0=4
l0=∣∣X∣∣0=4;
l
1
=
∣
∣
X
∣
∣
1
=
1
+
2
+
3
+
4
=
10
l_1=||\mathbf{X}||_1=1+2+3+4=10
l1=∣∣X∣∣1=1+2+3+4=10;
l
2
=
∣
∣
X
∣
∣
1
=
1
2
+
2
2
+
3
2
+
4
2
=
30
l_2=||\mathbf{X}||_1=\sqrt{1^2+2^2+3^2+4^2}=\sqrt{30}
l2=∣∣X∣∣1=12+22+32+42
=30
;
l
∞
=
∣
∣
X
∣
∣
1
=
4
l_\infin=||\mathbf{X}||_1=4
l∞=∣∣X∣∣1=4;
(2)解释优化目标式子:
min
∑
(
i
,
j
∈
Ω
)
(
f
(
x
i
,
t
j
)
−
r
i
j
)
(1)
\min \sum_{(i,j\in\Omega)}(f(\mathbf{x}_i,\mathbf{t}_j)-r_{ij})\tag{1}
min(i,j∈Ω)∑(f(xi,tj)−rij)(1)
式中:
X
=
[
x
1
,
…
,
x
n
]
\mathbf{X}=[\mathbf{x}_1,\dots,\mathbf{x}_n]
X=[x1,…,xn]表示用户信息;
T
=
[
t
1
,
…
,
t
n
]
\mathbf{T}=[\mathbf{t}_1,\dots,\mathbf{t}_n]
T=[t1,…,tn]表示商品信息;
r
i
j
r_{ij}
rij表示评分矩阵
R
=
(
r
i
j
)
n
×
m
\mathbf{R} = (r_{ij})_{n×m}
R=(rij)n×m中具体的某个评分;
Ω
Ω
Ω 为评分矩阵
R
\mathbf{R}
R中非零元素对应位置的集合;
f
:
R
d
u
×
R
d
t
→
R
f: R^{d_{u}} \times R^{d_{t}} \rightarrow R
f:Rdu×Rdt→R中,
d
u
d_{u}
du与
d
t
d_{t}
dt分别表示用户和商品的属性树;
该式要学习一个
f
f
f 用于商品的推荐,使得预测结果
f
(
x
i
,
t
j
)
f(\mathbf{x}_i,\mathbf{t}_j)
f(xi,tj)与真实值
r
i
j
r_{ij}
rij均方误差MSE最小。
.
标签:mathbf,R1,cup,矩阵,day2,补档,离散数学,ij,rij 来源: https://blog.csdn.net/qq_52512724/article/details/119489513