computational thinking

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/48

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

49 Terms

1
New cards

types of abstraction

  • representational abstraction

  • abstraction by generalisation

  • data abstraction

  • procedural abstraction

2
New cards

describe representational abstraction

analysing what key features in a problem are relevant to solving it and simplifying it

3
New cards

describe abstraction by generalisation

grouping similar features of a problem to identify what kind of problem it is (=categorisation of the problem and being able to use a common solution)

4
New cards

describe data abstraction

details about how data is being stored is hidden = use of abstract data structures e.g. stacks and queues

5
New cards

describe procedural abstraction

removing details about the code being used to provide the functionality =pushing/popping items off a stack

6
New cards

What is an abstract model

Simplified representation of a problem by removing unnecessary details and displaying the key features of the program

7
New cards

why is abstraction necessary

  • hides information too complex/irrelevant (e.g. hides contents of subroutines)

  • programmers only focus on key features of code

  • efficient design/code= save time/space

8
New cards

2 applications of layers of abstraction

  • networking (TCP/IP model) (= simpler to understand communication process)

  • programming languages (HLL = easily remember syntax + easier for beginners, object-oriented programming abstracts real life objects)

9
New cards

purpose of thinking ahead

to account for difficulties/problems that may arise, and thinking about how components can be used in the best way possible= easy + intuitive use for users

-this is by thinking about inputs/outputs, preconditions, caching and reusable components

10
New cards

describe inputs and outputs of a system

inputs: data used to solve a problem (including the order/method they are inputted in) = user values or arguments

outputs: results of data after the problem has been solved relayed to the user

11
New cards

what are preconditions

requirements that must be met before a piece of code can run (e.g. correct arguments). These can be within documentation for the user to fulfil = shorter + simpler program with less time to debug

12
New cards

purpose of preconditions

