Computational thinking (unit 10) (Finished) Flashcards
(10.1) What is computational thinking?
The ability to think logically about a problem and apply techniques for solving it
(10.1) What is abstraction?
a way of separating the logical and physical aspects of a problem
(10.1) How can abstraction be applied to situations?
by separating the relevant/irrelevant parts of a situation and focusing on the relevant ones
(10.1) How can a real world object help be solved?
Through abstraction, making a model of the problem and discarding all the unnecessary parts
(10.1) What is modeling?
A way of testing a scenario virtually before doing it in real life
(10.2) What is the simplest form a computer program can be put in?
Input (information relevant to the program)
Computations
Output (solution to the problem)
(10.2) What else do we need to specify besides inputs and outputs for programs to work?
Preconditions, such as length of list
(10.2) What are some advantages of specifying preconditions?
Making program components reusable
Cutting out unnecessary checks
Making programs easier to debug and maintain
(10.2) What is the main advantage of creating reusable program components?
Well-defined and documented functions and procedures may be used in many different programs
They can be added to a library and imported whenever needed
Overall save time and be efficient in using code that already works
(10.2) Can any modules be reusable?
No, they should adhere to certain standards, such as
Inputs, outputs and preconditions should be documented
Variable identifiers should conform to a standard convention
All variables must be local to the module
Documentation should be in a standard format, explaining what the module does, who it was written by, date it was written
Annotations of code should be included where necessary
All code to be peer reviewed. (Although this is time consuming.)
(10.2) What is caching?
Caching is the temporary storage of data and instructions
The last few instructions of a program to be executed, the result of an earlier computation, or data used may be stored in memory so they can be very quickly retrieved
(10.2) What are the disadvantages of caching?
Slower performance if the resource isn’t found in the cache
Being given a stale copy of a resource when an up-to-date copy is needed
(10.3) What is decomposition?
breaking a problem into a number of sub-problems, so that each sub-problem accomplishes an identifiable task
The sub-problems may themselves be further subdivided
(10.3) What is structured programming?
Structured programming aims to improve the clarity and quality of a program
method of writing a computer program which uses:
Modularization
Structured code
Recursion
(10.3) What is a top-down design model?
a system design approach where design starts from the system as a whole.
continuously divided into smaller parts until it is composed of minute details
(10.3) What kind of design technique does structured programming use?
A top-down design technique
(10.3) How can a hierarchy chart be used to present program structure?
By the decomposed program having each part of it be represented by a node in the chart
(10.3) In what order is a hierarchy chart executed?
Left to right, always starting at the lowest level component
(10.3) What are the benefits of modularization?
Programs are more easily and quickly written
Programs take less time to test and debug
Programs are easier to maintain
(10.3) When should the program be divided into smaller, individual modules?
in larger programs, as in shorter programs it may not be worth it due to the already small size
(10.3) What is a subprogram/module/procedure/function?
a small section of code within a larger piece of code which has a specific task
(10.3) What is modularity?
Splitting a larger program into smaller, more manageable parts
makes it easier to manage
programming in a modular way
(10.4) What makes a good algorithm?
has clear and precise steps that produce the correct output for any set of valid inputs
should allow for invalid inputs but then catch them
must always terminate/end at some point
should execute efficiently/quickly, 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
#annotations
(10.4) What are some of the tools for designing algorithms?
Top down diagrams
Flowcharts
Pseudocode
(10.4) What are decision statements?
Conditional statements such as IF which require some sort of decision
most common cause of logic errors
(10.4) What is a hand-tracing algorithm?
a method for hand simulating the execution of your code in order to manually verify that it works correctly before you compile it.
(10.4) What is a hand tracing algorithm useful for?
Figuring out how an algorithm works
Finding out why an algorithm is not working properly
(10.4) What are validation routines used for?
Validation routines are used to make sure a program is robust. They are used to check that a user has entered a value that can be processed
(10.4) What validation techniques are there?
Range check. Type check Lookup check Length check Presence check
(10.4) What is concurrent processing?
In computing, concurrent processing means that multiple processors (or cores) execute instructions simultaneously/at the same time
(10.4) What is the use of dual and quad core processors?
allows the operating system to allocate seperate tasks to different cpus
(10.4) can increasing CPU count increase computer performance?
Yes, but only if the program can take advantage of the extra cores via being split up or multiple processes are running at the same time
(10.4) What is pipelining?
Another method of achieving concurrency
Doesn’t wait for an instruction to be executed before the next is fetched
(10.5) What is pattern recognition?
Pattern recognition is a computational problem used in hundreds of different applications
(10.5) What are some methods of problem solving?
trial and error Enumeration/brute force – list all cases simulation theoretical approach creative solution
(10.5) What is simulation?
Simulation is the process of designing a model of a real system in order to understand the behavior of the system, and to evaluate various strategies for its operation
(10.5) What are some examples of things that can be simulated?
Financial risk analysis Amusement park rides Population predictions Managing inventory systems Queueing problems
(10.5) What is enumeration?
listing things in a list one by one
(10.5) What is an example of enumeration?
entering a set of letters/ words into an anagram solver and allowing it to list all the possible solutions
(10.5) What is the divide and conquer method?
A divide-and-conquer algorithm recursively breaks down a problem into two or more sub-problems of the same or related type, until these become simple enough to be solved directly
(10.5) How is a binary search related to divide and conquer?
they apply the same principal, split the data in half and discard one
(10.5) What is computational thinking?
a way of thinking about how to approach problems and finding optimum solutions
(10.5) What is abstraction?
is used in problem solving to remove unnecessary details from the problem and in procedural decomposition, identifying sub-procedures necessary to solve the problem
(10.6) What does GCD stand for?
Greatest Common Divisor
(10.6) What is an exhaustive search?
trying all routes or possible options
(10.6) What is backtracking?
you go some way along one route and then backtrack to see if there is a better route
(10.6) What are some examples of heuristic methods?
rules of thumb
educated guesses
intuitive judgments
common sense
(10.6) What are some applications of heuristic methods?
routing messages across the Internet building circuit boards transportation virus checking GPS routing
(10.6) What is data mining?
Data mining is the process of collecting and then analysing huge amounts of data
(10.6) What are some applications of data mining?
Increasing response rates to marketing campaigns by being able to target them more accurately to the needs of each customer
Anticipating resource demands
Detecting fraud and cybersecurity issues
Finding connections between seemingly unconnected events
(10.6) What is big data?
huge amounts of data are collected and stored somewhere
(10.6) How can supermarkets and other companies use the data they have on you?
Customized advertising and special offers (targeted advertising)
(10.6) What is performance modelling?
a process of evaluating if a system or a program works as expected or not before it is released, and using this knowledge to make it more effective.
(10.6) What is visualization?
he use of interactive, sensory representations, typically visual, of abstract data to reinforce cognition, hypothesis building, and reasoning.
(10.6) What are heuristics?
A technique designed for solving a problem more quickly when classic methods are too slow or for finding an approximate solution when classic methods fail to find any exact solution.