UNIT 10: Computational Thinking Flashcards

1
Q

what is computational thinking?

A

‘the abilyt to think logically about a problem and apply techniques for solving it’

simply working out how to work things out

closely related to the skill of designing algorithms which can be turned into computer programs

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

what is computer science about (no clue)

A

ts about using mathemical princples to solve problems

its not about how to use a spreadsheet, word or graphics package ephraim

it inovles learning to think computioanlly and applying the pricnpels of abstraction

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

what is abstraction

A

its a way of separating the logicla and physical aspects of a problem

if you are learning to drive a car, you concentrate on the function of the steering wheel, accelerator, brakes and so on

if u are learning to be a mechanic you will concentrate on how these things actually work

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

thinking abstractly what it involves

A

involves devising a model that represtns the reality- for example, think of a simple queue or sometjing as complex as a climate change model.

removing details that are not relevant to the problem

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

abstraction and reality (info hiding)

A

abstraction is an important tool in problem solving

all the details that do not contribute to the essential charactersitcs of the porblem are ommited

the london underground map is a good exmpale of information hiding

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

problem abstraction (what it involves)

A

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

(types of recongition software kinda thing)

maps of diffrent places kinda thing

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

modelling and simulation (abstraction)

A

building a model of a real world object or phenomenon may be used to help solve a particular problem

comp scientists have to decide what details are relevant to the problem and discard everything else

algorthims and data structures can then be designed to solve the problem

algorhtim is then implemented in program code and executed

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

devising an abstract model

A

at its most abstract evel, a computational problem can be represented by a singl diagram

input - computational problem - output

input is info relevant to the problem, could for example be passed as parameters to a subroutine

output is 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
8
Q

thinking ahead

A

we need to take the inital abstract model and add detail to it until its transformed into a prgram

two major challenges to producing a solution

  • algorhtim must be correct, must work for all possible inputs
  • algorhithm muse be efficent- often a problem involed huge amounts of data, ahndling of records blah blah - so finding most efficent algrothim is important
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

identifying inputs and ouptus

A

subprocedure example

name - findmax
inputs - listint(1,2,3,3,45,)
ouptuts - an integer maxINT

advatnage of doucmenting inputs and outputs is that there is no ambiguity in what must be suplied to the subprocudure and what is returned

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

ambiguity! - quote

A

“i saw a man on a hill with a telescope”

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

specifying preconditions

A

precondtion - length of listINT > 0

must be fufilled before program works

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

advantages of specifying preconditons

A
  • making program components reusable
  • cutting out unecessary checks
    with clear statemnt of preconditons, programmer knows what checks need to be made before calling the subprocedure and which are unnecessary
  • making programs easier to debug and maintain
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

resusable program components can be

A

added to a library and important whenever needed (cool stuff)

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

programming stadnards

A

if program modules are to be resusable they need to confrom to certain programming stadnards

this will help to make them easy to use for other programmers

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

typical progarmming stadnards for resusable modules

A

inputs outputs and preconditoins should be documented

variable identifiers should confrom to a stadnared convetion

all variables must be local to the module

doeumnetation should be in stadnard format, explaing what it does, who it was written by, date written

explaninongs / comments

no module should exceed one page of code

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

thinking ahead (predicting)

A

ancipating what the user wants to do next

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

caching

A

os systems think ahead using chaching

temporary storage of data and insturctions

last few instuctions of a program to be executed, the result of an earlier computation or data used ma y be stored in memeory so they xan be very quickyl retirved

ie web caching, pages and images and links what not

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

advantages of caching

A

faster acces to chached rescources

saving on costly use of bandwidth

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
19
Q

disadvantages of caching

A

slower performance if the resource isnt found in the cache

being given a stale copy of a rescource when an up to date copty is needed

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

thinking procedurally

A

most problems of any size needs to be broken down into their compopnent parts

  • what are the different aspects of this problem?
  • is this a computational problem?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

decompostion

A

breaking a problem into a number of sub probelms so that each sub problem accomoplishes an identifiable task

the sub problems may themselves be further sub divided

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

structued programming defintion

A

aims to improve the clarity and quality of a program

method of writing comp programs which uses :

modulrization - for program structe and organistiation, breaking prbolem down into subroutines

structured code for indiuval moduels - uses sequence, selection and iteration

recursion

23
Q

what type of design model is structued programming ?

A

top down design

divded into subprodcueres or modules which are called from the main program

any of the subprocuedures may be further broken down into smaller subtasks with tthe samllest performing a single function

a HEIRARCHY CHART is often used to show the overall program stuructre

