UNIT NO.5
Computational Thinking
(Solved Exercise)
C. Answer the following short questions:
1. Explain computational thinking. Why do you think it is important to learn?
Computational thinking is a set of problem-solving processes that includes several characteristics and perspectives. Computational thinking allows us to take a complex problem, understand what the problem is and develop possible solutions.
We can then present these solutions in the way that a computer, a human, or both, can understand. It is important to learn computational thinking also for the development of computer programs.
2. Differentiate between decomposition and abstraction.
Decomposition
Decomposition means, analysing and breaking down a problem into smaller parts to solve it in an organised manner and to make it easier to understand and manage.
Abstraction
Abstraction helps to identifying the general principles that generate the patterns as well as focusing on the important information only and ignoring irrelevant details.
3. What are the rules to write an algorithm?
There is a set of rules that you should follow while writing an algorithm.
- It should be clear, exact, and well-defined.
- It should always begin with the word Start and end with the word Stop.
- Each step in an algorithm should be written in a separate line.
- Steps should be numbered as Step 1, Step 2, Step 3, etc.
4. What do you think is the process to boil water? Write an algorithm and draw a flowchart for boiling the water.
To boil water is a simple process.
Algorithm for Boiling the Water
Step 1: Start
Step 2: Take water in utensil.
Step 3: Put it on gas stove.
Step 4: Turn on gas stove.
Step 5: Keep heating until water boils.
Step 6: Turn off gas stove.
Step 7: Water is boiled.
Step 8: Stop
Flowchart for Boiling the Water
5. Explain the factoring problems.
Factoring problems involve breaking down an expression, usually a polynomial, into simpler components (factors) that, when multiplied together, produce the original expression.
The factoring problem asks you identify the prime factors of an odd integer. It is an example of a computational challenge. The factorization problem is said to not be solved computationally. The factoring effort increase exponentially as the size of the input integer increases.
6. What is a pseudocode?
A collection of instructions to solve a problem simply described in plain English is called Pseudocode. Pseudocode can be viewed as a collection of well-organised ideas for solving issues.
7. How are algorithms used in real life?
Algorithms are used in real life to efficiently solve problems and perform tasks, such as searching, sorting, and decision-making, in areas like technology, finance, healthcare, and everyday activities.
8. Are pseudocodes better than flowcharts? If yes then explain why.
Pseudocodes is good for planning and testing algorithms but it can be ambiguous and inconsistent.
D. Answer the questions comprehensively
1. Write two pros and cons of computational thinking.
Terms | Prose | Cons |
1.Thinking Abstractly | Allows us to make predictions | Predicting markets, users, trends, and technical factors could be challenging. Too many factors that are changeable may mean the scenario is too complex to model accurately. |
2.Thinking Ahead | Caching can speed up a process | Caching can be complicated to implement. Caching requires the correct data to be fetched for the next task. |
2. What do you mean by the halting problem? How can we prove that the halting problem is undecidable?
The halting problem is a decision problem. Halting means terminating or stopping our program after a certain execution. We are unable to create a generic algorithm that can accurately predict whether a certain program will ever stop or not. Additionally, there is no generic algorithm that can tell us whether a certain program will complete its execution and stop. The best approach is to run the application and check to see if it stops or halts.
Keep in mind that if our program does not halt, it will keep the CPU busy forever. In programming, we say it is an infinite loop. Our programs should never get into infinite loops otherwise, the system will not work properly.
D. Define the following terms:
1. Computational thinking
Computational thinking is a set of problem-solving processes that includes several characteristics and perspectives. Computational thinking allows us to take a complex problem, understand what the problem is and develop possible solutions.
2. Decomposition
Decomposition means, analysing and breaking down a problem into smaller parts to solve it in an organised manner and to make it easier to understand and manage.
3. Abstraction
Abstraction helps to identifying the general principles that generate the patterns as well as focusing on the important information only and ignoring irrelevant details.
4. Flowchart
Abstraction helps to identifying the general principles that generate the patterns as well as focusing on the important information only and ignoring irrelevant details.