| author | Christian Urban <christian.urban@kcl.ac.uk> | 
| Mon, 10 Jul 2023 18:48:05 +0100 | |
| changeset 914 | 245d2e9fa53a | 
| parent 891 | 4b1c96ab1c57 | 
| child 916 | 2ab96407f350 | 
| permissions | -rw-r--r-- | 
| 22 | 1 | \documentclass{article}
 | 
| 267 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 2 | \usepackage{../style}
 | 
| 889 | 3 | \usepackage{../graphicss}
 | 
| 4 | ||
| 22 | 5 | |
| 885 | 6 | \newcommand{\solution}[1]{%
 | 
| 7 |   \begin{quote}\sf%
 | |
| 8 | #1% | |
| 9 |   \end{quote}}
 | |
| 10 | \renewcommand{\solution}[1]{}
 | |
| 11 | ||
| 12 | ||
| 22 | 13 | \begin{document}
 | 
| 14 | ||
| 15 | \section*{Homework 2}
 | |
| 16 | ||
| 347 
22b5294daa2a
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
294diff
changeset | 17 | \HEADER | 
| 
22b5294daa2a
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
294diff
changeset | 18 | |
| 22 | 19 | \begin{enumerate}
 | 
| 499 | 20 | \item What is the difference between \emph{basic} regular expressions  
 | 
| 885 | 21 |   and \emph{extended} regular expressions?
 | 
| 22 | ||
| 23 |   \solution{Basic regular expressions are $\ZERO$, $\ONE$, $c$, $r_1 + r_2$,
 | |
| 24 | $r_1 \cdot r_2$, $r^*$. The extended ones are the bounded | |
| 25 | repetitions, not, etc.} | |
| 499 | 26 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 27 | \item What is the language recognised by the regular | 
| 885 | 28 | expressions $(\ZERO^*)^*$. | 
| 29 | ||
| 30 |   \solution{$L(\ZERO^*{}^*) = \{[]\}$,
 | |
| 31 | remember * always includes the empty string} | |
| 258 
1e4da6d2490c
updated programs
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
132diff
changeset | 32 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 33 | \item Review the first handout about sets of strings and read | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 34 | the second handout. Assuming the alphabet is the set | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 35 |       $\{a, b\}$, decide which of the following equations are
 | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 36 | true in general for arbitrary languages $A$, $B$ and | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 37 | $C$: | 
| 115 
86c1c049eb3e
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
104diff
changeset | 38 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 39 |       \begin{eqnarray}
 | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 40 | (A \cup B) @ C & =^? & A @ C \cup B @ C\nonumber\\ | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 41 | A^* \cup B^* & =^? & (A \cup B)^*\nonumber\\ | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 42 | A^* @ A^* & =^? & A^*\nonumber\\ | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 43 | (A \cap B)@ C & =^? & (A@C) \cap (B@C)\nonumber | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 44 |       \end{eqnarray}
 | 
