2.1 Computational thinking Flashcards
Abstraction
Simplifying a problem by only taking into consideration the necessary details required to obtain a solution leaving a representation without any unecessary details
Data abstraction
details about how data is being stored are hidden
Graph theory
A branch of paths that can be used to abstractly represent problems using a collection of nodes connected by edges
Caching
The temporary storage of data by the system in cache or memory for the benefit of faster retrieval if it is needed again in future
Inputs
Any information relevant to the problem that is required by the system for processing
Outputs
The result returned by a system for a given input after running the entire process or part of a process
Preconditions
A perquisite or state of a system and its surroundings required to run a use case and return a valid solution
Reusable program components
Components that have already been written, debugged and tested that can be transplanted into new systems to save development time in project completion
Procedural abstraction
Achieving a task by relying on a procedure of sequential steps
Components of a problem
The smaller, simpler series of tasks and sub-procedures a problem can be broken down into to be completed modularly
Flowcharts
A representation of the flow of a program that includes all the points where a decision needs to be taken in order to obtain a solution
Logical conditions
Conditions which may depend on one or more variables used to determine the next step whenever a system has to make a decision. They are typically implemented using control structures such as sequences selections and iterations
Concurrent processing
Processing where the system appears to perform multiple tasks simultaneously
What is abstraction by generalisation
grouping together similarities within a problem to
identify what kind of problem it is where a common solution can be used to solve these problems
How does procedural abstraction work
It models what a subroutine does without considering how this is done.
Once a procedure has been coded, it can be reused as a black-box
What do large problems make use of in relation to abstraction
multiple levels of abstraction, where each level
performs a different role
What are the highest levels of abstraction when multiple are used
closest to the user and are
usually responsible for providing an interface for the user to interact with hardware
What are the hlowest levels of abstraction when multiple are used
e lowest levels of abstraction are responsible for actually performing these
tasks through the execution of machine code.
TCP ip model abstraction
abstraction for how networks function,
separated into four layers of abstraction
Do each layer in the TCP IP model need to know how the others work
No
Outgoing and ingoing TCP IP model
Outgoing go down from application and incoming goes up from link
OOP abstraction
Object-oriented programming makes use of objects, which
are also an abstraction for real-world entities
What does abstraction consider in OOP
abstraction considers the
functionality, interface and properties of entities. Attributes
are an abstraction for the characteristics of an object while
methods are an abstraction for the actions a real-world object is able to perform
What is the purpose of thinking ahead?
To make programs easy and intuitive for users to use
Inputs?
Any data that is required to solve a problem, usually entered into the system by the user
Outputs?
The results that are passed back once the inputs have been processed and the problem solved
What considerations do programmers need to make about inputs and outputs when thinking ahead?
Method of input/output (device used)
Data structures used
Data types used
Order of data
You must be able to extract inputs and outputs from a real world scenario…
Book reservation system, e.g. at a library?
Inputs - Book details: name, author, ISBN, Borrower details: name, library card number, Collection point
Outputs - Expected waiting time, Confirmation, Availability at other libraries
What are preconditions?
Requirements which must be met before a program can be executed
Where can preconditions be defined?
Within the code or within documentation
Where are preconditions required?
Stack functions - check stack isn’t empty when popping an element from a stack, or is full when pushing an element onto the stack
Factorial function - the number passed to the function cannot be negative
What are the advantages of including preconditions within the documentation accompanying a subroutine?
Reduces the length of the program
Reduces the complexity of the program
Saves time needed to debug and maintain a longer program
Makes subroutine more reusable
What is caching?
The process of storing instructions or values in cache memory after they have been used, as they may be used again
How is caching used in storing web pages?
Web pages that a user frequently accesses are cached, so the next time one of these pages is accessed, content can be loaded without any delay
What are the advantages of caching web pages?
Content can be loaded without delay images and text do not have to be downloaded again multiple times
Frees bandwidth for other tasks on a network
Less time is spent wasting
What is the name given to the technique in which algorithms are used to predict which instructions are likely to soon be used?
Prefetching
What are the limitations of caching?
Accuracy of the algorithm used
Effectiveness of algorithm in managing the cache
Size of the cache
What are the advantages of reusable components?
More reliable than new components, as they have already been tested
As developing from scratch is not required, this saves time, money and resources
What are some examples of reusable components?
Abstract data structures e.g. queues and stacks
Classes
Subroutine
What are the limitations of using reusable components?
Compatibility issues with the rest of the software Causing to be more costly and time-consuming then developing them in-house
What is the first stage of thinking procedurally?
Taking the problem defined by the user and breaking it down into its constituent parts
What is the purpose of problem decomposition?
To make complex problems easier to solve and more manageable by allowing tasks to be divided between a group of people according to individual skill sets
What is another name given to top-down design?
Stepwise Refinement
What is the purpose of top-down design?
Continually break problems down into subproblems until each subproblem can be represented as a single task and ideally a self-contained subroutine
What are the benefits of using a top-down design?
Problems can be solved and modules developed by different people
Tasks can be tested separately, modules are self-contained
What sort of problems is top-down design suited to?
Large, complex problems
What is the second stage of thinking procedurally in software development?
Identifying components of a solution
How can the lowest level subproblems in top-down design in code?
As self-contained modules or subroutines
What do software developers need to consider when recombing components of a solution?
The order in which subroutines are executed, and how they interact with each other, based on their role in solving the problem
What must a software developer do before designing a subroutine to solve a particular problem?
See whether it is possible for an already existing subroutine or module to be used
What are the advantages of utilising reusable components?
More reliable than newly-coded components, as they have already been tested
This saves time, money and resources
What is a decision?
A result reached after consideration.
When are decisions made?
Whenever you have a choice to make
What is a decision shape in a flowchart?
A diamond
In a flowchart how many options can you pick from a decision?
2 different options - yes or no / true or false
How do you make effective decisions?
By evaluating the importance of different factors and selecting options which satisfy the needs of the task the most appropriately
Does the result of a decision affect the flow of the program?
The program will follow a different route depending on the decision made by the user
What is concurrent thinking?
It is completing more than one task at any given time
Are concurrent processing and concurrent thinking the same thing?
No, one uses computer processors, one uses the human brain
What is parallel processing?
Completing multiple tasks simultaneously at any given time
What is concurrent processing?
Giving a slice of processor time to tasks to give the illusion of parallel processing
What are the benefits of concurrent processing?
More tasks can be completed in a given time
Other tasks can be completed while waiting for an input/user interaction
What are the drawbacks of concurrent processing?
If lots of users are requesting for tasks to be completed, it takes longer for everyone to complete their task
What is representational abstraction
analysing what is relevant to a given scenario and simplifying a problem based on
this information
What is categorisation generilsation
Another form of abstraction involves grouping together similarities within a problem to
identify what kind of problem it is
What does abstraction by generalisation allow
certain problems to be categorised as being of a particular type. Thus a common solution
can be used to solve these problems