Lecture 4+5 Flashcards

1
Q

What is an alphabet and what is a string?

A

An alphabet is any finite set. The alphabet is typically denoted Σ(sigma). A string is any finite sequence of symbols produced from an alphabet. A string could be denoted f : n → Σ.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are some special symbols to do with strings

A

Σ* the set of all strings over an alphabet, λ, the empty string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the fundamental string operation and how can strings be made easily?

A

Concatenation, in which case one string is added to the end of another. A string can be easily made using recursion.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a language? What is a common proof technique for these?

A

A language is the subset of all the possible strings over an alphabet. A common proof technique would be induction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a regular expression and what type of language is it?

A

a regular expression is a type of regular language with the rules that:
start with the languages:empty alphabet, empty string and then one language for each symbol in the alphabet.
New languages are then formed with the rules:
L ∪ K (union)
• LK = {xy|x ∈ L, y ∈ K} (concatenation)
• L∗concatenation of 0 or more elements of L. Or: λ ∈ L∗
, and if w ∈ L∗ and u ∈ L, then wu ∈ L∗
.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a rule?

A

an expression in the form A -> w where A is a nonterminal value which will be replaced with w(a set of possible strings) when A appears in a sequence.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a context free grammar?

A

Some set of rules over a fixed set of non terminal and terminal symbols. Must come with a single distinguished nonterminal symbol called the start symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a derivation tree?

A

A way of visualising context free grammars, the start symbol S is the root of the tree and the terminal symbols chosen become the children of the node. The tree can be read from left to right.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a regular grammar?

A

A regular grammar is a context free grammar in which every rule is one of three forms: A-> a, A -> aB, A -> λ.
Any context free grammar that follows these rules will be a regular language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly