Skip to content

Commit 5812998

Browse files
committed
Fit
1 parent da17682 commit 5812998

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

typst/lec-computation.typ

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,32 +1150,27 @@ Here, $x$ is the path to the loop, $y$ is the loop itself, $z$ is the path from
11501150

11511151
#proof[
11521152
By contradiction.
1153-
Assume that $"EQUAL"$ is a regular language.
1153+
Assume $"EQUAL"$ is regular, and let $n$ be the pumping length. \
1154+
Take $w = 0^n hash 0^n in "EQUAL"$.
1155+
Write $w = x y z$ as in the weak pumping lemma.
11541156

1155-
Let $n$ be the pumping length guaranteed by the weak pumping lemma.
1156-
Let $w = 0^n hash 0^n$, which is in $"EQUAL"$ and $abs(w) = 2n + 1 >= n$.
1157-
By the weak pumping lemma, we can write $w = x y z$ such that $y != epsilon$ and for any $i in NN$, $x y^i z in "EQUAL"$.
1158-
Then $y$ cannot contain $hash$, since otherwise if we let $i = 0$, then $x y^0 z = x z$ does not contain $hash$ and would not be in $"EQUAL"$.
1159-
So $y$ is either completely to the left of $hash$ or completely to the right of $hash$.
1157+
The block $y$ cannot contain $hash$, because pumping with $i = 0$ would remove $hash$ and produce a string outside $"EQUAL"$.
1158+
Hence $y$ lies entirely to the left or entirely to the right of $hash$, so $y = 0^k$ for some $k > 0$.
11601159

1161-
Let $abs(y) = k$, so $k > 0$.
1162-
Since $y$ is completely to the left or right of $hash$, then #box[$y = 0^k$].
1163-
1164-
Now, we consider two cases:
1160+
We now pump with $i = 2$:
11651161
#enum(numbering: i => "Case " + str(i) + ":")[
11661162
$y$ is to the left of $hash$.
1167-
Then $x y^2 z = 0^(n+k) hash 0^n notin "EQUAL"$, contradicting the weak pumping lemma.
1163+
Then $x y^2 z = 0^(n+k) hash 0^n notin "EQUAL"$.
11681164
][
11691165
$y$ is to the right of $hash$.
1170-
Then $x y^2 z = 0^n hash 0^(n+k) notin "EQUAL"$, contradicting the lemma.
1166+
Then $x y^2 z = 0^n hash 0^(n+k) notin "EQUAL"$.
11711167
]
1172-
In either case we reach a contradiction, so our assumption was wrong.
1173-
Thus, $"EQUAL"$ _is not regular_.
1168+
In both cases we contradict the pumping lemma.
1169+
Therefore $"EQUAL"$ is not regular.
11741170
]
11751171

11761172
#Block(color: blue)[
1177-
*Why this matters:* This result tells us that a finite automaton fundamentally _cannot compare_ two unbounded strings for equality.
1178-
It lacks "memory" beyond its finite set of states.
1173+
A finite automaton cannot compare two unbounded strings for equality, because it has only finitely many states, i.e. it lacks "memory".
11791174
]
11801175

11811176
== The Classic Non-regular Language

0 commit comments

Comments
 (0)