Skip to content

Commit eda1fbe

Browse files
colinaaaL-LYRNickLee2050
committed
fix: make minor fixes on many chapters (#17 , #21)
* fix(ln11): make minor fix on algorithm change n - 1 to n - 2 fix #16 * fix(stable-matching): fix some typos in stable matching thanks to @L-LYR for pointing it out re #18 * fix(dp1): fix a subscript error thanks to @L-LYR for pointing it out re #18 * fix(dp1): fix counter example change 999 to 99, thanks @L-LYR re #18 * fix(network-flow): fix a subscript problem thanks to @L-LYR fix #18 * Another change on two expressions in LN11 * fix: add bracket to an expression Co-Authored-By: L-LYR <45999891+L-LYR@users.noreply.github.com> Co-Authored-By: Nick_Lee <45791374+NickLee2050@users.noreply.github.com>
1 parent 99741ef commit eda1fbe

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/Ln11-LargeIntegerMultiplication.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ \subsection{伪代码}
7373
$C_2 \leftarrow DirectDAC(A_2, B_1)$\;
7474
$C_1 \leftarrow DirectDAC(A_1, B_2)$\;
7575
$C_0 \leftarrow DirectDAC(A_1, B_1)$\;
76-
\KwRet{$C_3 \ll n + (C_2 + C_1) \ll (n - 1) + C_0$}\;
76+
\KwRet{$C_3 \ll n + (C_2 + C_1) \ll (\frac{n}{2}) + C_0$}\;
7777
}
7878
\Else{
7979
\KwRet{$A \times B$}
@@ -138,7 +138,7 @@ \subsection{伪代码}
138138
$C_2 \leftarrow DirectDAC(A_2, B_2)$\;
139139
$C_1 \leftarrow DirectDAC(A_1, B_1)$\;
140140
$C_0 \leftarrow DirectDAC(A_2 + A_1, B_2 + B_1)$\;
141-
\KwRet{$C_2 \ll n + (C_0 - C_2 - C_1) \ll (n - 1) + C_1$}\;
141+
\KwRet{$C_2 \ll n + (C_0 - C_2 - C_1) \ll (\frac{n}{2}) + C_1$}\;
142142
}
143143
\Else{
144144
\KwRet{$A \times B$}

src/Network-flows.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ \section{最大二分匹配问题}
5858
\end{figure}
5959

6060
\begin{example}
61-
\autoref{fig3}所示,给定二分图中,点被分为了\(V_l\)\(V_r\)两个部分,构造网络流算法,设置一个起点S,且令S到所有的Vl中的点均有路径,容量为1;设置一个终点T,且从\(V_r\)中的点到T均有路径,容量为1。同时,所有\(V_l\)\(V_r\)之间的路径容量均设为无穷大,由此可以找到该网络流的最大流和最小割。
61+
\autoref{fig3}所示,给定二分图中,点被分为了\(V_l\)\(V_r\)两个部分,构造网络流算法,设置一个起点S,且令S到所有的\(V_l\)中的点均有路径,容量为1;设置一个终点T,且从\(V_r\)中的点到T均有路径,容量为1。同时,所有\(V_l\)\(V_r\)之间的路径容量均设为无穷大,由此可以找到该网络流的最大流和最小割。
6262
\end{example}
6363

6464
\begin{itemize}

src/dynamic-programming-1.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ \subsection{问题描述}
4343
给定区间$I_1, I_2, \ldots, I_n$
4444
$s_i$$I_i$开始时间,$f_i$$I_i$的结束时间($f_i>s_i$),$w_i>0$, 假设$\forall i < j$$ s_i<s_j$
4545
\begin{itemize}
46-
\item $OPT(k)$:表示区间集合$\{ I_1, I_2, \ldots , I_i \}$上的最优解权值。
46+
\item $OPT(k)$:表示区间集合$\{ I_1, I_2, \ldots , I_k \}$上的最优解权值。
4747
\item $P(i)$:表示$I_i$的前驱,当$P(i)=j$时,有$f_j=\max\limits_{1 \leq k < i}\{f_k | f_k < s_i\}$,当$I_i$没有前驱时,$P(i)=0$
4848
\end{itemize}
4949
目标:寻找一个$\sum w_i$最大的区间子集$R$,满足$\forall I_m,I_n \in R, m < n \text{都有} f_m < s_n$
@@ -71,7 +71,7 @@ \subsection{贪心}
7171
\centering
7272
\begin{tikzpicture}
7373
\draw[|-|] (0, 0) -- node [above] {\scriptsize 2} (1, 0);
74-
\draw[|-|] (1.2, 0) -- node [above] {\scriptsize 999} (2.2, 0);
74+
\draw[|-|] (1.2, 0) -- node [above] {\scriptsize 99} (2.2, 0);
7575
\draw[|-|] (0.7 , -0.5) -- node [above] {\scriptsize 100} (1.7, -0.5);
7676
\end{tikzpicture}
7777
\caption{}\label{fig:wis-counterexample2}

src/stable-matching.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ \chapter{匹配问题(Matching Problem)}
77
\end{introduction}
88

99
\section{问题引入}\label{sec:stable-matching-def}
10-
现在有n个男性的一个集合$M=\{m_1,\dots,m_n\}$和n个女人性一个集合$W=\{w_1,\dots,w_n\}$
10+
现在有n个男性的一个集合$M=\{m_1,\dots,m_n\}$和n个女性一个集合$W=\{w_1,\dots,w_n\}$
1111
$M\times W$来表示$(m,w)$所有可能有序对的一个集合,其中$m\in M,w\in W$。一个匹配(Matching)$S$是一个有序对的集合,
1212
这些有序对来自于$M\times W$,并且每一个来自$M$中的元素和来自$W$中的元素最多在$S$中出现一次。
1313
一个完美匹配(Perfect Matching)$S'$是指每一个来自$M$$W$中的元素都出现过一次的匹配。
@@ -124,7 +124,7 @@ \section{算法分析}\label{sec:stable-matching-analyze}
124124
当算法结束时得到的匹配集合$S$一定是一个完美匹配。
125125
\end{theorem}
126126
\begin{proof}
127-
约定的对最后会形成匹配。我们袈裟算法会在还有一个未匹配的$m$的时候终止。在终止的时候,$m$一定向所有的女性发出过请求,否则算法不会终止。
127+
约定的对最后会形成匹配。我们G-S算法会在还有一个未匹配的$m$的时候终止。在终止的时候,$m$一定向所有的女性发出过请求,否则算法不会终止。
128128
但这与定理\ref{thm:stable-matching-4}矛盾,不可能有向所有的女性申请过后还有未匹配状态的男性。
129129
\end{proof}
130130
最后,我们得到算法的结果是一个稳定匹配

0 commit comments

Comments
 (0)