Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CS320
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
CS320
Commits
5f311e1a
Verified
Commit
5f311e1a
authored
4 weeks ago
by
Sankalp Gambhir
Browse files
Options
Downloads
Patches
Plain Diff
Update exercise set 1 q1
parent
3cbe13d6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
info/exercises/ex-01-sol.pdf
+0
-0
0 additions, 0 deletions
info/exercises/ex-01-sol.pdf
info/exercises/ex-01.pdf
+0
-0
0 additions, 0 deletions
info/exercises/ex-01.pdf
info/exercises/src/ex-01/ex/languages.tex
+22
-11
22 additions, 11 deletions
info/exercises/src/ex-01/ex/languages.tex
with
22 additions
and
11 deletions
info/exercises/ex-01-sol.pdf
+
0
−
0
View file @
5f311e1a
No preview for this file type
This diff is collapsed.
Click to expand it.
info/exercises/ex-01.pdf
+
0
−
0
View file @
5f311e1a
No preview for this file type
This diff is collapsed.
Click to expand it.
info/exercises/src/ex-01/ex/languages.tex
+
22
−
11
View file @
5f311e1a
...
...
@@ -3,34 +3,45 @@
\begin{exercise}
{}
For each of the following expressions on sets of words, match them to a
property
\(
P
\)
that characterizes them, i.e., the language is exactly the set
of words
\(
\{
w
\ \mid
P
(
w
)
\}
\)
.
Languages:
Consider the following languages defined by regular expressions:
\begin{enumerate}
\item
\(
\{
a,ab
\}
^
*
\)
\item
\(
\{
aa
\}
^
*
\cup
\{
aaa
\}
^
*
\)
\item
\(
a
^
+
b
^
+
\)
\end{enumerate}
Predicates in set notation:
and the following languages defined in set-builder notation:
\begin{enumerate}
\renewcommand
{
\theenumi
}{
\Alph
{
enumi
}}
\item
\(
\{
w
\mid
\forall
i.
0
\le
i
\le
|w|
\land
w
_{
(
i
)
}
=
b
\implies
(
i >
0
\land
w
_{
(
i
-
1
)
}
=
a
)
\}
\)
% 1
\item
\(
\{
w
\mid
\forall
i. w
_{
(
i
)
}
=
b
\implies
w
_{
(
i
-
1
)
}
=
a
\}
\)
% wrong
\item
\(
\{
w
\mid
\forall
i.
0
\le
i < |w|
\implies
w
_{
(
i
)
}
=
b
\implies
w
_{
(
i
+
1
)
}
=
a
\}
\)
% wrong
\item
\(
\{
w
\mid
\exists
i.
0
< i < |w|
\land
w
_{
(
i
)
}
=
b
\land
w
_{
(
i
-
1
)
}
=
a
\}
\)
% wrong
\item
\(
\{
w
\mid
(
|w|
=
0
\mod
2
\lor
|w|
=
0
\mod
3
)
\land
\forall
i.
0
\leq
i < |w|
\implies
w
_{
(
i
)
}
=
a
\}
\)
% 2
\item
\(
\{
w
\mid
\forall
i.
0
\le
i
\le
|w|
\land
w
_{
(
i
)
}
=
a
\implies
w
_{
(
i
+
1
)
}
=
b
\}
\)
% wrong
\item
\(
\{
w
\mid
\forall
i.
0
\le
i
<
|w|
\land
w
_{
(
i
)
}
=
a
\implies
w
_{
(
i
+
1
)
}
=
b
\}
\)
% wrong
\item
\(
\{
w
\mid
\exists
i.
0
< i < |w|
-
1
\land
(
\forall
y.
0
\leq
y
\leq
i
\implies
w
_{
(
y
)
}
=
a
)
\land
(
\forall
y. i < y < |w|
\implies
w
_{
(
y
)
}
=
b
)
\}
\)
% 3
\end{enumerate}
For each pair (e.g. 1-A), check whether the two languages are equal, providing
a proof if they are, and a counterexample word that is in one but not the
other if unequal.
\begin{solution}
\(
1
\mapsto
A,
2
\mapsto
D,
3
\mapsto
F
\)
.
Equal language pairs:
\(
1
\mapsto
A,
2
\mapsto
D,
3
\mapsto
F
\)
.
Counterexamples (
\(
\cdot
^
\star
\)
means the word is in the alphabet-labelled
language, and the number-labelled language otherwise):
\begin{center}
\begin{tabular}
{
c c c c c c c
}
&
A
&
B
&
C
&
D
&
E
&
F
\\
1
&
-
&
a
&
a
&
a
&
aa
&
a
\\
2
&
ab
\(^
\star
\)
&
ba
\(^
\star
\)&
ab
\(^
\star
\)&
-
&
ab
\(^
\star
\)&
aa
\\
3
&
&
&
&
&
&
-
\\
\end{tabular}
\end{center}
We prove the first case as an example.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment