Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit 2.1 – computational thinking & Algorithms

Similar presentations


Presentation on theme: "Unit 2.1 – computational thinking & Algorithms"— Presentation transcript:

1 Unit 2.1 – computational thinking & Algorithms

2 Thought for the day … How many problems, or decisions do you think you make each day? How many actions do you take? How many thoughts do you have? How do you know what order to do things eg get dressed in the morning? Does everyone make lasagna in the same way? Does everyone put cheese on top or below the toppings of a pizza? Does it matter?

3 The Big Picture: Algorithms (Paper 2)
For this topic you need to know: computational thinking: abstraction, decomposition and algorithmic thinking – briefly, need to go over standard searching algorithms: binary and linear search standard sorting algorithms: bubble, insertion and merge sort how to produce algorithms using pseudocode and flow diagrams – early Y10, need to go over this interpret, correct or complete algorithms – homeworks this year, need to go over this

4 In today's lesson: What are we learning today? Why are we learning it?
Understand the computational thinking and processes in computational thinking. Why are we learning it? You need to understand and apply the skills of Abstraction Decomposition, Algorithmic thinking. How will it help reach your OPT? You need to understand to answer 1-4 mark questions You need to be able to combine your understanding of all the algorithms topics to answer questions worth more marks How long? 2-3 lessons

5 Learning Objectives Understand the computational thinking and processes in computational thinking. Be able to use the skills of: Abstraction Decomposition Algorithmic thinking.

6 Introduction Computational thinking is an approach to problem solving used by us every day without us realising. Computational thinking is about taking a complex problem and being able to use several ‘computational thinking techniques’ to: Fully understand the problem Decide if it can be solved computationally by breaking it down into parts Identify the key steps in a possible solution Create an effective solution. Can all problems can be solved computationally? This problem solving approach is not only important for programmers when devising software solutions, it is also an approach used in all areas of science to effectively enable complex processes to be understood.

7 Computational thinking definition
Computational thinking describes the processes and approaches we draw on when thinking about problems or systems in such a way that a computer can help us with these. Computational thinking is not thinking about computers or like computers. It is about looking at a problem in a way that a computer can help us to solve it. When we do computational thinking, we use the following processes to tackle a problem: Computational Thinking Abstraction Decomposition Algorithmic Thinking

8 Computational thinking in the real world
Getting computers to help us to solve problems is a two-step process: 1. First, we think about the steps needed to solve a problem. 2. Then, we use our technical skills to get the computer working on the problem. Take something as simple as using a calculator to solve a problem in maths. First, you have to understand and interpret the problem before the calculator can help out with the arithmetic bit. Similarly, if you’re going to make an animation, you need to start by planning the story and how you’ll shoot it before you can use computer hardware and software to help you get the work done. In both of these examples, the thinking that is undertaken before starting work on a computer is known as computational thinking.

9 Computational thinking in the real world
Although computational thinking describes the sort of thinking that computer scientists and software developers engage in, plenty of other people think in this way too, and not just when it comes to using computers. The thinking processes and approaches that help with computing are really useful in many other areas of our lives and work too. For example, the way a team of software engineers go about creating a new computer game, video editor or social networking platform is really not that different from how Tesco will already have started developing a new product for Christmas this year or how a car manufacturer tackles reducing CO2 emissions. In each case: you take a complex problem and break it down into smaller problems work out the steps or rules for getting things done Reduce the complexity of the task by focusing on the key details Look at the way previous projects have been accomplished can help.

10 Computational thinking in your lessons
You will already use computational thinking in many different ways across school. When you write stories, you plan first: to think about the main events and identify the settings and the characters. In art, music or design and technology, you think about what you are going to create and you will work through the steps necessary for this, by breaking down a complex process into a number of planned phases. In maths, you will identify the key information in a problem before you go on to solve it.

11 Computational thinking in school
The steps needed to: Organise everything for your mock exams in Feb Put on a school play Organise a school trip Re-plan what we do for the rest of the year now the NEA doesn’t count! 

12 Abstraction definition
Abstraction is about simplifying things; identifying what is important without worrying too much about the detail. Abstraction allows us to manage complex problems. For example, it might use symbols, variables etc. to represent a ‘real world’ problem in a computer program... ...and removing unnecessary elements e.g. a program is to be created to let users play chess against the computer. How is abstraction used in the creation of the game? Board is created as arrays Players are objects that have positions on the board The shape and style of the pieces may not be required.

