Theory of Computation Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Computational Thinking (definition)

A

Stating a problem in a way that can be solved using algorithms, and then constructing an algorithm to solve the problem in the most effective way

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Other name for computing

A

Automation of abstractions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Representational abstraction (definition)

A

Removing excess details to represent a problem by only its key features

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Data abstraction (definition + example)

A

Hiding details about how data is being stored
e.g. programmers can use data structures without knowing how they are implemented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Abstraction by generalisation (definition)

A

Grouping similarities in a problem to categorise it by a type, to then use a common solution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Layers of abstraction (explanation + example)

A

Highest levels are closest to the user e.g. interface
Lowest levels are closest to reality e.g. interacting with machine components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Procedural abstraction (definition + example)

A

Abstracting the values used in a computation (set of operations) to create a procedure e.g. using a subroutine without understanding the internal process of it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Functional abstraction (definition)

A

Abstracting the computation method (operations) so that only the inputs and outputs are considered, creating a function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Problem reduction/abstraction (definition)

A

Removing details from a problem until it can be represented in a way that is possible to solve, because it has been reduced to one that has already been solved

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is procedural abstraction needed? (explanation + examples)

A

Allows non-experts to hide information that is too complex or irrelevant for the systems purpose

e.g. 1: High level languages abstract machine code, making them easier to learn

e.g. 2: TCP/IP separates application, transport, internet and link so that each layer acts independently from the others

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Advantage and disadvantage of abstraction

A

+ allows models and predictions to be made
- too much abstraction will make a model untrue of real life

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The simplest abstraction of a computer

A

program
\/
Input > process > output
\/
storage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Algorithm (definition)

A

Set of step-by-step instructions to solve a problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is abstraction needed? (explanation + example)

A

Removing unnecessary details and highlighting the most important ones improves clarity and makes the representation more useful for a function

e.g. flowchart is an abstraction of code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Graph data structure (explanation)

A

Abstraction to the point where only the necessary data elements and relationships between them are shown (the nodes and connections)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why is thinking ahead important?

A

Maximise code efficiency and minimise errors

17
Q

What techniques would be considered “thinking ahead”?

A
  1. Identifying inputs and outputs
  2. Determining preconditions
  3. Deciding what can be a reusable component
  4. Caching
18
Q

Precondition (definition + example)

A

Something that must always be true in a solution to a problem e.g. must be below budget

19
Q

Reusable component (definition + examples)

A

Taking self-contained pre-tested code from another program and applying it the the current program

e.g. 1: subroutines
e.g. 2: libraries

20
Q

Benefits of reusing components

A
  1. shortens development time
  2. lowers development costs
  3. reduces the amount of redundant code
21
Q

Application Programming Interface (definition + examples)

A

Set of functions allowing an app to access the features/data of another program e.g. the OS

e.g. Apple/Google password save

22
Q

Caching (definition + explanation)

A

Temporary storage of recently/frequently used instructions/data by the OS into cache
Results in faster retrieval times as less data needs to be fetched from secondary storage

23
Q

Web caching (definition)

A

Storing of HTML pages which have been recently looked at to avoid using up bandwidth if they are loaded again

24
Q

Prefetching (definition + explanation)

A

Data is requested from main memory before it is required
This reduces fetching time as it is faster to fetch from registers than from main memory

25
Q

How is prefetching managed?

A

Prefetching is managed by algorithms which predict with high accuracy that instructions/data will be needed soon

26
Q

Potential disadvantage of caching

A

Wrong data is fetched frequently and has to be removed, making it difficult to keep up with the correct sequence of instructions/data

27
Q

Top-down design/stepwise refinement (definition)

A

Technique for breaking down a problem into major tasks, then further breaking these down into subtasks, until each subtask is simple enough to be a self-contained module

28
Q

Advantages of decomposition

A
  • Makes programming easier
  • Makes code easier to test and maintain
  • Some components may be reusable
  • Specialists within a team can be designated the tasks most relevant to their speciality
29
Q

Hierarchy chart (definition)

A

Visual tool for representing the structure of a program, showing how “levels” of modules relate to form the solution - each module is no more than a page of code

30
Q

Problem recognition (definition)

A

Identifying where and what a problem is

31
Q

Why is procedural thinking important?

A

Some segments are event-driven so the order in which a user behaves can be largely unpredictable

Code reuse/ libraries / validation and sanitation techniques can be applied

Consider which variables are local/global

32
Q

Key aspects of procedural thinking

A
  • Order of steps to a solution
  • Identifying components of a problem
  • Identifying solution functions/procedures for each problem component
33
Q

How can abstract thinking be defined + summarized?

A

Removing unnecessary details and including only relevant details

34
Q

How can thinking ahead be defined + summarized?

A

Identifying inputs, outputs, preconditions and reusable components of a system

35
Q

How can thinking procedurally be defined + summarized?

A

Breaking a large complex problem down into simple subtasks

36
Q

How can thinking logically be defined + summarized?

A

Identifying where decisions (selection) will be made, including conditions and outcome

37
Q

Three fundamental parts of a program

A

Selection - making a choice
Sequence - following instructions in an order
Iteration - repeating until a condition has been met