24
heriachy chart
broken down until. no further execution taeks place left to right, lowest level compontnet seleaction and iteration not shown in herhacy chart
25
benefits of modularisation
programs are more easily and quickly written - large programs are broken down - easier to manage and program - each subroutine can be easily tested - modules can be reused several times - freuqntly used modules can be saved in a library and used by other programs - several programmers can simultaneouslly work on different modueles - savin development time - more reliabble an dhave fewer errors - easier to find as they are self contatined - less time to test and debug - easier to maintain - easier to follow - easier to find which moduel needs to be cahnged - chagne doesent affect rest of the program - new features can be added by adding new moduels
26
good programming practice
meangiful identifiers (varaible and procedure naems) define and document i and o and p for each sub procuedure add comments at bottom level each sub procuedure should eprfrom a single task keep each sub procuedure self contaitned by passing parameters and using local varaibles
27
idenfiying components (then you can...)
once idenfiited u can plan overall method of solution involved writing procuedures or functions and passing parameters
28
modular programming is most useful for
large complex programs in small programs less thatn a page of code it may not be wroth writing individual modules for every subtask
29
a good algorithm has..
clear and precisely stated steps that produce the correct output for any set of valid inputs should allow for invalid inputs mkust always terminate at some point should execute efficenty, 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
30
3 tools for designing algorithms
hierachy charts - useful for dientifying the major task and breaking these down into subtasks flowcharts.- useful for getting down initial ideas for individual subroutines pseudocode - will trasnalte easily into program code
31
writing decision statements
decision or conditonal statments include IF and CASE statements WHILE FOR AND REPEAT loops also implicitly involve deecisions - boolean condition determines whether contorol will pass back to the beginning of teh loop of continue with the next statement probably the most common cause of logic errors in a program is a mistake in a conditional statement or a loop condition
32
hand tracing (trace table)
useful for figuing out hjow it works and why its not working properly trace table used to write down the contents of each varaible as it changes during execution if the program contains a loop a helpful technique is to put the loop condition as the first column in the trace table even if other varaibles have been defined before it
33
validation routines
to check that a user has entered a value fit for processing can involve tricky Boolean conditions Routines to check that a password is correct also involve several decisions
34
thinking concurrently
(concurrnely means same time) what tasks can be done at the same time
35
concurrent processing
in computing, c p means taht multp[le processors execute instructions simultaneously tasks are broken down into subtasks that cna be assigned to seperate processors to perform simultanusly
36
parallel processing
parallel and concurrent processing are sometijmes used interchangebly most commonly concurettn preocssing implies that a single processor is switching between separate tasks so that all tasks appear to be being processed at the same time the distctiion is sometimes blurred, for example when many processors are working concurrently on a single tasks, such as image processing or performign throusand of celaucaltoiaions to vslcauret eh best move in chess or smth
37
dual core and quad core processors
many personal computers and mobile devices have 2,3 or more CPU's or cores OS allocates sperate tasks to differetn CPUs
38
examples of concurrent processing on mobile devices include;
video editing image processing facial recognition 2d stereo games and apps virus scans
39
pattern recognition
used in edical diagnosis, speed camera, detecting a dagnrously overcrowded platform on an undergroudn railway
40
non computable problems
face recognition or fluing an airliner across the atlantic with no human intervention may once have seemed non computable but are now routinely solved however alub turing proved in 1936 that some problems are non computable computer science is somtimes defined as the study of problems that are and are not computable
41
methods of problem solving
trial and error enumeration - list all cases simulation theoriretcal approach creative solution
42
simulation problems
process fo designing a model of a real system in order to understand the behaviour of the system and to evaulate various strategies for its operation fincical risk anayliss amunsement park rides population preditctions managing inventory systems queueing problems
43
enumeration
every possible output anagram solver thingy
44
strats for algorithm design - divide and conquer
very efficetn involves finding a solution to a sequence of smaller realted problems until the instance is small enough to be solved directly
45
divide and conquer is the pricniple of what search?
binary search
46
the euclidian algorithm
GCD algotithm 2000 years ago by euclid desinged to find the greatest common divsor of two numbers
47
exhaustive search
tests every possible way
48
backtracking
you go some way along one route then backtrack to see if there is a better route
49
herusitc methods
herustic meanining - enabling someone to discover or learn something for themselves. include rules of thumb, educated guesses, intutive judgements or common sense find a method that is good enough even though it might not be optimal
50
an intractable problem - TSP
travelling salesman problem cannot be solved problem is to find the shortest route which visits every city and returns to the start
51
data mining
process of collecting and then analysing huge amounts of data
52
applications of data mining
increaing response rates to marketing campaings by being able to target them more accuraetly to the needs of each customer anticipating resouce demands detecting fraud and cybersecutiy issues finding oncnnceitons between seemingly unconnected events
53
big data
often used in conn with data mining impleies that huge amounts of data are collected and stored defined by 3 major features, kown as the 3Vs - VOLUME VARIETY AND VELOCITY parallel compuying, on which agothim tasks are exectuted concurrently on a cluster of machines of super comuters is fundamental to managing big data tasks
54
performance modellnign
how efficent is your algothm? one measure of effiecny is the Big O notation measures the suitability of algorithms in terms of execution time and space you can time different algorithms using built in timer functions
55
pipeling
implementation thecnique where multiple instructins are overlapped in execution instruction enter the pipeline at one end and at each stage part of the instruction is completeed and moves to the next stage while another instruction enters teh pipeline rather like an assembly line
56