13 Abstraction in the real world
Abstraction is about moving from the real to virtual. It is concerned with simplifying the complex by only dealing with the important and neglecting the unnecessary. The London Underground map is a great example of Abstraction. The map ignores features that are not important to the passenger such as turns, distances between stations and instead provides a simplified view of journeys so that it is more simple to follow. The unnecessary information has been removed. This is a vital feature of computational thinking, to solve complex problems, we need to be able to focus on what is important and ignore the unnecessary.

14 Abstraction in your lessons
In maths, working with ‘word problems’ often involves a process of identifying the key information and establishing how to represent the problem in the more abstract language of arithmetic, algebra or geometry. In geography, you can see a map as an abstraction of the complexity of the real world environment, with maps of different scales with symbols rather than actual images In history, you are taught world history or national history as an abstraction of the detail present in local histories and individual biographies, which are themselves abstractions of actual events.

15 Abstraction in school The school timetable is an abstraction of what happens in a typical week: It captures key information such as who is taught what subject where and by whom, but leaves to one side further detail such as the learning objectives and activities planned in any individual lesson. Abstraction will be different for different purposes: Teachers are focused on target grades for pupils and what to teach to reach these grades, they’re not interested in how much credit is on your account Kitchen staff are focussed on how much money you have on your account, they’re not interested in what you’ve learned today

16 Decomposition definition
The breaking down of large problems into smaller problems: Smaller problems are easier to solve. They can be created independent of the other problems. They can be tested independently. Then combined to produce the full problem. There is not always one right answer. A problem could decomposed in several valid ways.

17 Decomposition in the real world
Software development is a complex process, and so being able to break down a large project into its component parts is essential – think of all the different elements that need to be combined to produce a program, like PowerPoint. Computer hardware development: a smartphone or a laptop computer is itself composed of many components, often produced independently by specialist manufacturers and assembled to make the finished product, each under the control of the operating system and applications.

18 Decomposition in your lessons
In science or geography, labelling diagrams to show the different parts of a plant, or the different nations which make up the UK. In English, planning the different parts of a story. In general project planning, planning a research project for any subject or working collaboratively to deliver a group presentation. In maths, breaking down a problem to solve it.

19 Decomposition in school
Organising our school’s curriculum could be decomposed as follows. Notice how important it is for the parts to integrate properly. Curriculum requirements years and subjects, further decomposed into terms units of work individual lessons or activities.

20 Algorithmic thinking definition
Identifying the steps involved in solving a problem. What are the steps involved with making a cup of tea? What are the steps involved in the calculation 200÷12? What are the steps involved in checking if a player has hit a target in a game? What are the steps involved in getting dressed for school? You’ve done a lot of algorithmic thinking since we came back – binary and linear searches, insertion, merge and bubble sorts.

21 What are Algorithms? Algorithms are the practical application of algorithmic thinking. Algorithms are simply steps/procedures used to get the intended result. Algorithms state the steps required to get to the desired result. Creating algorithms is all about thinking logically and so to think computationally is to think in a structured, organised and logical manner. Algorithms are vital to programming. Without one, coding a solution is almost impossible…but with one, coding becomes an easy job (if you know your programming syntax that is!)

22 Algorithms in the real world
Search engines such as Bing or Google use algorithms to put a set of search results into order, Your Facebook news feed is derived from your friends’ status updates and other activity, but it only shows that activity which the algorithm (EdgeRank) thinks you’ll be most interested in seeing. The recommendations you get from Amazon, Netflix and eBay are algorithmically generated, based in part on what other people are interested in.

23 Algorithms in your lessons
A lesson plan can be regarded as an algorithm for teaching a lesson. There will be a sequence of steps pupils follow for many activities, such as getting ready for lunch or going to PE. In Food, we can think of a recipe as an algorithm. In English, we can think of instructional writing as a form of algorithm. In science, we might talk about the method of an experiment as an algorithm.

