LANGUAGES Flashcards

1
Q

What is ∑?

A

Alphabet

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

What is an alphabet?

A

A specified FINITE set identified as ∑
e.g. ∑1 = {0,1,2,3,4,5,6,7,8,9} is a 10 element set of decimal digits,

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

What is an element?

A

The symbols inside of an alphabet

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

What is a string?

A

String of length n over alphabet ∑ is just an ordered n-tuple of elements of ∑ without punctuation.

e.g. ∑ = {a,b,c} then a, aa, aaab, are all strings of ∑

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

Can a string be empty?

A

YES

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

What is the identifier for empty string?

A

ε - null/empty set

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

What is ∑*?

A

Known as kleene’s star, this symbolises a set of all strings of ∑
∑* are INFINITE even if ∑ is finite
e.g. if ∑ = {a,b,c} then a, ab, aaa, bbac ∈ ∑*

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

What is an example of what ∑* is if ∑ = {a}?

A

∑* = {ε, a, aa, aaa, aaaa, aaaaaa, aaaaaa …}

Include the empty string!

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

What is ∑* if ∑ = {} (empty set}?

A

∑* = {ε}

(empty string)

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

How does concatenation of strings occur?

A

Join end-to-end where u, v ∈ ∑*

e.g. if u = ab, v = ra and w = cad,
then uvwuv = abracadabra

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

How to find the length of a concatenated string?

A

length(uv) = length(u) + length(v)

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

How would you concatenate to ε?

A

uε = u = εu

ε is a UNIT for string concatenation so will always return non ε value.

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

How does bracketing affect concatenation?

A

It has no effect!

u(vw) = (uv)w = uvw

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

What is a language?

A

Language (or formal language) over ∑ is a SET of strings in ∑*
- notated by L
- any L ⊆ ∑* determines a language over ∑
e.g. ∑ = {a,b} L could be {a,b,ab,aa,bb}

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

What is a regular expression?

A

Provides a way to formally define a language by identifying what doesn’t belong in a language.
Built using finitely many applications of rules

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

What are the syntax rules for regular expressions?

A

every symbol of a ∈ ∑ is a regular expression
every string ε is a regular expression
every set Ø is a regular expression

if r and s are regular expressions:
- r / s is a regular expression
- rs is a regular expression
- r* is a regular expression

17
Q

What are the string rules for regular expressions?

A

Assuming u is a string,
u matches a ∈ ∑ iff u = a
u matches ε iff u = ε
u does NOT match Ø
u matches r / s iff u matches r OR u matches r (choice)
u matches rs iff u = wv where w matches r and v matches s
u matches r* iff u matches ε OR u = u, uu, uuu, uuuu …H

18
Q

How to solve if strings are part of regular expressions?

A
  • break down the expression
  • if no choices match then must equal no
19
Q

How to write a language determined by a regular expression?

A

L(r) = {u ∈ ∑* | u matches r}

example: r = a | a(bb|bbb) |ba* ∑= {a,b}
then L(r) = {a, abb, abbb, b, ba, baa}