Unit 10 - Computational Thinking Flashcards

1
Q

define 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

define abstraction

A

separating the logical and physical aspects of a problem

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

what is computer science

A

using mathematical principles to solve problems, learning to think computationally and applying the principles of abstraction

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

define abstraction by generalisation

A

the grouping by common charcateristics to arrive at a hierarchical relationship

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

when is abstraction by generalisation usually used

A

OOP - classes and sub-classes

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

define data abstraction

A

involves creating a representation for data that separates the interface from the implementation so a programmer or user only has to understand the interface, the commands to use, and not how the internal structure of the data is represented and/or implemented

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

when is data abstraction commonly used

A

high-level languages

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

define problem abstraction

A

involves removing details until the problem reduces to one which has already been solved

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

when is problem abstraction used

A

you need to use problem abstraction to remove details until the problem can be represented in a way that is possible to solve because it reduces to one that has already been solved. e.g. using a database. timetabling and schedules are very common problems with well-defined solutions.

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

what is modelling and simulation and why is it used

A
  • building a model of a real world object or phenomenon may be used to help solve a particular problem
  • computer scientists have to decide what details are relevant to the problem and discard anything else
  • algorithms and data structures can then be designed to solve a problem
  • the algorithm is then implemented in program code and executed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

define procedural decomposition

A

means breaking a problem into several sub-problems, so that each sub-problem accomplishes an identifiable task. the sub-problems may themselves be further subdivided

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

what is the simple diagram that represents a computational problem

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

define input

A

the information relevant to the problem, which could for example be passed as parameters to a subroutine

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

define output

A

the solution to the problem, which could be passed back from a subroutine

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

advantages of identifying inputs and outputs

A

there is no ambiguity in what must be supplied to the sub-routine

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

what are the two major challenges in producing a solution to a computational problem

A
  1. the algorithm must be correct - it must  work for all possible inputs
  2. the algorithm must be efficient - often, a problem involves huge amounts of data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

define precondition

A

a condition that must be fulfilled before other things can happen or be done

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

advantages of specifying preconditions

A
  1. documentation - the user knows what checks must be carried out before calling the subroutine
  2. no preconditions - user can be confident that necessary checks will be carried out in the subroutine itself, thus saving unnecessary coding
  3. reusable subroutine
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

structure for thinking ahead situations

A

Name:
Inputs:
Outputs:
Preconditions:

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

define caching

A

the temporary storage of data and instructions

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

examples of data that is cached

A

last few instructions of a program to be executed, the result of an earlier computation, or data used may be stored in memory so they can be quickly retrieved

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

define web caching

A

storing HTML pages and images recently looked at

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

advantages of web caching

A
  1. faster access to cached resources
  2. saving on costly use of bandwidth
  3. reduced load on web services in a client-server environment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

disadvantages of caching

A
  1. slower performance if the resource isn’t found in the cache
  2. being given a stale copy of a resource when an up-to-date copy is needed
    • for example, you access a database to get a list of available products, which is then cached
    • you make a few other queries, then a few minutes later you have to make your original query again
    • if the query results have been cached, you may see the same available products… but in fact, they have already been sold in the meantime
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

define prefetching

A

the loading of a resource before it is required - to decrease the time waiting for that resource.

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

examples of prefetching

A

instruction prefetching where a CPU caches data and instruction blocks before they are executed, or a web browser requesting copies of commonly accessed web pages

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

what does prefetching use

A

cache

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

define procedural abstraction

A

using a procedure to carry out a sequence of steps for achieving some task

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

define procedure interface

A

how it is called, what arguments are required, what data type each one is and what order they must be written in

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

define structured programming

A

aims to improve the clarity and quality of a program. it is a method of writing a computer program which uses:
1. modularization for program structure and organisation
2. structured code for the individual modules
3. recursion

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

example of modularization for program structure and organisation

A

breaking the problem down into subroutines

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

define structured code

A

sequence, selection, iteration

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

define recursion

A

when a function calls itself

34
Q

what is the top-down technique/design

A