24 Algorithms are independent of any language
Writing Algorithms Writing an algorithm in a specific language: Too time consuming Pointless – could just code Can’t be taken by a programmer using a different language Too complex – need knowledge of syntax (code specific to a language) Algorithms are independent of any language Writing an algorithm in everyday language: Too time consuming Open to interpretation – thus resulting in different outcomes So we use Flowcharts and pseudocode to write algorithms so that they are succinct, accurate and easy to understand so that a programmer of any language could understand the steps required to solve a task

25 Key Words Computational thinking – the use of computers to solve problems. Abstraction – representing 'real world' problems in a computer using variables and symbols and removing unnecessary elements from the problem. Decomposition – breaking down a large problem into smaller sub-problems. Algorithmic Thinking - identifying the steps involved in solving a problem. Algorithms - sequence of instructions or a set of rules to get something done.

26 Algorithms in the exam Flowcharts Pseudocode Understand them
Correct them if they have errors, Complete them if they are incomplete Produce them after being given a problem to solve Flowcharts Pseudocode

27 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Flowcharts First we will focus on Flowcharts Visual representation of the logic of a program Limited range of symbols to describe processes Arrows to show the order of instructions Easier to follow and identify issues than in pseudocode. Start Is temp < 19 Is temp > 21 Turn heating on Turn heating off Yes No Example: A central heating system will try to keep the temperature between 2 values (19 and 21) If the temperature falls below 19 It will turn the heating system on If the temperature rises above 21 it will switch the heating system off.

28 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Start and Stop Symbols All flow charts begin with a Start Symbol and at the end of the flow chart (or at various end points of the chart) we place a Stop Symbol. There are drawn as a rectangle with curved ends Flowcharts and their symbols Start Stop

29 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Process Symbols Most of the time a flow chart will demonstrate the sequence of instructions to be carried out. Simple processes (like “Add 1 to x” or “append x to List”) are shown using a standard rectangle. Flowcharts and their symbols Add 1 to x Append x to “List”

30 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Input / Output Symbols At times your program will most certainly ask the user for inputs and output values too. Inputs and Outputs (like “Name?” or “…display age”) are shown using a parallelogram. Name? Flowcharts and their symbols Store in variable “Name” Display Name

31 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Decision Symbols At times your program will be programmed to make a decision based on certain conditions. Decisions (like “IF X = 3” or “While Y > 3”) are shown using a diamond. Flowcharts and their symbols If X = 3 Yes Display “X equals 3” No Display “X doesn’t equal 3”

32 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 4 things you need to be able to do with algorithms for your exam Understand them Correct them if they have errors, Complete them if they are incomplete Produce them after being given a problem to solve

33 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 1 - Tips on reading & understanding algorithms. Start from top and follow the arrows Remember what the symbols mean Read each symbol description Logically work out what the algorithms is doing. Task: What is this algorithm doing?

34 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 2 - Tips on correcting algorithms. Start Is temp > 19 Is temp < 21 Turn heating on Turn heating off Yes No Read the flowchart and look for decisions which don’t make sense Start X = 10 while X < 10 Yes X = X + 1 Or it might be a loop which you cannot get into or perhaps out of. No End

35 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 3 - Tips on completing algorithms. Start from top and follow the arrows Remember what the symbols mean Read each symbol description Logically work out what the algorithms is doing. THEN, Use your knowledge of the algorithm so far AND Use your knowledge of the follow chart symbols …and complete the flowchart

36 Algorithms and Flowcharts
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 4 - Tips on writing algorithms. Read the task to be solved Read it again Highlight the important information Begin at the START of the problem Think logically in terms of ‘1 step at a time’ and always thinking ‘IF this were to happen, what should result?’

37 Show your understanding:
Make notes explaining what an algorithm is, what a flowchart is and the flowchart symbols for: start / stop input / output processes Decisions

38 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Pseudocode Next we will focus on Pseudocode Algorithms can be written in ‘everyday English’ as well as a flowchart Pseudo-code has keywords such as IF, ELSE and FOR and so mimics a programming language and therefore the logic is easy to follow and easy to turn into code. Although there are no STRICT STANDARDS for pseudocode there are only really a few keywords that you need and these will be shown on the next few slides. OCR have a pseudocode guide, it’s on Moodle if you want to print Example: A central heating system will try to keep the temperature between 2 values (19 and 21) If the temperature falls below 19 It will turn the heating system on If the temperature rises above 21 it will switch the heating system off. START IF Temp < 19 THEN Heating  On ELSE IF Temp > 21 THEN Heating  Off END

