4.4 Theory of computation Flashcards
What is representational abstraction?
Removing uneccesary details from a problem
What is abstraction by generalisation?
Grouping things in terms of common characteristics
What is Data abstraction?
Seperating the way a compound data structure is used to how it is constructed
What is problem reduction?
Reducing a problem into one that has already been solved
What does the metacharcter ‘?’ denote in a regular expression
one or none
A?B = {AB, B}
What does the metacharcter ‘*’ denote in a regular expression
Zero or more
A* = { ,A,AA,AAA,AAAA….}
What does the metacharcter ‘+’ denote in a regular expression
One or more
A+ = {A,AA,AAA,AAAA…}
What do parenthases ( ) denote in a regular expression
A group
(AB)?A = {A,AB}
What does the metacharcter ‘|’ denote in a regular expression
OR
(Everything on the left, OR everything on the right)
A|B = {A,B}
Exam style question
Describe the set of strings matched by the regular expression:
a?(a|b)*aba+a
zero or one instances of ‘a’
zero or more instances of either ‘a’ or ‘b’
‘a’ followed by ‘b’
one or more instances of ‘a’
a single character ‘a’