Computational thinking Flashcards

(51 cards)

1
Q

what is computational thinking?

A

the ability to think logically about a problem and applying techniques for solving it

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

what are the components of computational thinking?

A
  • abstraction
  • decomposition
  • pattern recognition
  • algorithm design
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is abstraction?

A

a way of separating the logical and physical aspects of a problem - you remove excessive details about the problem until you reach a representation of the problem with only key features

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

what is involved in abstraction?

A
  • designing a model that represents reality (simple queue to climate change)
  • certain characteristics of objects/systems are removed so that it is reduced to a simple set of characteristics
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how does modelling and simulations relate to abstraction?

A
  • building models of real world phenomena help solve problems by discarding irrelevant details
  • then design algorithms + data structures the implement it in program code and execute it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is representational abstraction?

A

creating a simpler version of something real by leaving out unnecessary detail and keeping only what is useful - eg. the London Underground Map

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

what is abstraction by generalisation?

A

grouping things together based on their shared characteristics - important in OOP eg. when you create instances of a class with different details in each

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

what is procedural abstraction?

A

creating a procedure or subroutine to do a task without having to think about the internal workings every time you use it - focus on functionality rather than logic + easily reusable
eg. find the surface area of an object instead of a specific chopping board

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

what is functional abstraction?

A

the details of how a computation is carried out is hidden (a black box) - input given, processed, output returned - user only needs to know how to call a function - enhances flexibility of code

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

what is data abstraction?

A
  • technique to separate the way a compound object is used from the details of how it is constructed
  • eg. stack - dont worry about how it is implemented so long as it works
  • allows creation of abstract data types
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is problem reduction?

A

generalising or reducing a problem to one that has already been solved - break complex problems into smaller manageable problems
solve with standard algorithms or specialised ones

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

what are the 2 main challenges in producing a solution?

A
  • correct algorithm - must work for all possible inputs
  • efficient algorithm - must not waste compute power since it often handles lots of data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is thinking ahead?

A
  • take the initial abstract model and add detail to it until it has been transformed into a computer program
  • think ahead about components of a program and how they will be handled in the best way possible
  • allows developers to consider problems or difficulties that may arise
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is an input to a problem?

A

any data required to solve the problem - inputted by the user

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

what is an output to a problem?

A

the results passed back once inputs have been processed and the problem has been solved - must be of a suitable data type, structure and method depending on the situation

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

how do designers try to make solutions using inputs and outputs?

A
  • first think about outputs required based on user requirements
  • then identify inputs required + processing needed on them to get outputs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

why is formally documenting inputs and outputs good?

A

there is no ambiguity in what must be supplied to the subroutine + what must be returned

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

what are preconditions?

A

requirements defined by the problem that must be met before a program can be executed - prevents execution failure/invalid answers

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

what are the advantages of specifying preconditions in documentation?

A
  • makes program components reusable
  • cuts out unnecessary checks - programmers know what checks need to be done
  • shorter + less complex program
  • saves time on debugging + maintenance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

what is the purpose of preconditions?

A

ensure necessary checks are carried out before execution of a subroutine (by user or subroutine) - makes them more reusable

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

what are reusable programming components?

A
  • well defined + documented functions + procedures that can be used in different programs
  • can be added to a library + imported wherever needed
22
Q

why are reusable program components useful?

A
  • saves time writing + testing functions that have already been written, debugged and tested (large project)
  • following programming standards makes them easier to use for other programmers
23
Q

what are some typical standards for reusable modules?

A
  • inputs, outputs, preconditions documented
  • standard convention for variable names
  • all variables should be local to the module
  • standard format for documentation - what module does, who wrote it + when
  • explanations of code where needed
  • no module should be greater than 1 page of code
24
Q

what is caching?

A

temporarily storing instructions/values in cache memory after use in case they are needed again and can be accessed quickly - eg. last few instructions executed, result of earlier computation