breaking down a problem into the major tasks to be performed; each of these tasks is then further broken down into seperate subtasks, and so on until each subtask is sufficiently simple to be written as a self-contained module or subroutine

35
Q

how does the hierarchy chart structure work

A
  • each logical process is broken down into smaller components until it cannot be broken down any further
  • execution takes place from left to right, always at lowest level component
  • selection and iteration are not shown in a hierarchy chart
36
Q

advantages of problem decomposition

A
  1. easier to write
  2. simpler to test and maintain
  3. modules are self-contained and well documented with inputs, outputs and preconditions specified so it is easy to change modules without affecting the rest of the program
37
Q

what is a hierarchy chart

A

a tool for representing the structure of a program, showing how the modules relate to each other to form the complete solution

38
Q

benefits of modularisation

A
  1. programs are more easily and quickly written
  2. programs are more reliable and have fewer errors
  3. programs take less time to test and debug
39
Q

how is ‘programs are more easily and quickly written’ a benefit of modularisation

A
  • large programs are broken down into subtasks/subroutines that are easier to program and manage
  • each subroutine (i.e. module) can be individually tested
  • modules can be re-used several times in a program
  • frequently used modules can be saved in a library and used by other programs
  • several programmers can simultaneously work on different modules development time
40
Q

how is ‘programs are more reliable and have fewer errors’ a benefit of modularisation

A

it is easier to find errors in small self-contained modules

41
Q

how is ‘programs take less time to test and debug ‘ a benefit of modularisation

A
  • programs are easier to maintain
  • a well-organised, modular program is easier to follow
  • it is easier to find which module needs to be changed
  • self-contained modules mean that the change should not affect the rest of the program
  • new features may be added by adding new modules
42
Q

examples of good programming practice

A
  • use meaningful identifiers
  • define and document the inputs, outputs and preconditions for each sub-procedure
  • add lost of meaningful comments withing the program
  • at the bottom level, each sub-procedure should perform a single task
  • keep each sub-procedure self-contained by passing parameters and using local variables
43
Q

what features make a good algorithm

A
  • clear and precisely stated steps that produce the correct output for any set of valid inputs
  • should allow for invalid inputs
  • must always terminate
  • execute efficiently, in as few steps as possible
  • designed so that other people will be able to understand and modify it if necessary
44
Q

what are the tools for designing algorithms

A
  • hierarchy charts – useful for identifying the major task, and breaking down into subtasks
  • flowcharts – useful for getting down initial ideas for individual subroutines
  • pseudocode – will easily translate into program code
45
Q

define hand-tracing algorithms

A

using a trace table to write down the contents of each variable as it changes during execution. if the program contains a loop, a helpful technique to put the loop condition as the first column in the trace table, even if the other variables have been defined before it.

46
Q

what is hand-tracing algorithms useful for

A

figuring out how an algorithm works; finding out why an algorithm is not working properly

47
Q

define parallel processing

A

requires multiple processors each executing different instrutions simultaenously, with the goal of speeding up computations. it is impossible on a single processor
- when more than one processor is executing separate instructions at the same time

48
Q

define concurrent processing

A

takes place when several processes are running, with each in turn being given a slice of processor time. this gives the appearance that several tasks are being performed simultaneously, even though only one processor is being used

49
Q

advantages of concurrent processing

A
  1. increased program throughput - the number of tasks completed in a given time is increased
  2. time that would be wasted by the processor waiting for the user to input data or look at the output is used on another task
50
Q

disadvantages of concurrent processing

A
  1. if a large number of users are all trying to run programs, and some of these invove a lot of computation, these programs will take longer to complete
51
Q

advantages of parallel processing

A
  1. parallel processors enable several tasks to be performed simultaneously by different processors. it can speed up processing enormously when repetitive calculations need to be performed on large amounts of data
  2. graphics processors can quickly render a 3-D object by working simultaneously on individual components of the graphic
  3. a browser can display several web pages in seperate windows and one processor may be carrying out a lengthy search or query while processing continues in other windows
52
Q

