Unit 2 - Problem Solving Flashcards

1
Q

What is computational thinking?

A

The ability to think logically about a problem and apply techniques for solving it

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

What are the 5 main ways to solve a problem?

A
  1. Enumeration (list all cases)
  2. Simulation
  3. Theoretical approach
  4. Creative approach
  5. Trial and error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does simulation involve?

A

Designing a model for a system in order to understand its behaviour and then testing it to observe how the system responds to different situation

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

What does enumeration involve?

A

Running every possible solution until there is one that works

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

What does the decrease and conquer approach to algorithm design involve?

A

Breaking down a problem into smaller sub-problems which can be tackled individually and then applied to the greater problem

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

What is an algorithm?

A

A sequence of steps that can be followed to complete a task and always terminates

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

What does a good algorithm need to do?

A
  1. Have a clear set of steps which produces a successful outcome for any set of inputs
  2. Allows for invalid inputs
  3. Terminate
  4. Efficiently achieve the outcome in as few steps as possible
  5. Be designed in a way that it can be understood and edited by others
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What do hierarchy charts do?

A

Break down a bigger problem into smaller subtasks, a visual representation of decomposition

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

What does an insertion sort entail?

A

Removing an item and replacing it in the correct position within the set

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

What type of sets is an insertion sort suited to?

A

Small sets

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

When is bubble sort used?

A

When there is a small set of values

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

What does a bubble sort entail?

A

Iterating through the set n-1 times and comparing a value to the ones which are next to it, if they need to switch a switch is carried out

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

What does a linear search entail?

A

Iterating through the items in the list and comparing them to the desired item, if they match then this item is returned

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

What does a binary search entail?

A

Splitting the set in two and then checking to see if the desired item is higher or lower, if it is lower the higher section of the set can be discarded and vice versa. This is repeated until the desired item is attained

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

Why do we test?

A

To reveal errors and prove that a system does not work

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

Define module testing

A

Ensuring a subprogram works correctly

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

Define program testing

A

Ensuring that each program within the system works in isolation

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

Define system testing

A

Ensuring that the whole system works and does what is required of it according to the specification

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

Why do programmers use testing plans?

A

To keep track of the result of tests and what parts of the system are/aren’t working

20
Q

Define normal data

A

Data which the system should accept without any issue

21
Q

Define boundary data

A

Data which is acceptable but sits either end of the range

22
Q

Define erroneous data

A

Data which the system should not accept

23
Q

How can trace table be useful to test an algorithm?

A

By tracing an algorithm you can test the predicted or actual outcome of the system at different stages during the program without implementation

24
Q

Define abstraction

A

Identifying the difference between information that is relevant to the problem and that which is not and discarding what is not relevant

25
Define information hiding
The process of hiding all details of an object that do not contribute to its essential characteristics
26
Give an example of information hiding
The London Underground Map
27
What is the link between high level languages and abstraction?
High level languages employ abstraction by ensuring that programmers only need to focus on what the computer is doing rather than how it is doing it, this contrasts with machine code
28
Define decomposition
Breaking down a problem into smaller sub-problems so that each sub-problem can be solved to accomplish an identifiable task
29
Define composition
Combining procedures which accomplish individual tasks to form a compound system which accomplishes the overall task
30
What is a finite state machine?
An abstract representation of how a system changes from one state to another in response to an external stimuli
31
What are the three main rules regarding finite state machines?
1. They can only be in one state at a time 2. It switches between states in response to an event of condition (this is called a transition) 3. A finite state machine is defined by a list of states and conditions for each transition
32
Define representational abstraction
The process of removing unnecessary details so that only information that is required to solve the problem remains and the problem is in a state that can be solved
33
Define abstraction by generalisation
The concept of reducing problems by putting similar aspects of a problem into hierarchical categories
34
Define problem solving
The process of finding a solution to real-life problems
35
Define automation
Creating a computer model of a real-life situation and putting it into action
36
Define logical reasoning
The process of using a given set of facts to determine whether new facts are true or false
37
What does hand-tracing/dry running mean?
To follow a program through line by line to determine what is happening and identify problems before it is run
38
Give an example of abstraction by generalisation
Top down diagrams
39
Define top down diagram
Related to the modular approach to problem solving and is a diagram that starts with the main system at the top and breaks it down into smaller and smaller units
40
Define procedural abstraction
The concept that all solutions can be broken down into a series of procedures that can be executed one by one
41
Define functional abstraction
Breaking down a complex problem into a series of reusable functions
42
Define data abstraction
Hiding how data is represented so that it is easier to build a new kind of data object
43
Why is data abstraction beneficial for programmers?
Programmers can utilise the functions of data types without needing to know how they work
44
Define data composition
The process of combining data objects to create a compound structure
45
Define problem abstraction
Removing unnecessary details from a problem until the underlying problem is one that has already been solved
46
How are encapsulation and information hiding linked?
Encapsulation involves grouping data and methods together in classes which means hiding irrelevant information from other parts of the program