Learning Objectives Understand the term and processes in

Learning Objectives • Understand the term and processes in computational thinking. • Be able to use the skills of: − Abstraction − Decomposition − Pattern Recognition − Algorithms Lesson Title – Unit 2. 1 Algorithms Lesson 1 (Your page and title have already been created by Mr Frith in Class Notebook, please open this page and complete your work) © OCR 2016

Student Expectations 1. 2. 3. 4. 5. Turn off your camera. Mute your microphone (unless your teacher asks you to unmute). Engage in the lesson and only use the chat facility to ask or answer questions related to the lesson. All chat is recorded and is sent to Mrs Wilson and your Head of Year at the end of each session. Inappropriate behaviour will result in a phone call or a home visit during the lesson and you will be removed from the lesson by the teacher. © OCR 2017

© OCR 2016

2. 1 Algorithms Lesson 1 What is meant by an algorithm? Stretch: What can you tell me about the CPU? Create Hint: Think about the a mind map process of instructions © OCR 2016

Algorithms are one of the four cornerstones of Computer Science. An algorithm is a plan, a set of step-by-step instructions to solve a problem. If you can tie shoelaces, make a cup of tea, get dressed or prepare a meal then you already know how to follow an algorithm. © OCR 2016

Breaking a complex problem down into smaller problems and solving each one individually It involves finding the similarities or patterns among small, decomposed problems that can help us solve more complex problems more efficiently Picking out important bits of information from the problem, ignoring the specific details that don’t matter A logical way of getting from the problem to the solution. © OCR 2016

In an algorithm, each instruction is planned and then carried out. Algorithms are often used as a starting point for creating a computer program, and they are sometimes written as a flowchart or in pseudocode. If we want to tell a computer to do something, we have to write a computer program that will tell the computer, step-bystep, exactly what we want it to do and how we want it to do it. This step-by-step program will need planning, and to do this we use an algorithm. © OCR 2016

Flowchart………. Pseudocode © OCR 2016

Pseudocode In pseudocode, INPUT requires you to enter something. OUTPUT prints a message on screen A simple program could be created to ask someone their name and age, and to make a comment based on these. This program represented in pseudocode would look like this: OUTPUT 'What is your name? ' INPUT user inputs their name STORE the user's input in the name variable OUTPUT 'Hello' + name OUTPUT 'How old are you? ' INPUT user inputs their age STORE the user's input in the age variable IF age >= 70 THEN OUTPUT 'You are aged to perfection!' ELSE OUTPUT 'You are a spring chicken!' © OCR 2016

My First Algorithm Have a go at creating your own Pseudocode OR Flowchart for making a cup of tea Challenge: Try to include even more options! Size of mug, what about a coffee? Biscuits? Hint: Do not worry if you are finding it difficult! Just try your best © OCR 2016

Breaking a complex problem down into smaller problems and solving each one individually It involves finding the similarities or patterns among small, decomposed problems that can help us solve more complex problems more efficiently Picking out important bits of information from the problem, ignoring the specific details that don’t matter A logical way of getting from the problem to the solution. © OCR 2016

Abstraction Picking out important bits of information from the problem, ignoring the specific details that don’t matter © OCR 2016

Abstraction In order to draw a basic cat, we do need to know that it has a tail, fur and eyes. These characteristics are relevant. From the general characteristics we have (tail, fur, eyes) we can build a basic idea of a cat. Abstraction allows us to create a general idea of what the problem is and how to solve it. The process instructs us to remove all specific detail, and any patterns that will not help us solve our problem. © OCR 2016

Abstraction Consider how abstraction would be used to represent a map on a computer • Towns/places would be represented with their name, maybe a circle or shape • Roads would be lines • Hedges, houses etc. would not be in the model © OCR 2016

Decomposition Breaking a complex problem down into smaller problems and solving each one individually © OCR 2016

Decomposition • The breaking down of large problems into smaller problems: − Smaller problems are easier to solve − They can be tested independently − Then combined to produce the full problem © OCR 2016

Decomposition example We do many tasks on a daily basis without even thinking about – or decomposing – them, such as brushing our teeth Example: Brushing our teeth • To decompose the problem of how to brush our teeth, we would need to consider: • which toothbrush to use • how long to brush for • how hard to press on our teeth • what toothpaste to use © OCR 2016

Pattern Recognition It involves finding the similarities or patterns among small, decomposed problems that can help us solve more complex problems more efficiently © OCR 2016

Pattern Recognition • When we break down a complex problem we often find patterns among the smaller problems we create • It involves finding the similarities or patterns among small, decomposed problems that can help us solve more complex problems more efficiently. © OCR 2016

Pattern Recognition Example • All dogs share common characteristics. Among other things they all have eyes, tails and fur • Because we know that all dogs have eyes, tails and fur, we can make a good attempt at drawing a dog, simply by including these common characteristics • In computational thinking, these characteristics are known as patterns. Once we know how to describe one dog we can describe others, simply by following this pattern. © OCR 2016

Answer the following questions: • What are the 4 cornerstones of Computational thinking? • Explain each cornerstone with an example • What is meant by input and output? Challenge: Complete the ME time stretch in the chat © OCR 2016

Stretch Create an algorithm including the steps involved with making a cup of tea, these are the steps: • Put the teabag in a cup. • Fill the kettle with water. • Boil the water in the kettle. • Pour some of the boiled water into the cup. • Add milk to the cup. • Add sugar to the cup. • Stir the tea. • Drink the tea. © OCR 2016

Complete the pseudocode by filling in the empty spaces Get ______ Put _____ in cup Put _____ on If kettle boiled ____ else wait until boiled Let it brew If ________ else don’t put milk in If person wants sugar, ____ else stir mug _____ If not sweet enough add sugar else enjoy!!! Stretch © OCR 2016

Get ______ Put _____ in cup Put _____ on If kettle boiled ____ else wait until boiled Let it brew If ________ else don’t put milk in If person wants sugar, ____ else stir mug _____ If not sweet enough add sugar else enjoy!!! © OCR 2016

Get teabag Put teabag in cup Put kettle on If kettle boiled pour in water else wait until boiled Let it brew If person wants milk, add milk else don’t put milk in If person wants sugar, put sugar in else stir mug Taste tea If not sweet enough add sugar else enjoy!!! © OCR 2016

• Write the definitions for: − − − Computational thinking Abstraction Decomposition Algorithm Pattern Recognition © OCR 2016
- Slides: 26