Theory of Computation Flashcards
Paper 1
What is Abstraction?
Abstraction is the name given to the process of omitting unnecessary details from a problem.
Representational abstraction
A representation of a problem arrived at by removing unnecessary details from the problem.
Abstraction by generalisation /
categorisation
Grouping by common characteristics to form a hierarchical relationships
e.g. “is a kind of”
What is information hiding
Hiding all non-essential details of an object that doesn’t affect its essential characteristics.
What is procedure abstraction?
Breaking down a problem into reuseable procedures, abstraction specific values.
What is functional abstraction?
Hiding the specific computation method and only focusing on the input/output of the function
What is data abstraction?
Hiding details of data representation, allowing creation of new abstract data types.
What is problem abstraction/reduction?
Simplifying a problem by removing details until it’s similar to a previously solved problem.
What is decomposition?
Dividing a complex problem into smaller, more manageable sub-problems.
What is composition?
Combining simple procedures or data types to build more complex ones (e.g. tree structure).
What is automation in computer science?
Executing abstract models using algorithms, program code, and data structures.
What are the main steps to achieve automation?
- Create models
- Design algorithms
- Implement in code
- Use data structures
- Execute the code
What are the four constructs used in pseudocode?
Sequence, Assignment, Selection, Iteration
What does sequence mean in pseudocode?
Instructions are carried out one after the other, in order.
What is assignment in pseudocode?
Giving a value to a variable (e.g. x ← 5).
What is selection in pseudocode?
Choosing between actions based on conditions (IF, ELSE, etc.).
What is iteration in pseudocode?
Repeating actions using FOR or WHILE loops.
What is hand-tracing an algorithm?
Manually running through an algorithm step-by-step with test data to verify correctness.
How do you argue for the correctness of a program?
Use logical reasoning, test data, and user feedback.
What is a Finite State Machine (FSM)?
A computational model with a finite number of states, transitions between states based on inputs, and optional outputs (Mealy machines).
What is the difference between an FSM with and without output?
- Without output: Only tracks state transitions.
- With output (Mealy): Produces an output on each transition (e.g., 1 | “a”).
How do you represent an FSM?
Using a state transition diagram (circles for states, arrows for transitions) or a state transition table.
What happens if an FSM reaches a non-final state with no valid transitions?
The input is rejected.
What is a set?
An unordered collection of unique elements (e.g., {1, 2, 3}).