2.1 Elements of computational thinking Flashcards
In Thinking Procedurally, why are the order of steps needed to solve a problem?
(2.1.3)
- Processing may require certain inputs
- Input validation must occur before data usage
- Can have interaction of multiple subroutines
- Should prevent logical errors
What is concurrent thinking? (2.1.5)
- Completing multiple tasks at given time
- Time slicing between different tasks
- Related problem parts often solvable concurrently
How does caching relate to Thinking Ahead in program development, and what
advantages / disadvantages does it have? (2.1.2)
- Storing instructions / values in cache
- Saves time retrieving
- Quicker loading, frees bandwidth
- Prefetching: predicts likely instruction to fetch
- Less time waiting for fetch
- Limited accuracy
- Large cache 🡆 long search time
- Difficulty implementing
What are the differences between abstraction and reality? (2.1.1)
- Abstraction simplified representation of reality
- Entities represented as computational structures
- Real-world values represented by variables / constants
What types of abstraction are there? (2.1.1)
Representational: removing excess details, analysing only relevant details
Data: hiding details of how data’s stored
Generalisation: grouping similarities together, common solution
Procedural: utilising functions without knowing implementation method, hides
complexity
What is the need for reusable program components in Thinking Ahead? (2.1.2)
- Common used functions 🡆 libraries
- Saves time, money, resources
- Decomposition identifies reusability
- More reliable, already tested
- Sometimes more costly / time-consuming ensuring compatibility
How are components of a solution to a problem created in Thinking Procedurally?
(2.1.3)
- Building-up from lowest-level
- Considering inputs / outputs
- Identifying solvability by existing methods
Why do we determine preconditions when devising a solution to a problem in
Thinking Ahead? (2.1.2)
- Sets requirements to meet before program execution
- Can be tested within code, or in documentation
- Expecting arguments to meet certain criteria
- Reduces length & complexity of program
- Saves time debugging / maintaining
- Subroutines more reusable
What is concurrent processing, and what are its advantages / disadvantages?
(2.1.5)
What:
- Each task given time slice
- Task completion appears simultaneous
Advantages:
- Task amounts completed in given time increased
- Less time waste waiting for input, other tasks processable
Disadvantages:
- Many users/tasks 🡆 longer completion time
- Coordination / switching overhead, reduces program throughput
- Not all tasks suited
How is identifying inputs / outputs used in designing a problem and Thinking
Ahead? (2.1.2)
- Output = solution to problem
- Methods evaluated
- Considered upon user requirements
- Can identify inputs required
- Creates ease-of-use / intuition
What logical decisions can affect the outcome of a deicison, in Thinking
Logically? (2.1.4)
- Effectiveness, convenience, feasibility
- Appropriateness evaluated
- Importance ordered
How are components of a problem identified in Thinking Procedurally? (2.1.3)
- Decomposition: breaking large complex problem into smaller subproblems
- Easier management, divisible between team
- Top-down design
- Divides complexity levels
- Broken until each subproblem = single task = single subroutine,
self-contained
What is the role of decision-making within problem-solving, in Thinking
Logically? (2.1.4)
- Result reached after consideration
- Choosing paradigm to use, information to collect
- Solution choices limited
- Early identification 🡆 better informed choice
What is the nature and need for abstraction, and what are layers of abstraction?
(2.1.1)
Nature & need:
- Removing unnecessary details of problem
- Focusing only on relevant details implementing a solution
- Programmers: use data structures without knowing implementation
Layers: each different role, highest closest to user, lowest performing tasks