Understanding Algorithmic Thinking Basics
Understanding Algorithmic Thinking Basics
Profile
What is an algorithm?
What is algorithmic thinking?
How will the algorithms communicate?
Why are algorithms important?
What are the main properties of algorithms?
• An example - how to create an algorithm
What is an algorithm?
An example algorithm is shown in seven steps. This algorithm explains how to make 'frozen lemon'.
cake fridge" (which is this author's favorite dessert).
Step 1: Pour a can of refrigerated condensed milk into a bowl.
Step 2: Whip the animal milk until peaks form.
Step 3: "Fold" 1 cup of sugar and 1/2 cup of lemon juice.
Step 4: If you want more lemon flavor, add 1 teaspoon of lemon zest.
Step 5: Extend a cookie crust on the bottom of a 13" by 9" pan.
Step 6: Pour the mixture of the domestic animal's milk into the pan.
Step 7: Place in the freezer until frozen.
Before leaving this example, ask yourself if the steps for this algorithm meet the mentioned criteria.
previously. That is, each step is clear, executable, and in the correct order?
This reading explains the concept of algorithms, some important properties of algorithms, and how they are
create algorithms, executed and validated.
What is algorithmic thinking?
Algorithmic thinking is the ability to understand, execute, evaluate, and create algorithms. We will discuss each
one of these ideas separately.
To be an algorithmic thinker, one needs the ability to understand and execute algorithms. Some people
find it easier to follow a series of precise instructions, while other people find it very difficult.
difficult. Some people seem to lack the patience and diligence needed to follow a step-by-step plan.
step. However, it is a valuable skill that everyone should master. Algorithmic thinking
requires patience, because each instruction must be executed in its correct sequence without skipping ahead or
overlooking some of the instructions. In addition, the algorithmic thinking to demand diligence and the
perseverance. It is often tedious to follow the steps of a complex algorithm, and people sometimes do not complete it.
an algorithm, since simply "giving up."
Algorithmic thinking also requires the ability to evaluate algorithms. It involves determining whether a
algorithm really solve a specific task. This can be very difficult. For example, a 'list of
"Pre-flight check" is an algorithm for preparing an airplane for takeoff. Let's assume that they were given
the task of determining whether a new 'pre-checklist' for the F35 (Joint Strike Fighter) is correct
(check all systems on the plane correctly) and complete (controls will not be carried out)
important). We hope that you would agree that this is an important job - the life of the pilot
it depends on doing things right - and that obtaining the correct and complete checklist will not be easy.
Note aside, one way to create the pre-checklist is to determine the blame of each one who crashed.
the new plane and add a new checklist to the list to prevent future accidents. However, the cost in lives and
money is too big. We need to get the right algorithm and complete it before the first
plane that takes off in order to avoid a loss of a single aircraft!)
And finally, algorithmic thinking includes the ability to create new algorithms. This is probably the
most challenging aspect of algorithmic thinking. Given a task, it can create a series of precise,
step by step the instructions that always solve the task correctly? Obviously, the complexity of the
The task has a great impact on the complexity of an algorithm that can perform the task. Simple tasks
typically can be achieved with simple algorithms, while complex tasks typically require
more complex algorithms.
A critical aspect of algorithm creation is the 'white executor' of an algorithm. For example, the 'target executor.'
a pre-checklist is a pilot. The average person on the street could not execute the list of
previous verification correctly, as it does not understand the instructions. The three, as previously indicated,
the characteristics of an algorithm instruction (that is, an instruction must be unambiguous, executable, and ordered
a) it must be consistent with the knowledge and experience of the "target executor." When creating an algorithm,
make sure that each instruction can be clearly interpreted and executed by the 'target executor.'
We live in the "information age," where many of the tasks that people need (or want) to do are
can be performed by computers. However, computers today do not have a real understanding
or cognition - that they can only perform tasks that people have developed algorithms to solve. For
So, to create algorithms that computers can execute, you must understand what a computer is.
capable of executing and able to write a series of unambiguous instructions that a computer can
execute successfully. For the rest of this document, we will limit our discussion to the development of algorithms
that can be executed on computers.
Many programming languages have been developed over the years and each language has its own
special features and benefits. You have probably heard of some of these languages, such as C,
C++, Pascal, Basic, Java, Perl, Python, and Ada. A significant amount of time is required to learn a
new programming language and it is not a goal of CS110 to teach you how to program computers. We want
that the cadets become better problem solvers by becoming thinkers
algorithmic. One of the most common ways to express algorithms without the need to use a language of
Programming called flowcharts. Flowcharts provide a visual description of a process.
step by step. The biggest drawback of using flowcharts is that they are tedious to draw and difficult to
modify if they are hand-drawn on paper. A computer program called RAPTOR was
developed by Doctor Carlisle here at the USAF Academy, which allows a person to create an algorithm
in the form of a flowchart and then execute the flowchart to test its validity. Very
Cool! We are going to discuss the details of how to use RAPTOR in future lessons.
Consider the possibility of telephones, for example. When telephones were invented, the problem of how
connecting a phone call to another person who is calling has been a problem for many years.
It was manually resolved by the telephone operators who removed the cables from the console and connected the
cables in the correct connection. It has been calculated that if this manual method is still used today to handle the
current daily phone calls made worldwide, each person on the planet would have to be a
telephony operator! Fortunately, due to the invention of computers and fast algorithms for
instruct the computers, almost all phone calls made today are automatically connected without
human intervention. What would your life be like without a phone? Can you imagine it? Without the algorithms, which is the way
What would life be like!
Algorithms are studied in CS110 because algorithmic thinking is transferable. If you can think and
reasoning accurately and solving algorithmic problems in a domain (for example, programming of
computers), then their ability to analyze and solve problems in other areas will improve.
Property 1: For any given task (or related tasks), it is not trivial, there are many algorithms.
possible to carry out the task.
This greatly confuses many students. "Do you mean that there is more than one correct answer?"
The answer is YES! Remember that an algorithm is not the solution to a problem, but rather a step-by-step set.
the instructions to find a solution. Is there only one way to go from Mitchell Hall to Arnold Hall?
Property 2: An algorithm does not encode the theory underlying the instructional measures.
An algorithm explains how to perform a task. If the algorithm is correct, and if you follow the instructions
Exactly, it will carry out the task. But you cannot understand why some of the steps were taken. If a
the team is running an algorithm, this lack of understanding is not a problem. If a person is trying
to understand an algorithm so that it can be updated or improved, this lack of understanding can lead to
changes almost impossible. Complex algorithms often come with the documentation that provides a
detailed explanation of how they work.
The execution of an algorithm requires a certain amount of time. If an algorithm is used frequently, its
efficiency becomes a problem. It is common to create multiple algorithms to perform a task in
particular and then select the fastest algorithm to include in a final product. One of the development challenges
the software is to decide how much time and effort should be dedicated to the search and development of more algorithms
efficient.
Property 4: Computer programs that have been used for many years usually must be
modified over time to adapt to the changes in task requirements.
Computer programs are generally not static objects. They require 'maintenance' to
keep them updated with changes in task requirements. For example, a software program that calculates
income taxes should change every year as income tax laws change. Some
studies have shown that up to 75% of software development costs are consumed by the
maintenance of existing software.
In conclusion, when new algorithms are developed, they attempt to create one of the many possible sequences.
of instructions that will solve our task at hand. Ideally, we would like the algorithm to execute
quickly and be good,” he commented, “so it can easily be maintained over time.
Example problem: two people work for the same company and have a combined total salary of dollars
W, but one person earns Q dollars more than the other person. How much does each of them earn?
Principle 1: Solve a specific case of the problem by hand, with pencil and paper.
A specific example of a problem is when all the 'variables' are given a specific value. Let's suppose
Let W be $57.00 and Q be $5.00. Now the problem reads:
Specific
Problem
Instance: Two people work for the same company and have a combined total salary of $57.00, but one
persona gana $ 5.00 dólares más que la otra persona. ¿Cuánto gana cada uno de ellos?
There are multiple ways to think about this problem. Two possible solutions are:
Arithmetic reasoning: algebraic reasoning:
Out of the $57, Person1 receives $5 more than Person2.
Therefore, both will equally share $57 - $5 = $52.
Principle 2: Generalize the solution by replacing the specific instance values with 'variables'.
Persona1 gets (W - Q) / 2 + Q
Person2 gets (W - Q) / 2 Sea X = salary of Person1
What pays Y = Person2 of.
Therefore, we know that the problem of:
X=Y+Qy
X+Y=W.
Solve these equations 2 by substitution:
(Y + Q) + Y = W
Y = (W - Q) / 2
Therefore X = (W - Q) / 2 + Q
Principle 3: manual for executing the algorithm on various test cases to verify that responses are produced
correct. This is called desktop control or walking through the algorithm.
.
Ejemplo 1: W = 100, Q = 10
Persona1 = (100 - 10) / 2 + 10 = 55
Person2 = (100 - 10) / 2 = 45
(This is correct because 55 + 45 = 100 and Person1 earns 10 dollars more than Person2)
Example 2: W = 31, Q = 2
Person1 = (31 - 2) / 2 + 2 = 16,5
Person2 = (31 - 2) / 2 = 14.5
(This is correct because 16.5 + 14.5 = 31 and Person1 earns 2 dollars more than Person2)
Principle 4: After a general solution to the known task, write the correct instructions for
programming to implement the solution on the team.
How to write the correct programming instructions will be discussed in the upcoming lessons.