4.4.2 Regular Languages 4.4.3 Context-free languages Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a Finite State Machine?

A

A Finite State Machine does not have output it is an abstract representation used in designing computer systems and logic circuits

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

What is a State Transition Diagram?

A

Uses circles to represent the states that a system may be in and arrows to represent the transitions between states

1) Start state
2) Accept State

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

What is a mealy machine?

A

A mealy machine is a type of FSM with an output that are determined by both its current state and the current input

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

What is a State transition table?

A

A State transition table is an alternative way of representing an FSM in a tabular form

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

What is a Set?

A

1) A set is an unordered collection of values or symbols in which each value or symbol occurs at most once

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

How do you represent a set?

A

A = {1, 2, 3, 4, 5}

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

How do you represent an empty set?

A

1) {} (Curly Braces)

2) Ø

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

Use Set comprehension to define this set

A = {x | x ∈ ℕ ∧ x ≥ 1 }

A

1) A is equal to x such that x is a member of the natural numbers and x is bigger than or equal to 1

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

What is a finite set?

A

A set whose elements can be counted off by natural numbers up to a particular number

E.g. 10 is the 6th number in set a
A = {1,2,4,6,8,10}

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

What is the cardinality of a finite set?

A

The number of elements in the set

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

What is a countably infinite set?

A

A set that can be counted off by the natural numbers

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

What is a Cartesian product of sets?

A

1) Written as X and Y and X cross Y is the set of all ordered pairs (a,b) where a is a member of A and b is a member of B

2) E.g. A = {1,3,5} B = {12,25,40}
C = {(1,12), (1,25), (1,40), (3,12), (3,25), (3,40) , (5,12), (5,25), (5,40)

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

What is an infinite set?

A

1) Can be countable or uncountable and is not finite

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

What is a subset?

A

1) A subset is where every member of one set is also a member of another set
2) A ⊆ B = Every member of set A is also a member of set B

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

What is a proper subset?

A

A proper subset is when a set is a subset of another set but is not equal to another set

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

What is a countable set?

A

A countable set is a set with the same cardinality (number of elements) as some subsets of natural numbers

17
Q

What is membership?

A

The property of an element being within a set

18
Q

What is Union?

A

A∪B is the set of things that belong to either A,A or B,b

19
Q

What is Intersection?

A

A∩B The set of things that belong to both A,A and B,B

20
Q

What is difference?

A

List of elements that are in set A but not in Set B denoted by

  • A - B
  • A / B
21
Q

What is a Regular Expression?

A

1) A way of describing a set
2) Allows types of languages to be described in a convenient shorthand notation
3) E.g. a(aIb) * = {a, aa, ab, aaa, aab, aba, ….}

22
Q

What is the relationship between the regular expressions and the FSM’s?

A

They are equivalent ways of defining a regular language

23
Q

What does this metacharacter indicate?

ab*

A

1) Indicates that there are zero or more of the preceding element
2) In this case zero or more b’s
3) ab, ab , abb, abbb

24
Q

What does this metacharacter indicate?

a+b

A

1) Indicates that there are one or more of the preceding element
2) ab, aab, aaab

25
Q

What does this metacharacter indicate?

Dialog(ue)?

A

1) Indicates zero or one of the preceding element

2) Dialog, Dialogue

26
Q

What does this metacharacter indicate?

DId)is(cIk

A

1) Indicates scope and precedence of the operators

2 ‘Disc’, ‘disc’, ‘Disk’ and ‘disk’

27
Q

What does this metacharacter indicate?

Edward)I(Eddie)I(Ed

A

1) Boolean OR a vertical bar separates alternatives

2) Edward, Eddie, Ed

28
Q

What can a language be called if it can represent a regular expression?

A

A regular language

29
Q

What is a regular language?

A

Any language that a FSM can accept

30
Q

What is the structure of Backus- Naur form (BNF)

A

1) LHS ::= RHS
2) ::== ‘is defined by’
3)
4) E.g. ::= 0I1I2I3I4I5I6I7I8I9

31
Q

What is Parsing?

A

1) Determining whether a given statement is valid given the BNF definition