regular language Flashcards
(34 cards)
What is a Finite State Machine?
A computational model that can be in one of a finite number of states at any given time. FSMs can have an output (Mealy machines) or no output.
What are the key components of a Finite State Machine?
States (represented as circles), Transitions (represented as arrows), Start state (indicated by an arrow pointing to it), Accept/stop states (represented by double circles), Inputs (labels on arrows), Outputs (if applicable, separated from inputs with a |)
What is a valid stop state in an FSM?
A state represented by a double circle that indicates acceptance of the input string.
What does the Mealy machine refer to in FSMs?
A type of FSM with output where the output values are determined by the current state and the current input.
How can you represent an FSM in diagram form?
Using state transition diagrams where states are circles, transitions are arrows, inputs label the arrows, and double circles represent accept states.
How can you represent an FSM in tabular form?
Using state transition tables that show the current state, input, next state, and output (if applicable).
What is a set?
An unordered collection of values in which each value occurs at most once.
What is set comprehension notation?
A notation that defines a set by stating the properties that its members must satisfy, e.g., A = {x | x ∈ ℕ ∧ x ≥ 1}
What does the empty set represent and what are its symbols?
The empty set is the set with no elements. It is represented by {} or Ø.
What is the difference between finite and infinite sets?
Finite sets contain a countable number of elements up to a particular number, while infinite sets contain an unlimited number of elements.
What is a countably infinite set?
A set that can be counted off by the natural numbers. Examples include the set of integers and the set of natural numbers.
What is the cardinality of a finite set?
The number of elements in the set.
What is the Cartesian product of sets?
The Cartesian product of two sets X and Y, written X × Y, is the set of all ordered pairs (a, b) where a is a member of X and b is a member of Y.
What is a subset?
Set A is a subset of Set B (written A ⊆ B) if all elements of A are also elements of B.
What is a proper subset?
Set A is a proper subset of set B (written A ⊂ B) if A is a subset of B, but A ≠ B (i.e., B contains at least one element not in A).
What is a countable set?
A set with the same cardinality (number of elements) as some subset of natural numbers.
What is set membership?
The relationship between an element and a set that contains it. If x is an element of set A, we write x ∈ A. If not, we write x ∉ A.
What is the union of sets?
The union of sets A and B (written A ∪ B) is the set containing all elements that are in A or B or both.
What is the intersection of sets?
The intersection of sets A and B (written A ∩ B) is the set containing only the elements that are in both A and B.
What is the difference of sets?
The difference of sets A and B (written A \ B or A - B) is defined as the set containing elements that are in A but not in B: A \ B = {x : x ∈ A and x ∉ B}.
What is a regular expression?
A way of describing a set using shorthand notation. Regular expressions allow particular types of languages to be described.
What does the * metacharacter represent in regular expressions?
0 or more repetitions of the preceding element.
What does the + metacharacter represent in regular expressions?
1 or more repetitions of the preceding element.
What does the ? metacharacter represent in regular expressions?
0 or 1 repetition of the preceding element (i.e., the element is optional).