| 104 
ffde837b1db1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
102diff
changeset | 45 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 46 | \noindent In case an equation is true, give an | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 47 | explanation; otherwise give a counter-example. | 
| 104 
ffde837b1db1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
102diff
changeset | 48 | |
| 885 | 49 |       \solution{1 + 3 are equal; 2 + 4 are not. Interesting is 4 where
 | 
| 889 | 50 |         $A = \{[a]\}$, $B = \{[]\}$ and $C = \{[a], []\}$\medskip
 | 
| 51 | ||
| 52 | For equations like 3 it is always a god idea to prove the | |
| 53 | two inclusions | |
| 54 | ||
| 55 | \[ | |
| 56 | A^* \subseteq A^* @ A^* \qquad | |
| 57 | A^* @ A^* \subseteq A^* | |
| 58 | \] | |
| 59 | ||
| 60 | This means for every string $s$ we have to show | |
| 61 | ||
| 62 | \[ | |
| 63 |           s \in A^*    \;\textit{implies}\;  s \in A^* @ A^* \qquad
 | |
| 64 |           s \in A^* @ A^* \;\textit{implies}\;  s \in A^*
 | |
| 65 | \] | |
| 66 | ||
| 67 | The first one is easy because $[] \in A^*$ and therefore | |
| 68 | $s @ [] \in A^* @ A^*$. | |
| 69 | ||
| 70 | The second one says that $s$ must be of the form $s = s_1 @ s_2$ with | |
| 71 | $s_1 \in A^*$ and $s_2 \in A^*$. We have to show that | |
| 72 | $s_1 @ s_2 \in A^*$. | |
| 73 | ||
| 74 | If $s_1 \in A^*$ then there exists an $n$ such that $s_1 \in A^n$, and | |
| 75 | if $s_2 \in A^*$ then there exists an $m$ such that $s_2 \in A^m$.\bigskip | |
| 76 | ||
| 77 | ||
| 78 | Aside: We are going to show that | |
| 79 | ||
| 80 | \[ | |
| 81 |         A^n \,@\, A^m = A^{n+m}  
 | |
| 82 | \] | |
| 83 | ||
| 84 | We prove that by induction on $n$. | |
| 85 | ||
| 86 |         Case $n = 0$: $A^0 \,@\, A^m = A^{0+m}$ holds because $A^0 = \{[]\}$
 | |
| 87 |         and $\{[]\} \,@\, A^m = A ^ m$ and $0 + m = m$.\medskip
 | |
| 88 | ||
| 89 | Case $n + 1$: The induction hypothesis is | |
| 90 | ||
| 91 |         \[ A^n \,@\, A^m = A^{n+m}
 | |
| 92 | \] | |
| 93 | ||
| 94 | We need to prove | |
| 95 | ||
| 96 | \[ | |
| 97 |         A^{n+1} \,@\, A^m = A^{(n+1)+m}  
 | |
| 98 | \] | |
| 99 | ||
| 100 | The left-hand side is $(A \,@\, A^n) \,@\, A^m$ by the definition of | |
| 101 | the power operation. We can rearrange that | |
| 102 |         to $A \,@\, (A^n \,@\, A^m)$.   \footnote{Because for all languages $A$, $B$, $C$ we have $(A @ B) @ C = A @ (B @ C)$.}
 | |
| 103 | ||
| 104 |         By the induction hypothesis we know that $A^n \,@\, A^m = A^{n+m}$.
 | |
| 105 | ||
| 106 |         So we have $A \,@\, (A^{n+m})$. But this is $A^{(n+m)+1}$ again if we
 | |
| 107 | apply the definition of the power operator. If we | |
| 108 |         rearrange that we get $A^{(n+1)+m}$ and are done with
 | |
| 109 | what we need to prove for the power law.\bigskip | |
| 110 | ||
| 111 | Picking up where we left, we know that $s_1 \in A^n$ and $s_2 \in A^m$. This now implies that $s_1 @ s_2\in A^n @ A^m$. By the power law this means | |
| 112 |         $s_1 @ s_2\in A^{n+m}$. But this also means $s_1 @ s_2\in A^*$.
 | |
| 113 | } | |
| 885 | 114 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 115 | \item Given the regular expressions $r_1 = \ONE$ and $r_2 = | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 116 | \ZERO$ and $r_3 = a$. How many strings can the regular | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 117 | expressions $r_1^*$, $r_2^*$ and $r_3^*$ each match? | 
| 104 
ffde837b1db1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
102diff
changeset | 118 | |
| 885 | 119 |       \solution{$r_1$ and $r_2$ can match the empty string only, $r_3$ can
 | 
| 120 | match $[]$, $a$, $aa$, ....} | |
| 121 | ||
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 122 | \item Give regular expressions for (a) decimal numbers and for | 
| 617 | 123 | (b) binary numbers. Hint: Observe that the empty string | 
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 124 | is not a number. Also observe that leading 0s are | 
| 617 | 125 | normally not written---for example the JSON format for numbers | 
| 891 | 126 | explicitly forbids this. So 007 is not a number according to JSON. | 
| 22 | 127 | |
| 885 | 128 |       \solution{Just numbers without leading 0s: $0 + (1..9)\cdot(0..1)^*$;
 | 
| 129 | can be extended to decimal; similar for binary numbers | |
| 130 | } | |
| 131 | ||
| 258 
1e4da6d2490c
updated programs
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
132diff
changeset | 132 | \item Decide whether the following two regular expressions are | 
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 133 | equivalent $(\ONE + a)^* \equiv^? a^*$ and $(a \cdot | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 134 | b)^* \cdot a \equiv^? a \cdot (b \cdot a)^*$. | 
| 22 | 135 | |
| 885 | 136 |       \solution{Both are equivalent, but why the second? Essentially you have to show that each string in one set is in the other. For 2 this means you can do an induction proof that $(ab)^na$ is the same string as $a(ba)^n$, where the former is in the first set and the latter in the second.}
 | 
