2.1 Elements of Computational Thinking Flashcards
What is abstraction?
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
What are computers models?
Store data about a topic and use these to model/predict behaviours
What are the uses of computer models and simulations?
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
What is thinking ahead?
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
What is modular programming?
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
What are the advantages of modular programming?
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
What is procedural decomposition?
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
What is structured programming?
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
What is a hierarchy chart?
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
What is thinking logically?
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
What are the features of a good algorithm?
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
What are the different methods for designing algorithms?
Hierarchy charts
Flowcharts
Pseudocode
What are hierarchy charts useful for?
Identifying major task and breaking these down into subtasks
What are flowcharts useful for?
Getting down initial ideas for individual subroutines
What is pseudocode useful for?
Will translate easily into program code
What is hand tracing useful for?
Figuring out how an algorithm works
Finding out why an algorithm is not working properly