disadvantages of parallel processing

A
  1. there is an overhead in coordinating the processors and some tasks may run faster with a single processor than the multiple processors
53
Q

define problem recognition

A

the ability to recognise or acknowledge that an issue exists or that a situation needs attention in an existing process or program

54
Q

what is a computable program

A

a problem where there is an algorithm that can solve every instance of it in a finite number of steps. some problems are theoretically computable, but if they take millions of years to solve, they are insolvable in a practical sense

55
Q

what are the 4 methods of problem solving

A
  1. enumeration
  2. simulation
  3. theoretical approach
  4. creative solution
56
Q

define enumeration

A

solving problems by exhaustive search - trying all possible solutions until one correct one is found

57
Q

limiation of enumeration

A

inefficient - the number of possible solutions increases expenentially as the size of the problem increases

58
Q

define simulation

A

the process of designing a model of a real system in order to understand the behaviour of the system, and to evaluate various strategies for its operation

59
Q

examples of simulation

A
  • financial risk analysis
  • population predictions
  • queueing problems
  • climate change problems
  • engineering design problems
60
Q

how does simulating a system work

A

makes use of abstraction to reduce the problem to its essentails, removing all unnecessary details. it can also involve building a physical model so that its behaviour can be studied - useful hwn it would be too expensive, dangerous or impractical to carry out tests on the real thing. a model can be used to evaluate performance or test outcomes

61
Q

what are the three strategies for problem solving

A
  1. divide and conquer
  2. problem abstraction
  3. automation
62
Q

what is the ‘divide and conquer’ technique

A

reduces the size of the problem with every iteration

63
Q

what is problem abstraction

A

involves removing details until the problem is represented in a way that it is possible to solve because it reduces to one that has already been solved

64
Q

what is automation

A

deals with building and putting into action models to solve problems

65
Q

what are the 5 solutions you can apply to a problem

A
  1. visualisation
  2. backtracking
  3. data mining
  4. heuristics
  5. performance modelling
  6. pipelining
66
Q

what is visualisation

A

using an image to display the problem rather than a written description

67
Q

what is backtracking

A

a methodical way of trying out different sequences until you find one that leads to the solution

68
Q

what is data mining

A

the process of collecting and then analysing huge amounts of data. many organisations collect billions of bytes of data about people. they can then analyse or ‘mine’ the data to find connections and associations. a range of modelling techniques are used to help to identify patterns in data.

69
Q

applications of data mining

A
  • increasing response to marketing campaigns by being able to target them more accurately to the needs of the customer
  • anticipating resource demands
  • deleting fraud and cybersecurity crimes
  • finding connections between unconnected events
70
Q

define ‘big data’

A

it implies that huge amounts of data are collected and stored.

71
Q

what is ‘big data’ defined by

A

it is defined by three major features, known as the 3Vs: Volume, Variety and Velocity

72
Q

what type of computing is important when collecting ‘big data’

A

parallel computing

73
Q

what is an intractable problem

A

although an algorithm may exist for their solution, it would take an unreasonably long to find the solution

74
Q

what are heuristic methods

A

a heuristic method is used to rapidly find a solution that is ‘good enough’, even though it might not be the optimal solution

75
Q

applications of heuristic methods

A
  • routing messages across the Internet
  • building circuit boards
  • transportation
  • virus checking
  • DNA analysis
  • artificial intelligence
76
Q

what is performance modelling

A

the process of simulating different user and system loads on a computer using a mathematical approximation

77
Q

disadvantage of performance modelling

A

expensive compared to performance testing

78
Q

advantage of performance modelling

A

the output may then be used to help with planning a new system which is suited to the requirements of the organisation

79
Q

what is big-O notation

A

this measures the suitability of algorithms in terms of execution time and space

80
Q

what is pipelining

A

an implementation technique where tasks are split into smaller parts and then the processing of each task is overlapped. instructions enter the ‘pipeline’ at one end, and at each stage part of the instruction is completed and moves to the next stage while another instruction enters the pipeline – rather like an assembly line