Learning Objectives • UnderstandingAlgorithmic thinking • Identify the difference between algorithmic thinking and algorithms • Importance and application of algorithmic thinking • Graphical representation of algorithms by Flowcharts
3.
What is AlgorithmicThinking? • Let's define Algorithm first: "An Algorithm is a method to solve a problem that consists of exactly defined instructions”[1] • Algorithmic thinking is a competency that allows us to understand and construct algorithms to solve a problem. • Algorithmic thinking is a key skill in the field of computing that can be developed independently of any programming language. • Algorithmic thinking is not limited to the field of computing and can be applied in other disciplines and daily life. [1]Futschek, G. (2006, November). Algorithmic thinking: the key for understanding computer science. In International conference on informatics in secondary schools-evolution and perspectives (pp. 159-168). Springer, Berlin, Heidelberg.
4.
Algorithmic Thinking Includes: •Being able to precisely define the problem • The ability to analyze a given problem • Identify the fundamental steps required to solve a given problem • Thinking about all scenarios and cases of the given problem • Defining a set of detailed instructions to solve the problem (designing the algorithm) • Examining the developed algorithm and improving its efficiency Futschek, G. (2006, November). Algorithmic thinking: the key for understanding computer science. In International conference on informatics in secondary schools-evolution and perspectives (pp. 159-168). Springer, Berlin, Heidelberg.
5.
Importance of Algorithmic Thinking •There is an algorithm behind any computer program. • Algorithmic thinking is the core skill required for programming. • To be able to develop robust programs we need to invest time in developing efficient algorithms before coding. • We need to train our brains to understand the algorithmic logic and improve its algorithmic thinking skill to be able to intuitively develop algorithms.
6.
Algorithmic Thinking Example For sortingstudents' papers alphabetically based on their last name, the basic algorithm would be like this: • Skip the first name • Take the first character of the last name • Put it in the list alphabetically • If another paper exists with the same first letter of the last name, then compare the first letter of the first name and sort accordingly. • Continue until no paper is left unsorted. Another example of the algorithms in everyday life is when you follow a recipe to make a meal, start the car and drive to school, traffic lights, etc. What other algorithms you follow daily? Name some of them
7.
Examples of Algorithms in Computer Science •Algorithms are the core of computer science. • Computers don't think. We need to think for them by creating the algorithms and providing details for them about what they should do to accomplish a task. • Examples of Algorithm in CS that you use daily are: • Google search • Google map • ATM • Logging into your electronic accounts. • Can you think of more CS algorithms you use daily and explain the steps?
8.
Algorithms in Games andEntertainments • Algorithms play a big role in developing games and the entertainment industry. • They mostly use specific types of algorithms such as Finite State Machines (FSM), or decision trees. Consider a game that you like to play. Think about the steps you follow to play it and explain it in the form of itemized steps.
9.
Sample Algorithm: • Setvariables X with a number between (1 to 9). • Divide X by 2. • Store the remainder in variable Y. • If Y equals 0, print X is even. • Else, If Y equals 1, print X is odd. This algorithm explains in detail how to write a code that determines if an input integer number between 1 to 9 is odd or even.
10.
Flowcharts and Algorithms • Flowcharts canbe seen as graphical representations of algorithms. • Flowcharts are more intuitive and make it easy to understand the algorithms. (depending on the complexity of the problem however, sometimes algorithms may better represent the steps to solve the problem) • We use standard symbols and shapes in a Flowchart to show the sequential steps of an algorithm.
Flowchart Example • Let'smake a flowchart for the algorithm of finding odd/even numbers: •Set variables X with a number between (1 to 9). •Divide X by 2. •Store the remainder in variable Y. •If Y equals 0, print X is even. •Else, If Y equals 1, print X is odd. •This algorithm explains in detail how to write a code that determines if an input number is odd or even. Yes No