| 137 | ||
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 138 | \item Given the regular expression $r = (a \cdot b + b)^*$. | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 139 | Compute what the derivative of $r$ is with respect to | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 140 | $a$, $b$ and $c$. Is $r$ nullable? | 
| 22 | 141 | |
| 881 | 142 | \item Give an argument for why the following holds: | 
| 885 | 143 |   if $r$ is nullable then $r^{\{n\}} \equiv r^{\{..n\}}$.
 | 
| 144 | ||
| 145 |   \solution{This was from last week; I just explicitly added it here.}
 | |
| 258 
1e4da6d2490c
updated programs
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
132diff
changeset | 146 | |
| 355 
a259eec25156
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
347diff
changeset | 147 | \item Define what is meant by the derivative of a regular | 
| 
a259eec25156
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
347diff
changeset | 148 | expressions with respect to a character. (Hint: The | 
| 
a259eec25156
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
347diff
changeset | 149 | derivative is defined recursively.) | 
| 267 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 150 | |
| 885 | 151 |       \solution{the recursive function for $der$}
 | 
| 152 | ||
| 768 | 153 | \item Assume the set $Der$ is defined as | 
| 267 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 154 | |
| 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 155 |   \begin{center}
 | 
| 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 156 |     $Der\,c\,A \dn \{ s \;|\;  c\!::\!s \in A\}$
 | 
| 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 157 |   \end{center}
 | 
| 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 158 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 159 | What is the relation between $Der$ and the notion of | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 160 | derivative of regular expressions? | 
| 267 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 161 | |
| 885 | 162 |       \solution{Main property is $L(der\,c\,r) = Der\,c\,(L(r))$.}
 | 
| 163 | ||
| 267 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 164 | \item Give a regular expression over the alphabet $\{a,b\}$
 | 
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 165 | recognising all strings that do not contain any | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 166 | substring $bb$ and end in $a$. | 
| 267 
a1544b804d1e
updated homeworks
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
258diff
changeset | 167 | |
| 889 | 168 |       \solution{$((ba)^* \cdot (a)^*)^*\,\cdot\,a$}
 | 
| 885 | 169 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 170 | \item Do $(a + b)^* \cdot b^+$ and $(a^* \cdot b^+) + | 
| 885 | 171 | (b^*\cdot b^+)$ define the same language? | 
| 172 | ||
| 889 | 173 |   \solution{No, the first one can match for example abababababbbbb
 | 
| 174 | while the second can only match for example aaaaaabbbbb or bbbbbbb} | |
| 294 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 175 | |
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 176 | \item Define the function $zeroable$ by recursion over regular | 
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 177 | expressions. This function should satisfy the property | 
| 294 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 178 | |
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 179 | \[ | 
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 180 |   zeroable(r) \;\;\text{if and only if}\;\;L(r) = \{\}\qquad(*)
 | 
| 294 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 181 | \] | 
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 182 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 183 | The function $nullable$ for the not-regular expressions | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 184 | can be defined by | 
| 294 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 185 | |
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 186 | \[ | 
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 187 | nullable(\sim r) \dn \neg(nullable(r)) | 
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 188 | \] | 
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 189 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 190 | Unfortunately, a similar definition for $zeroable$ does | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 191 | not satisfy the property in $(*)$: | 
| 294 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 192 | |
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 193 | \[ | 
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 194 | zeroable(\sim r) \dn \neg(zeroable(r)) | 
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 195 | \] | 
| 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 196 | |
| 889 | 197 | Find a counter example? | 
| 198 | ||
| 199 | ||
| 200 |   \solution{
 | |
| 201 | Here the idea is that nullable for NOT can be defined as | |
| 202 | ||
| 203 | \[nullable(\sim r) \dn \neg(nullable(r))\] | |
| 204 | ||
| 205 | This will satisfy the property | |
| 206 |     $nullable(r) \;\;\text{if and only if}\;\;[] \in L(r)$. (Remember how
 | |
| 207 | $L(\sim r)$ is defined).\bigskip | |
| 208 | ||
| 209 | But you cannot define | |
| 210 | ||
| 211 | \[zeroable(\sim r) \dn \neg(zeroable(r))\] | |
| 212 | ||
| 213 | because if $r$ for example is $\ONE$ then $\sim \ONE$ can match | |
| 214 | some strings (all non-empty strings). So $zeroable$ should be false. But if we follow | |
| 215 | the above definition we would obtain $\neg(zeroable(\ONE))$. According | |
| 216 | to the definition of $zeroable$ for $\ONE$ this would be false, | |
| 217 | but if we now negate false, we get actually true. So the above | |
| 218 | definition would not satisfy the property | |
| 219 | ||
| 220 | \[ | |
| 221 |       zeroable(r) \;\;\text{if and only if}\;\;L(r) = \{\}
 | |
| 222 | \] | |
| 223 | } | |
| 294 
c29853b672fb
updated hws
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
292diff
changeset | 224 | |
| 401 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 225 | \item Give a regular expressions that can recognise all | 
| 
5d85dc9779b1
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
355diff
changeset | 226 |       strings from the language $\{a^n\;|\;\exists k.\; n = 3 k
 | 
| 885 | 227 | + 1 \}$. | 
| 228 | ||
| 229 |       \solution{$a(aaa)^*$}
 | |
