Skip to content

Commit f4908d8

Browse files
committed
fixed last question of HW
1 parent c4fb8fb commit f4908d8

File tree

6 files changed

+58
-14
lines changed

6 files changed

+58
-14
lines changed

CH3HW/Ch3HW.html

+42-10
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,48 @@ <h3 class="mume-header" id="373">3.7.3</h3>
351351

352352
<h4 class="mume-header" id="a-1">a</h4>
353353

354-
<ul>
355-
<li>
356-
<p><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mi mathvariant="normal">&#x2223;</mi><mi>b</mi></mrow><annotation encoding="application/x-tex">a|b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">a</span><span class="mord">&#x2223;</span><span class="mord mathnormal">b</span></span></span></span><br>
357-
<img src="thompson1.png" alt="step 1"></p>
358-
</li>
359-
<li>
360-
<p><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>a</mi><mi mathvariant="normal">&#x2223;</mi><mi>b</mi><mo stretchy="false">)</mo><mo>&#x2217;</mo></mrow><annotation encoding="application/x-tex">(a|b)*</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mord">&#x2223;</span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mord">&#x2217;</span></span></span></span><br>
361-
<img src="thompson2.png" alt="step 2"></p>
362-
</li>
363-
</ul>
354+
<h5 class="mume-header" id="nfa-ab">NFA <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>a</mi><mi mathvariant="normal">&#x2223;</mi><mi>b</mi><mo stretchy="false">)</mo><mo>&#x2217;</mo></mrow><annotation encoding="application/x-tex">(a|b)*</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">a</span><span class="mord">&#x2223;</span><span class="mord mathnormal">b</span><span class="mclose">)</span><span class="mord">&#x2217;</span></span></span></span></h5>
355+
356+
<p><img src="thompson2.png" alt="step 2"></p>
357+
<h5 class="mume-header" id="transition-table">Transition Table</h5>
358+
359+
<table>
360+
<thead>
361+
<tr>
362+
<th>State</th>
363+
<th>a</th>
364+
<th>b</th>
365+
<th>a + <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>&#x3F5;</mi></mrow><annotation encoding="application/x-tex">\epsilon</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">&#x3F5;</span></span></span></span></th>
366+
<th>b + <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>&#x3F5;</mi></mrow><annotation encoding="application/x-tex">\epsilon</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathnormal">&#x3F5;</span></span></span></span></th>
367+
</tr>
368+
</thead>
369+
<tbody>
370+
<tr>
371+
<td>X: {1,2,3,6}</td>
372+
<td>{4}</td>
373+
<td>{7}</td>
374+
<td>{4,3,2,6,8}</td>
375+
<td>{7,3,2,6,8}</td>
376+
</tr>
377+
<tr>
378+
<td>Y: {4,3,2,6,8}</td>
379+
<td>{4}</td>
380+
<td>{7}</td>
381+
<td>{4,3,2,6,8}</td>
382+
<td>{7,3,2,6,8}</td>
383+
</tr>
384+
<tr>
385+
<td>Z: {7,3,2,6,8}</td>
386+
<td>{4}</td>
387+
<td>{7}</td>
388+
<td>{4,3,2,6,8}</td>
389+
<td>{7,3,2,6,8}</td>
390+
</tr>
391+
</tbody>
392+
</table>
393+
<h5 class="mume-header" id="dfa">DFA</h5>
394+
395+
<p><img src="thompson1.png" alt="A"></p>
364396

365397
</div>
366398

CH3HW/Ch3HW.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,20 @@ $$0 \Rightarrow (\epsilon) 3 \Rightarrow (\epsilon) 2 \Rightarrow (\epsilon) 1 \
3232

3333
### 3.7.3
3434
#### a
35-
- $a|b$
36-
![step 1](thompson1.png)
3735

38-
- $(a|b)*$
39-
![step 2](thompson2.png)
36+
##### NFA $(a|b)*$
37+
38+
![step 2](thompson2.png)
39+
40+
##### Transition Table
41+
42+
| State | a | b | a + $\epsilon$ | b + $\epsilon$ |
43+
|----------------|-----|-----|-------------------|-------------------|
44+
| X: {1,2,3,6} | {4} | {7} | {4,3,2,6,8} | {7,3,2,6,8} |
45+
| Y: {4,3,2,6,8} | {4} | {7} | {4,3,2,6,8} | {7,3,2,6,8} |
46+
| Z: {7,3,2,6,8} | {4} | {7} | {4,3,2,6,8} | {7,3,2,6,8} |
47+
48+
49+
##### DFA
50+
51+
![A](thompson1.png)

CH3HW/thompson1.png

24 KB
Loading

CH3HW/thompson1_old.png

43.8 KB
Loading

CH3HW/thompson2.png

19.6 KB
Loading

CH3HW/thompson2_old.png

61.9 KB
Loading

0 commit comments

Comments
 (0)