2.1 Elements of Computational Thinking Flashcards

1
Q

What is abstraction?

A

Making a problem easier to solve by removing unnecessary detail and leaving only fundamental components to provide a computational version of reality

Involves devising a model that REPRESENTS reality

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

What are computers models?

A

Store data about a topic and use these to model/predict behaviours

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

What are the uses of computer models and simulations?

A

Predictions of global warming, effects of climate change

Likely scale and effects of population increases

Number of doctors and teachers required in 10 years time

Prediction of likely consequences of an earthquake

Financial modelling to predict future profits/losses

Likely spread of disease such as Covid

Saving in field of a new car/aircraft design

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

What is thinking ahead?

A

Considering all possible inputs and outputs to a system

What format will the inputs be in and where do they come from (from user input or sensors)

What format will be the outputs be in (documents, sound)

What processes will need to take place on the data in the system

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

What is modular programming?

A

Taking a problem and breaking it down into smaller problems, each of which can be easier to solve

Splitting code into different subroutines and/or different files

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

What are the advantages of modular programming?

A

Can take different problems and distribute them across a team of developers

Each module can be reused, reducing memory footprint, speeding up development time and making coding more consistent

Each module should’ve been thoroughly tested

Saves development time as all developing simultaneously

Project can be easier to manage as you aren’t relying on one piece of code to be finished to do another

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

What is procedural decomposition?

A

Breaking a problem into a number of sub-problems so that each sub-problem accomplishes an identifiable task

Sub-problems may then be further subdivided

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

What is structured programming?

A

Aims to improve clarity and quality of code

Modularisation - for program structure and organisation, structured code for individual modules (code using sequence, selection and iteration), recursion

Uses top-down design techniques

Program divided into modules which are called from main problem

Any sub-procedures may be further broken down into smaller sub-tasks, with smallest performing single function

Hierarchy chart - used to show overall program structure

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

What is a hierarchy chart?

A

Each logical process broken down into smaller components until it can’t be broken down any further

Execution tasks place from left to right, always at the lowest level component

Selection and iteration not shown

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

What is thinking logically?

A

Identify the points where a decision has to be taken

Determine the logical conditions that affect the outcome of a decision

Determine how decisions affect flow through a program

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

What are the features of a good algorithm?

A

Has clear and precisely stated steps

Produces correct output for any set of valid inputs

Validates against invalid inputs

Terminates at some point

Should be efficient, execute in as few steps as possible

Should be designed in such a way that other people will be able to understand it and modify it if necessary

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

What are the different methods for designing algorithms?

A

Hierarchy charts

Flowcharts

Pseudocode

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

What are hierarchy charts useful for?

A

Identifying major task and breaking these down into subtasks

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

What are flowcharts useful for?

A

Getting down initial ideas for individual subroutines

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

What is pseudocode useful for?

A

Will translate easily into program code

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

What is hand tracing useful for?

A

Figuring out how an algorithm works

Finding out why an algorithm is not working properly

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

How are trace tables used?

A

To write down contents of each variable as it changes during execution

If program contains a loop, helpful technique is to put loop condition as first column in trace table, even if other variables have been defined before

ONLY NEED TO ENTER THE VALUES THAT CHANGE INTO A TRACE TABLE

18
Q

Why is caching used?

A

Impossible to store all data locally at once, ready to processed

19
Q

What is caching?

A

Cache blocks of data that need to be processed - loaded from server to the client machine - so that data could then be processed at a quicker speed

Processed data can then be uploaded back to database on web server

When data cached, temporary copy stored so it can be accessed again faster

20
Q

What are the benefits of caching?

A

By using blocks of data rather than constant access to and from database, reduces load on database server

If data in use is cached to client machine as block, if problem with server or connection to server then data can still be processed, reducing reliance on good connection to the server

21
Q

What are the drawbacks of caching?

A

Decrease performance if database held away from client machine, as all data is processed locally

Problems synchronising data (if data cached onto machine and different copy held on server, could be issue with keeping data up to data and consistent if more than one machine able to access data at once)

Increase maintenance costs as database need maintaining (checking consistency of data)

If problem with server (crashes) then if data already on client’s machine then won’t be able to reuploaded

22
Q

What is concurrent processing?

A

Where one process doesn’t need to finish before next process start

Multiple processors execute instructions simultaneously

23
Q

What is parallel processing?

A

Using multiple processors

Each processor works simultaneously and independently

CONSIDERED CONCURRENT

24
Q

How does concurrent processing work?

A

Tasks broken down into subtasks that can be assigned to separate PROCESSORS/run on different THREADS and therefore run independently

A task can begin without waiting for another task to FINISH FIRST so tasks can OVERLAP

Each thread starts and ends at a different time

25
Q

What are the advantages of concurrent processing?

A

Less hardware bottlenecks

More efficient processing of interrelated tasks

More efficient use of processor time

Parallelism

Througput

Processor maximised

Reactive programming

26
Q

Why does concurrent processing cause less hardware bottlenecks?

A

Programs should be more responsive because idle time between hardware interactions filled

Less time wasted waiting for an input or user interaction as other tasks can be completed

27
Q

Why does concurrent processing allow more efficient processing of interrelated tasks?

A

Processor doesn’t need to wait for other threads to be able to complete executing before starting processing on another task

Multiple threads and processes can be executed simultaneously on different cores

28
Q

Why does concurrent processing allow more efficient use of processor time?

A

Maximises use of each processor and reduces amount of idle time

Maximises throughput of processor meaning amount of tasks that can be completed within given amount of time

29
Q

How does concurrent processing allow parallelism?

A

Complex programs can make better use of multiple resources in multi-core processor systems

30
Q

Why does concurrent processing maximise throughput?

A

Allowing multiple tasks to run concurrently will increase program throughput (e.g. number of tasks completed in a period of time)

31
Q

Why does concurrent processing maximise processors?

A

Processor is not waiting for user input etc but can be competing actions from other threads whilst otherwise would be paused

32
Q

Why does concurrent processing allow reactive programming?

A

User is able to interact with applications while other tasks are running

33
Q

What are the disadvantages of concurrent processing?

A

Concurrent can be slower than serial execution

Overheads in concurrent processing

Deadlock can occur in extreme circumstances

Memory intensive

Footprint

Resource consumption

Coding

34
Q

Why can concurrent processing be slower than serial execution?

A

When large numbers of users or tasks are involved as processes cannot be completed at once and will continually be paused whilst other tasks and threads are give processor time

35
Q

Why are there overheads in concurrent processing?

A

Running tasks on multiple processors will incur overheads as data needs to be moved between processors, threads and processes need to be paused and tasks need to be split to run on different processors

36
Q

Why can deadlock occur in extreme circumstances in concurrent processing?

A

When two processes are being executed at the same time and each locks a resource that is needed by the other resource

OS would need to implement methods to deal with this

Wouldn’t happen with serial execution

37
Q

Why is concurrent processing more memory intensive?

A

Running multiple threads will be more intensive on the computer’s memory

38
Q

Why does concurrent processing have a greater footprint?

A

Program will have a larger memory footprint due to complex nature of coding

39
Q

Why does concurrent processing increase resource consumption?

A

Threads can be expensive

Overhead associated with scheduling, switching threads and synchronising them

40
Q

How does concurrent processing increase the complexity of code?

A

Programming multiple threads can be challenging and complex