equal
deleted
inserted
replaced
1 \documentclass{article} |
1 \documentclass{article} |
2 \usepackage{charter} |
|
3 \usepackage{hyperref} |
2 \usepackage{hyperref} |
4 \usepackage{amssymb} |
3 \usepackage{amssymb} |
5 \usepackage{amsmath} |
4 \usepackage{amsmath} |
|
5 \usepackage{../langs} |
6 |
6 |
7 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% |
7 \newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% |
8 \begin{document} |
8 \begin{document} |
9 |
9 |
10 \section*{Coursework 1} |
10 \section*{Coursework 1} |
105 |
105 |
106 Consider the regular expression $/ \cdot * \cdot (\sim{}([a\mbox{-}z]^* \cdot * \cdot / \cdot [a\mbox{-}z]^*)) \cdot * \cdot /$ and decide |
106 Consider the regular expression $/ \cdot * \cdot (\sim{}([a\mbox{-}z]^* \cdot * \cdot / \cdot [a\mbox{-}z]^*)) \cdot * \cdot /$ and decide |
107 wether the following four strings are matched by this regular expression. Answer yes or no. |
107 wether the following four strings are matched by this regular expression. Answer yes or no. |
108 |
108 |
109 \begin{enumerate} |
109 \begin{enumerate} |
110 \item "/**/" |
110 \item \texttt{"/**/"} |
111 \item "/*foobar*/" |
111 \item \texttt{"/*foobar*/"} |
112 \item "/*test*/test*/" |
112 \item \texttt{"/*test*/test*/"} |
113 \item "/*test/*test*/" |
113 \item \texttt{"/*test/*test*/"} |
114 \end{enumerate} |
114 \end{enumerate} |
115 |
115 |
116 \subsection*{Question 4 (marked with 1\%)} |
116 \subsection*{Question 4 (marked with 1\%)} |
117 |
117 |
118 Let $r_1$ be the regular expression $a\cdot a\cdot a$ and $r_2$ be $(a^{\{19,19\}}) \cdot (a^?)$. |
118 Let $r_1$ be the regular expression $a\cdot a\cdot a$ and $r_2$ be $(a^{\{19,19\}}) \cdot (a^?)$. |
123 These are strings are meant to be entirely made up of $a$s. Be careful when |
123 These are strings are meant to be entirely made up of $a$s. Be careful when |
124 copy-and-pasting the strings so as to not forgetting any $a$ and to not introducing any |
124 copy-and-pasting the strings so as to not forgetting any $a$ and to not introducing any |
125 other character. |
125 other character. |
126 |
126 |
127 \begin{enumerate} |
127 \begin{enumerate} |
128 \item $"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
128 \item \texttt{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
129 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
129 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
130 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"$ |
130 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} |
131 \item $"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
131 \item \texttt{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
132 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
132 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
133 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"$ |
133 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} |
134 \item$"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
134 \item \texttt{"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
135 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
135 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\ |
136 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"$ |
136 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"} |
137 \end{enumerate} |
137 \end{enumerate} |
138 |
138 |
139 |
139 |
140 \end{document} |
140 \end{document} |
141 |
141 |