Section 9 - Regular Languages Flashcards

1
Q

what’s a Mealy machine

A

a finite stat machine with input

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

What is the cardinality of a set

A

the number of elements in a set

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

What is a Countable set

A

A set which can be counted off against a subset of the natural numbers, ie all the natural numbers up to a fixed limit.

A countably infinite set is one which can be counted off against the Natural numbers without ever stopping.

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

What is the difference between a subset and a proper subset

A
  • subset. {0, 1 , 2 } ⊆ {0, 1, 2, 3 } where ⊆ means subset of. ⊆
    includes both ⊂ and =, for example {0, 1, 2, 3 } ⊆ {0, 1, 2, 3 } is also true, because {0, 1, 2, 3 } = {0, 1, 2, 3 }.
  • proper subset. {0, 1 , 2 } ⊂ N where ⊂ means proper subset of, that is N contains everything in {0, 1, 2 } but there is at least one element in N that is not in {0, 1, 2 }.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the symbol for set difference and what does it mean?

A

The set difference A\B (or alternatively A-B) is defined by A\B = {x : x ∈ A and x ∉ B}.

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

What are the metacharacters for Regex that you should know

A
    • (0 or more repetitions)
    • (1 or more repetitions)
  • ? (0 or 1 repetitions, ie optional)
  • | (alternation, ie or)
  • ( ) to group regular expressions. Any other metacharacters
    used in an exam question will be explained as part of the question.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s the relationship between regular expressions and FSMs. Regular expressions and FSMs are equivalent ways of defining a regular language.

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

What makes a regular language “regular”

A

Know that a language is called regular if it can be represented by a regular expression. Also, a regular language is any language that a FSM will accept.

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

For a FSM what does accept and start state look like

A

there’s only one start state is when there’s an arrow pointing to the circle

there can be multiple accept state, they are drawn with double circles

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

what’s the syntax for a transition function for a Turing machine

A

δ(Currrent State, Input symbol) = (Next State, Outputsymbol, Movement)

eg δ(S1, 0) = (S2, 1, L)

if the machine is currently in state S1 and the input of the symbol read from the tape is 0,
then change the state to S2, write a 1 to the tape, and move left.

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

What’s a meta-language

A

a language that describes the syntax of languages. eg BNF

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

Syntax for Backus-Naur Form

A

LHS ::= RHS, where ::= means ‘is defined by’

::= is also known as a meta-symbol
,another import meta-symbol is | which means or

<point> ::=
<point> is a meta-component, or syntactic variable, they are distinguished by enclosing brackets.
</point></point>

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