| 404 
245d302791c7
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
401diff
changeset | 230 | |
| 
245d302791c7
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
401diff
changeset | 231 | \item Give a regular expression that can recognise an odd | 
| 889 | 232 | number of $a$s or an even number of $b$s. | 
| 233 | ||
| 234 |   \solution{
 | |
| 235 | If the a's and b's are meant to be separate, then this is easy | |
| 236 | ||
| 237 | \[a(aa)^* + (bb)^*\] | |
| 238 | ||
| 239 | If the letters are mixed, then this is difficult | |
| 240 | ||
| 241 | \[(aa|bb|(ab|ba)\cdot (aa|bb)^* \cdot (ba|ab))^* \cdot (b|(ab|ba)(bb|aa)^* \cdot a) | |
| 242 | \] | |
| 243 | ||
| 244 | (copied from somewhere ;o) | |
| 245 | ||
| 246 | The idea behind it is essentially the DFA | |
| 247 | ||
| 248 | \begin{center}    
 | |
| 249 | \begin{tikzpicture}[scale=1,>=stealth',very thick,
 | |
| 250 |                     every state/.style={minimum size=0pt,
 | |
| 251 | draw=blue!50,very thick,fill=blue!20}] | |
| 252 |   \node[state,initial]   (q0) at (0,2) {$q_0$};
 | |
| 253 |   \node[state,accepting] (q1) at (2,2) {$q_1$};
 | |
| 254 |   \node[state]           (q2) at (0,0) {$q_2$};
 | |
| 255 |   \node[state]           (q3) at (2,0) {$q_3$};
 | |
| 256 | ||
| 257 |  \path[->]  (q0) edge[bend left] node[above] {$a$} (q1)
 | |
| 258 |             (q1) edge[bend left] node[above] {$a$} (q0)
 | |
| 259 |             (q2) edge[bend left] node[above] {$a$} (q3)
 | |
| 260 |             (q3) edge[bend left] node[above] {$a$} (q2)
 | |
| 261 |             (q0) edge[bend left] node[right] {$b$} (q2)
 | |
| 262 |             (q2) edge[bend left] node[left]  {$b$} (q0)
 | |
| 263 |             (q1) edge[bend left] node[right] {$b$} (q3)
 | |
| 264 |             (q3) edge[bend left] node[left]  {$b$} (q1);
 | |
| 265 | \end{tikzpicture}
 | |
| 266 | \end{center}
 | |
| 267 | } | |
| 444 
3056a4c071b0
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
404diff
changeset | 268 | |
| 
3056a4c071b0
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
404diff
changeset | 269 | \item \POSTSCRIPT | 
| 404 
245d302791c7
updated
 Christian Urban <christian dot urban at kcl dot ac dot uk> parents: 
401diff
changeset | 270 | \end{enumerate}
 | 
| 22 | 271 | |
| 272 | \end{document}
 | |
| 273 | ||
| 274 | %%% Local Variables: | |
| 275 | %%% mode: latex | |
| 276 | %%% TeX-master: t | |
| 277 | %%% End: |