25
what is webcaching?
webpages and their contents recently looked at are stored in cache - content can be loaded without delay + text + images dont need to be downloaded multiple times, freeing bandwidth
26
what is prefetching?
algorithms predict which instructions are likely to be fetched soon - loaded + stored in cache before being fetched - less time spent waiting for instructions to be loaded from hard disk to RAM
27
what are the advantages of caching?
- faster access to cached resources - save on costly bandwidth use - reduced load on web services in a client server env
28
what are the disadvantages of caching?
- there is no guarantee the predicted data will be used - valuable space taken up unnecessarily - larger caches take a while to search - cache size limits need to be in place to maintain speed - can get a stale copy of resource if there have been changes made after its loaded into cache - can be difficult to implement
29
what is thinking procedurally?
breaking down a problem into smaller parts which are easier to understand so easier to design
30
what is procedural decomposition?
breaking a large complex problem into a number of subproblems so that each subproblem completes an identifiable easily solvable task.
31
why is procedural decomposition useful?
- makes the problem more feasible to manage - can be divided between a group of people based on each person's skillset
32
what is stepwise refinement?
the process of breaking down a programming problem into a series of steps - used in structured programming
33
what is a hierarchy chart?
- a diagram used to show how a large problem is broken down into smaller subproblems organised levels - higher levels = problem overview - lower levels = detailed components of the problem
34
why are hierarchy charts useful?
- problems are fully decomposed - simpler design, programming + testing - well-documented subroutines with preconditions can be easily tested + updated - shows how subroutines are related
35
what are the main techniques used in structured programming?
- modularisation - program structure + organisation (eg. break down into subroutines) - structured code - for individual modules use sequence, selection, iteration - recursion - procedure/rule is repeated
36
is the order of steps in a solution important?
YES! The order which subroutines are executed and how they interact with each other matters eg. in a game the user shouldnt be able to play a level they havent unlocked yet
37
what are some benefits of modularisation?
- easier/quicker to write, test + debug programs - each subroutine can be individually tested - modules can be reused within the program - save frequently used modules in a library - several programmers can work simultaneously on different modules -> less development time - new features can be added by adding new modules - easier to maintain programs
38
what are the features of a good algorithm?
- has clear + precisely stated steps that produce correct output for all valid inputs - should allow for invalid inputs - must always terminate at some point - should have as few steps as possible - efficient - should be designed so that other people can understand it + modify if necessary
39
what are some common tools used to design algorithms?
- hierarchy charts - identify major tasks + breaking down into subtasks - flowcharts - get down initial ideas for individual subroutines - pseudocode - easily translates into program code
40
what sorts of decisions need to be made when building a program?
- which programming paradigm? - which programming language? - what input devices? - what output devices? - how will i interact with these devices?
41
what is a decision?
a result reached after some consideration
42
how are decisions represented in a flowchart?
diamond shaped icon - with an arrow for yes and an arrow for no
43
what factors affect your decision making process?
- what is most effective? - what is most convenient? - is this option reasonable/feasible?
44
what is a decision point?
the specific points where a program must make a choice or decision regarding the flow of execution - normally an if statement, for loop, while loop
45
what is a validation routine?
a routine that checks whether a user has entered a value fit for processing - can involve tricky boolean conditions
46
what validation routine questions are used to check whether a password is correct?
- what happens if the user enters an incorrect password? - how many tries are allowed? - will there be a way of giving them a hint? - will there be a forgot password option to receive a new password by email?
47
what is concurrent processing?
where each task is given a slice of processor time to make it look like tasks are being completed simultaneously when in reality they are executed sequentially
48
what is parallel processing?
when multiple processors are used to complete more than one task simultaneously
49
what are the benfits of concurrent processing?
- number of tasks completed in a given time increases - less time wasted waiting for an input/user interaction - other tasks can be completed
50
what are the drawbacks of concurrent processing?
- can take longer to complete when lots of users or tasks are involved - processes cant be done at once - overhead in coordinating and switching between processes - reduces program throughput - not all tasks are suited to being broken up and performed concurrently
51
give some examples of real world examples of concurrent processing?
- numerical weather predictions - requires around a quadrillion calculations to be done within 3-24hrs - done by special processors that can do calculations concurrently - Dual/quad core processors - most phones/PCs have 2-4+ cores - operating system assigns different tasks to each - search engine - when multiple tabs are open all cores can be used at full capacity - phones - video editing, image processing, facial recognition, 3D games + applications, virus scans, etc.