Untitled Document
Untitled Document
A simple problem is one which can be solved through a simple series of steps, for example,
the recipe for baking a cake. A complex problem on the other hand does not seem to have
an obvious, immediate solution.
Computational Thinking
One example of using computational thinking to solve a complex problem is using the 'divide
and conquer approach. This involves breaking down a large, complex problem into smaller,
more manageable subproblems, solving each subproblem independently, and then
combining the solutions to the subproblems to solve the overall problem.
Imagine you have a really big puzzle with lots of pieces, and you want to put it together as
quickly as possible. One way to do this is to divide the puzzle into smaller pieces and work
on each piece separately. You can finish each small piece and then put them together to
complete the bigger puzzle.
This is how we can use computational thinking to solve problems. There could be other ways
to solve the puzzle too. The best way would be the one that requires less time.
Consider another example of organising a list of words from A to Z. You could divide the list
into smaller lists, for example, the words that start with A, all the words that start with B, and
so on. Then, you can put all the words that start with A in order, all the words that start with B
in order, and so on. Finally, you can put all the smaller lists together to get the final list of
words in order from A to Z. This is an example of how we can use computational thinking to
solve a problem by breaking it down into smaller parts and solving each part separately.
There are many different problem solving strategies that can be used, and the best strategy
to use often depends on the particular problem you are trying to solve.
1. Divide and conquer: The same rule of computational thinking that involves breaking a
large or complex problem down into smaller, more manageable subproblems and solving
each subproblem independently.
2. Make a list: Sometimes it can be helpful to make a list of the steps you need to take to
solve a problem. This can help you organise your thoughts and keep track of your progress.
3. Work backwards: If you know what the end result of a problem should be, you can try
working backwards to figure out the steps you need to take to get there.
4. Draw a diagram: If the problem involves a lot of different parts or pieces, it can be helpful
to draw a diagram to help you visualise the problem and come up with a solution.
5. Act it out: If the problem involves a series of events or actions, you can try acting it out to
help you understand what is happening and come up with a solution.
6.Look for patterns: Sometimes there are patterns or repeating elements in a problem that
can help you find a solution more quickly.
7.Ask for help: If you are stuck on a problem and can't figure out a solution, it can be helpful
to ask a friend, teacher, or parent for help.
Remember, there is no one "right" way to solve a problem, and it's okay to try out different
strategies until you find one that works for you.
Finding the most efficient algorithm for a problem is like trying to find the quickest way to get
from one place to another. Just like there are different routes you can take to get to a
destination, there are also different ways you can solve a problem using algorithms. Some
ways might be faster than others, and some might use more resources like time or memory.
To find the most efficient algorithm, you can try out different ways of solving the problem and
compare how long they take to run and how much memory they use. The algorithm that is
the quickest and uses the least amount of resources is the most efficient one.
It's important to find the most efficient algorithm because it can save time and resources
which is especially important when solving larger or more complex problems. Just like taking
a longer route to get somewhere might not be a big deal if you're just going a sheer distance,
but it can be a big deal if you're trying to get somewhere far away, using an inefficient
algorithm can be a bigger problem for bigger or more complex problems.
Flowchart
A flowchart is a diagram that describes the sequences of an algorithm in the correct order.
These diagrams show a step-by-step way of solving a problem. Before you start developing
the programming, you can use flowcharts to express your ideas about how to solve a
problem with the computer.
Limitations of Algorithms
There are limitations to solving problems computationally. There are two types of problems
that cannot be solved:
1. Undecidable Problems: A decision problem has only two possible outputs: a 'yes'
or a 'no: If the answer to such problems is neither 'yes' nor 'no' then they cannot be solved
by any algorithm. This is called a halting problem, where 'halting' means termi-nating. The
halting problem refers to whether a program, when given a specific input, will either accept
that input and halt or reject it. It will never enter an infinite loop.
2. Intractable Problems: The problem cannot be solved because of large numbers of inputs,
which the program cannot process because of inefficient or slow algorithms.
It represents six programming constructs, used to describe the control flow of the algorithm.
1. SEQUENCE: represents linear tasks sequentially performed one after the other.
Always capitalize the initial word (often one of the main six constructs).
Always end multi-line sections using any of the END keywords (ENDIF, ENDWHILE, etc.).
Use the naming domain of the problem, not that of the implementation. For instance:
"Append the last name to the first name" instead of "name = first or last."
Conditional Statements
Conditional statements, expressions, or simply conditionals are features of programming
languages that tell the computer to execute certain actions, provided certain conditions are
met.
1. IF STATEMENT
If statement is used to check whether a condition is true or false. The 'If' keyword is used to
write this statement. Let's consider the following statement.
2. If-Else Statement
If-Else statement is an extension to the if statement. If the condition is true, a bloo of code
will execute, else another block of code will run.
Nesting
Nested loops are loops within loops. This can be useful in making drawings that a repeated
by slightly change each time. Nested loops can be used in Scratch and Puthen both ore
Nesting is a concept in computer programming and algorithmic thinking that refers to placing
one thing inside another. It is a way to structure and organise code, making it easier to read
and understand.
For example, imagine you have a list of names, and you want to sort the names in
alphabetical order. You might write a program that looks like this:
4. If the first letter is A-M, put the name in the "A-M" group
5. If the first letter is N-Z, put the name in the "N-Z" group
This program uses nesting because it has one set of instructions (steps 2-5) that are
contained inside another set of instructions (step 1). The instructions in the "nested"set
(steps 2-5) are only carried out for each name in the list.
Nesting is a useful technique in programming because it allows you to write code that can be
repeated multiple times, or that can be customized for different situations. It is an important
concept to understand when learning how to program, and it is used in many different types
of software.
Variables
In a programming language, Variables are words that are used to store values of any data
type. In simple words, when you create a variable, it takes up some memory space based on
the value and the type you set to it. The variables' values can be altered at any time during
the program. An Identifier is a term used in programming language in onder to denote the
unique name given to these variables.
Constants
The value of Constants cannot be changed throughout the program. Certain values are fixed
and are universally proven to be true. These values cannot be changed over time. Such
types of values are called constants.