theory of computation
2024 Exam Practice Test
what is an algorithm? - Answer>>-An algorithm is a sequence
of steps that can be followed to complete a task.
-An algorithm always terminates rather than going on forever in a
loop.
describe abstraction in a representational way and general way? -
Answer>>- representational abstraction is removing unecessary
details from a problem
- A grouping by common characteristics to arrive at a hierarchical
relationship of the "is a kind of" type.
describe information hiding and procedural abstraction -
Answer>>- Information hiding is defined as the process of
hiding all details of an object that do not contribute to its essential
characteristics. For example, if you're designing a program that
works out how many cars can fit onto a ferry, information about
the manufacturer or the colour of a car can be disregarded and
just information about the size and weight of cars retained.
- Procedural abstraction involves breaking down a complex model
into a series of reusable procedures. The actual values used in a
computation are abstracted away and a computational method is
achieved.
what is functional abstraction? / Data abstraction / problem
abstraction - Answer>>- Procedural abstraction results in a
procedure. Abstracting further disregards the particular method of
, a procedure and results in just a function. For example:
Abstracting the procedure from the previous example leaves us
with a function: RectangleArea = CalculateArea()
- In data abstraction, specific details of how data is actually
represented are abstracted away, allowing new kinds of data
structures to be created from previously defined data structures.
Data abstraction forms the basis of abstract data types
- in problem abstraction details are removed from a problem until
it is represented in a way that is solvable. This works because a
simplified problem is often similar to a problem that has already
been solved, meaning that a solution for the problem can be
found
Define composition and decomposition - Answer>>-
composition: When dealing with a complex problem, composition
can be used to combine procedures to form a larger system
- dcomposition: a problem is divided into a series of smaller sub-
problems. These smaller problems can be solved individually or
further divided until all parts of the original problem have been
solved
Define automation - Answer>>- putting abstractions of real
world phenomena (models)
into action to solve problems
automation is achieved by:
- creating algorithms which are later implemented in code
- implementing models in data structures
- finally executing code