4.4 Theory of Computation Flashcards
What is a set in the context of regex
an unordered collection of values in which each value occurs at most once.
A language is regular if it can be represented by
- A regular expression
- A Finite State Machine
If there is no symbol between symbols what does that mean
Members side by side must appear in that sequence
What does the pipe symbol mean|
Separates alternative options
What does the symbol * mean in context of regex
Indicates that there are zero or more of the preceding element
What does the symbol + mean in the context of regex
Indicates that there is one or more of the preceding elements
What does the symbol ? mean in the context of regex
Indicates that there are zero or one of the preceding element.
What does () symbol mean in the context of regex
Used to identify groupings
An 01 pair repeated any number of times
How is it represented in regex
(01)*
In the context of set comprehension
A = { x | x ∈ N ^ x != 0 }
define the variables
A represents the set
{}: This denotes a set. Sets are collections of distinct elements.
x: A variable that represents the elements of the set.
∣: The vertical bar is read as “such that” or “where”. separates the variable from the condition that the elements must satisfy.
natural numbers (N)
∈ = “is an element of”
What is a turing machine
A computer with a single fixed program expressed using:
A finite set of states in a state transition diagram.
A finite alphabet of symbols.
An infinite tape with marked off squares.
A sensing read-write head that can travel along the tape, one square at a time.
A⊆B
A is a subset of B
A⊂B
A is a proper subset of B
Difference between subset and proper subset
A is a proper subset of B if every element in A is also in B, but B has at least one extra element not in A
A normal subset does’nt have to satisfy this last condition.
What is the cartesian product
The cartesian product of two sets A and B is the set of all ordered pairs (a,b)
Let’s say A = {1, 2} and B = {x, y}.
The Cartesian product of A and B would be {(1, x), (1, y), (2, x), (2, y)}.