aboutsummaryrefslogtreecommitdiffstats
path: root/main.tex
diff options
context:
space:
mode:
Diffstat (limited to 'main.tex')
-rw-r--r--main.tex40
1 files changed, 22 insertions, 18 deletions
diff --git a/main.tex b/main.tex
index 2803200..0fa91ec 100644
--- a/main.tex
+++ b/main.tex
@@ -39,7 +39,6 @@
39\end{question} 39\end{question}
40 40
41\begin{commandline}[Gale-Shapley algorithm, from lecture slides, edited for the context] 41\begin{commandline}[Gale-Shapley algorithm, from lecture slides, edited for the context]
42
43 \begin{verbatim} 42 \begin{verbatim}
44 Initialize each person to be free. 43 Initialize each person to be free.
45 while (some student is free and hasn't applied to every college) { 44 while (some student is free and hasn't applied to every college) {
@@ -53,7 +52,6 @@
53 c rejects m (c) 52 c rejects m (c)
54 } 53 }
55 \end{verbatim} 54 \end{verbatim}
56
57 \end{commandline} 55 \end{commandline}
58 56
59A quick trace of the algorithm; 57A quick trace of the algorithm;
@@ -124,33 +122,39 @@ $S'$ could not have occurred since men propose in accordance to their preference
124 122
125% 1}}} % 123% 1}}} %
126 124
127% question d TODO {{{1 % 125% question d {{{1 %
128 126
129\begin{question} 127\begin{question}
130 Give an instance of $n$ colleges, $n$ students, and their preference lists so that the Gale-Shapley algorithm requires only $O(n)$ iterations, and prove this fact. 128 Give an instance of $n$ colleges, $n$ students, and their preference lists so that the Gale-Shapley algorithm requires only $O(n)$ iterations, and prove this fact.
131\end{question} 129\end{question}
132 130
133% TODO: you abused n and now they're both fucked <05-11-20, yigit> % 131For a proposer agnostic formation, arrange the preference lists of colleges and students as follows;
134 132
135Arrange the preference lists such as every $m^{\text{th}}$ student arranges their preference list such as; 133\begin{gather*}%
136
137\begin{equation}
138 \label{eq:student_prefs} 134 \label{eq:student_prefs}
139 C_n, C_{n-1}, C_{n-2}, \dots, C_{1} 135 C_{1} \rightarrow \left\{ S_{1}, S_{n}, S_{n-1}, \dots, S_{2} \right\} \\
140\end{equation} 136 C_{2} \rightarrow \left\{ S_{2}, S_{n}, S_{n-1}, \dots, S_{3} \right\} \\
137 \dots \\
138 C_{k} \rightarrow \left\{ S_{k}, S_{n}, S_{n-1}, \dots, S_{k+1} \right\} \\
139 \dots \\
140 C_{n} \rightarrow \left\{ S_{n}, S_{n-1}, S_{n-2}, \dots, S_{1} \right\} \\
141\end{gather*}
141 142
142Whereas every college can arrange their preference list as; 143\begin{gather*}%
144 \label{eq:student_prefs}
145 S_{1} \rightarrow \left\{ C_{1}, C_{n}, C_{n-1}, \dots, C_{2} \right\} \\
146 S_{2} \rightarrow \left\{ C_{2}, C_{n}, C_{n-1}, \dots, C_{3} \right\} \\
147 \dots \\
148 S_{k} \rightarrow \left\{ C_{k}, C_{n}, C_{n-1}, \dots, C_{k+1} \right\} \\
149 \dots \\
150 S_{n} \rightarrow \left\{ C_{n}, C_{n-1}, C_{n-2}, \dots, C_{1} \right\} \\
151\end{gather*}
143 152
144\begin{equation} 153Where the student list $\{S_1, S_2, \dots, S_{n}\}$ and college list $\{C_1, C_2, \dots, C_{n}\}$ are shifted.
145 \label{eq:college_prefs}
146 S_n, S_{n-1}, S_{n-2}, \dots, S_{1}
147\end{equation}
148 154
149The arrangement in (\ref{eq:college_prefs}) is not crucial since no college will be given a chance to \enquote{trade up}. 155In this setup, ever proposer will propose to the first suitor in their preference list which is guaranteed to be free since they are not the first on any other suitor's preference list.
150 156
151Every proposer applies to colleges in decreasing order from their preference list. 157The algorithm in this instance runs in $\mathcal{O}(n)$ iterations, every proposer will follow the (a) branch in the algorithm given under Question~\ref{q:1_a}.
152For $n=1$, $S_1$ applies to $C_1$ and the algorithm terminates in $n=1$ steps.
153For $n=k$, $S_1$ applies to $C_1$ which is free, $S_2$ applies to $C_2$ which is again free up to $S_k$ which can freely apply to $C_k$ and the algorithm terminates in $k$ steps after every student applied to the college on top of their preference list which was guaranteed to be free.
154 158
155% 1}}} % 159% 1}}} %
156 160