Ensure that the necessary checks are carried out before the execution of a subroutine (by the user or as part of the subroutine= more reusable.

13
New cards

what is caching

instructions and values recently used are temporarily stored in cache = saves time + bandwidth fetching instructions/values again + convenient to user

14
New cards

what is prefetching

using an algorithm to predict which instructions/values are likely to be needed again/fetched and storing them in cache= saves waiting time

15
New cards

disadvantages of prefetching/caching

  • algorithm may be inaccurate (due to making informed guesses)

  • cache size limits effectiveness

  • difficult to implement

  • old/stale copies of data may be used

16
New cards

use of reusable program components

already tested+ compiled= reliable, saves time, money and resources (but may have compatibility issues)

17
New cards

standards of reusable components

  • well-documented inputs, outputs and preconditions

  • only using local variables conforming to standard convention

  • documentation is in standard format

  • necessary inclusions of code explaining the program

  • modules no larger than one page

18
New cards

purpose of thinking procedurally

It helps break a problem into smaller parts/subproblems (problem decomposition) and the components of a solution (e.g. easier to think about the order of subroutines created+ how they interact)

= easier to understand/ design

-shown on structure diagram

19
New cards

method of program decomposition/ stepwise refinement

top down design (large problems are broken down into levels in a hierarchical structure to provide detail to problem components, with first level at the top)

-the subproblems will therefore be able to be coded as a subroutine + tested separately

20
New cards

advantages of problem decomposition

  • splits a general problem into more detailed subproblems

  • more feasible to manage

  • can be split between people to code

  • easier to decide if a task can use library functions/subroutines

21
New cards

describe structured programming

programming utilising modularization (breaking a problem into subroutines), structured code (sequence, selection, iteration), and recursion

=improved clarity/ quality

22
New cards

standard rules for reusable modules

  • document inputs, outputs and preconditions

  • variable identifiers conform to a standard convention

  • all variables are local

  • standard format documentation

  • does not exceed one page

  • necessary explanations of sections of code

23
New cards

advantages of subroutines

-easier to follow

-easier to find which module needs to be changed

-New features can be added by adding new modules

- easier to program and manage

-Each subroutine (i.e. module) can be individually tested

-can be re-used several times in a program

-can be reused from a library

-Several programmers can simultaneously work on different

-saves time

24
New cards

purpose of thinking logically

Thinking logically involves thinking about the decisions that need to be taken by the user and their outcomes in the program (represented by boolean expressions, and shown in if statements or while and do loops)

-decide how decisions are made (if statements, while/ do loops, etc. )

25
New cards

how to simplify decision process

  • limit possible solutions by checking feasibility/ reasonability/ effectiveness/ convenience

  • evaluation of options based on the above

  • decision flow chart

26
New cards

purpose of thinking concurrently

Completes multiple tasks at the same time = spot patterns between different areas of the problem where concurrent processing can be applied (processor dividing processor time to multiple tasks at once)

27
New cards

advantages of concurrent processing

  • less time taken to complete each task

  • reduces wasted time waiting for input or user interaction (as multiple tasks can be completed in the meantime)

  • increased program throughput

28
New cards

disadvantages of concurrent processing

  • ineffective/ take longer when many users/tasks are involved

  • some tasks may not be able to be processes concurrently

  • overhead coordinator of concurrency is required= less program throughput (amount of information processed at once)

29
New cards

how to tell if a problem is computational

  • if they can be solved by an algorithm in a finite, realistic amount of time

  • solving it involves inputs, outputs and calculations

  • reasonable processing speed, memory and power available

30
New cards

describe problem recognition

  • Analysing strengths and weaknesses with the current way this problem is being solved

  • Considering types of data involved including inputs, outputs, stored data and amount of data

31
New cards

describe divide and conquer algorithm

halving the size of a problem every iteration, and each subproblem is recursively solved every ‘conquer’ iteration and recombined during the ‘merge’ stage

  • decrease and conquer involves reducing the problem size every iteration

32
New cards

problem solving strategies

  • divide and conquer (e.g. binary search)

  • abstraction (e.g. graph unfolding)

  • backtracking

  • data mining

  • heuristics

  • performance modelling

  • pipelining

  • visualisation

33
New cards

describe backtracking

A recursive algorithm that visits all paths and builds a solution based on the correct paths, backtracking (to a previous decision) when invalid

  • e.g. depth-first graph traversals

34
New cards

describe data mining

process of collecting and finding patters/outlier in big data (large sets of data) = future predictions based on previous trends, connections between events, detecting fraud/cybersecurity issues

35
New cards

describe big data

  • characterised by volume (amount), velocity (speed of collection) and variety (pictures, videos, searches)

  • managed by parallel computing, which uses concurrent processing

36
New cards

describe heuristics

a non-optimal, rule-of-thumb estimation of a solution when the standard solution is too time-consuming/resource-intensive (e.g. untraceable problems)

  • e.g. virus checking, DNA analysis, internet routing, building circuit boards, AI

37
New cards

describe performance modelling

using mathematical methods to test a variety of loads on different operating system (e.g. safety-critical systems)

  • cheaper, less time-consuming, safer

  • assess capabilities of a system

38
New cards

describe pipelining

different tasks are completed in parallel, with one task’s output being used for another task’s input (resembles production line)

  • if there are decisions within the program, the pipeline needs to be reset/flushed= ineffective

39
New cards

describe visualisation

method of presenting data in a more understandable way (esp. statistical data)

  • identify non-obvious trends

  • presented as graphs, trees, tables, charts, etc.

40
New cards

list programming techniques

  • sequence, selection, iteration

  • recursion

  • modularization, functions and procedures

  • local/global variables

  • use of IDE

  • use of object-oriented programming

41
New cards

describe the process of recursion

  • when a function calls upon itself, a new stack frame

  • variables, parameters and return addresses are stored in the stack

  • once a stopping condition is reached, the subroutine unwinds and data is popped off the stack frame

42
New cards

disadvantages of recursion

  • inefficient use of memory

  • may cause stack overflow (runs out of memory)

  • difficult to trace

  • tail recursion is a more efficient method of recursion

43
New cards

2 ways variables can be passed as parameters

  • by reference

  • by value

44
New cards

describe passing variables by value

a copy of the value is passed as a parameter, which acts as a local variable not affecting the global variable

45
New cards

describe passing variables by reference

the address of the parameter is passed into the subroutine, so changing the value changes the value at that memory address

46
New cards

what is IDE

Integrated development environment is a program used to write develop, debug code (e.g. PyCharm, IDLE, Microsoft Visual Studio)

47
New cards

describe features of an IDE

  • stepping (monitor each line of code’s effect)

  • variable watch (seeing how variable contents change within the program)

  • breakpoint (setting a point where a program stops, based on a condition or a set point)

  • source code editor (helps code writing by providing indentation, word autocompletion and syntax highlighting)

  • debugging tools (provide run-time detection of errors)

  • translator

48
New cards

purpose of testing different types of inputs

to make sure all bugs are removed before deployment (erroneous, valid, invalid, null, extreme)

49
New cards

abstract data types vs data structures

  • ADT present logical descriptions of how data is organised & task performance (e.g. graphs)

  • data structures are the concrete locations of data (e.g. arrays, stacks, queues)