39 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Start and End “Key Words” Pseudocode begin with a START and ends with END The algorithm goes in between. You will need to DECOMPOSE the problem set in the question to work out what comes in between Pseudocode and their statements START …………………………….. END

40 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Process “Key Words” Most of the time pseudocode will outline the logical sequence of instructions to be carried out. Simple processes will often use the key words shown below (like “CALCULATE X*2” or “INCREMENT X by 1)” You don’t have to always use these words, for example the logic statements such as “Add 1 to x” or “append x to List” are fine too.. Pseudocode and their statements Compute Calculate Determine Increment; ++ or += Decrement; -- or -=

41 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Input / Output “Key Words” At times your program will most certainly ask the user for inputs and output values too. Inputs and Outputs (like “Name?” or “…display age”) are indicated using the following words. Usually a programmer will chose one and stick with it throughout their algorithm. Pseudocode and their statements INPUTS: READ OBTAIN GET INPUT OUTPUTS: PRINT DISPLAY SHOW OUTPUT

42 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Variable Assignment “Key Words” At times your program will assign values to variables. In pseudocode this is done using the following key words. SET INIT Pseudocode and their statements Very commonly, an arrow is used instead e.g.: X 10 This means SET X to 10

43 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Decision/Selection “Key Words” At times your program will be programmed to make a decision based on certain conditions. Decisions (like “IF X = 3, THEN …”) are shown using, unsurprisingly, the following key words. IF THEN ELSE ELSE-IF ENDIF Pseudocode and their statements

44 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Loops / Iterations “Key Words” Programs will often loop in places while certain conditions occur (infinitely) or for a set number of times (finitely). Loops use the following key words: Pseudocode and their statements FINITE: FOR INFINITE: WHILE / ENDWHILE REPEAT / UNTIL

45 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams Pseudocode and their key words / statements in action… GET Height GET Base Answer  (Base * Height) / 2 DISPLAY “Right angled triangle area” = Answer END Note: 1. Use of capitalised pseudocode key words/statements 2. Indentation GET Name FOR x = 1 TO 10 DISPLAY “Your name is” = Name END

46 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 4 things you need to be able to do with algorithms for your exam Understand them Correct them if they have errors, Complete them if they are incomplete Produce them after being given a problem to solve

47 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 1 - Tips on reading algorithms. Remember, arrows often show the assignment of a value to a variable. Here the variable is a list and will contain 5 items Start from top and read each line at a time. Remember what the key words, arrows and statements mean Logically work out what the algorithms is doing. Task: What is this algorithm doing?

48 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 2 - Tips on correcting algorithms START WHILE TRUE X Temperature IF X > 19 Heating TRUE ELSE-IF X < 21 Heating FALSE END Read the pseudocode and look for decisions which don’t make sense START X WHILE X < 10 DO X X+1 END Or it might be a loop which you cannot get into or perhaps out of.

49 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 3 - Tips on completing algorithms Start from top and understand each line in turn Remember what the keywords mean Logically work out what the algorithms is doing. THEN, Use your knowledge of the algorithm so far AND Use your knowledge of the pesudocode keywords …and complete the algorithm START INPUT Length, Width, Height objectVolume ← Print “Volume = ” END

50 Algorithms and Pseudocode
Learning Objectives: To understand… How to produce Algorithms using: -pseudocode -using flow diagrams 4 - Tips on writing algorithms. Read the task to be solved Read it again Highlight the important information Begin at the START of the problem Think logically in terms of ‘1 step at a time’ and always thinking ‘IF this were to happen, what should result?’

51 Show your understanding
Make sure you have the 3 A3 sheets, a clear logical computational thinking mind and a pen/pencil. We are going to practice 3 of skills you need for the algorithms questions: Understand them Correct them if they have errors, Complete them if they are incomplete On each one, there is a range of activities in increasing difficulty, as there would be in the exam. Start easy and work your way through but don’t give up until you have really tried!! Show Perseverance and Resilience!!! Extension: write the algorithms into Python!


Download ppt "Unit 2.1 – computational thinking & Algorithms"

Similar presentations


Ads by Google