Computational Thinking for KS 3 Solving problems logically

Computational Thinking for KS 3 Solving problems, logically

• Why are we learning? (Purpose & Goals) We are learning how to overcome complex problems • How are we learning? (Skills, Techniques, Software, etc. ) We will be using a strategy known as Computational thinking • What are we learning? (Knowledge) We are learning the four elements of computational thinking: • Decomposition • Pattern Recognition • Abstraction • Algorithm

What is Computational Thinking? Computational thinking allows us to take a complex problem, understand what the problem is and develop possible solutions. We can then present these solutions in a way that a computer, a human, or both, can understand. There are four key techniques to computational thinking: Decomposition Pattern Recognition Abstraction Algorithm

How does it work? Watch the following video to find out about computational thinking; https: //www. youtube. com /watch? v=SVVB 5 RQf. Yxk

Starter: Human Robots • Get into pairs. • One of you is the programmer who gives instructions, the other is the robot who receives and follows the instructions. • Programmers can use the commands provided (on the programmers card). • Using these commands, can you guide your robot to a chosen point at the other end of the classroom? • Once you are there, swop roles and return to the starting point. • Robots: You must follow the instructions given to you exactly… even if they are wrong!

Robbot This is Robbot enjoys making things in the kitchen… Tell him to make a jam sandwich! We can do this through using Computational Thinking. • Decomposition: Thinking of all the things we need and things we need to do to make a jam sandwich. • Pattern Recognition: Grouping these things into categories, in this case ingredients, equipment and actions • Abstraction: Getting an idea of what our sandwich should look like. • Algorithm: Writing instructions for Robbot to follow.

1 & 2. Decomposition and Pattern Recognition: Ingredients, Equipment and Actions Ingredients Bread Equipment Plate Think of as many things as you can that are required to make a jam sandwich. The more things you can think of, the clearer your instructions will be! Actions Repeat x times Left Hand (LH) Right Hand (RH) Pick up Unscrew

3. Abstraction: Modelling your sandwich Draw a picture below of how you want your jam sandwich to look like when its finished! Use Paint or Fireworks software to do this.

4: Algorithm: Writing instructions in how to make the jam sandwich • Algorithms are most commonly written as either a Flowchart or as Pseudocode. • Flowcharts clearly show the flow and direction of your decisions in a very visual way. • Pseudocode shows each step in a clearly ordered, written structure. • Either way is fine, it’s up to your own personal preference! • Watch the following video for more information: http: //www. cambridgegcsecomputing. org/modules_lms/more? id_module=13 2620&id_course=134795&id_course_in quiry=&id_section=4137 Pseudocode Start If the statement is true Then go to Action 1 Else go to Action 2 End Above is an example of the same instructions written as pseudocode and as a flowchart. Flowchart True False

Flowchart 4. Practice writing your algorithm: Not everyone likes butter in their jam sandwich. Robbot needs a method of making sure he adds or doesn’t add butter depending on your own preference. Pseudocode Start True Could you write the flowchart instructions into pseudocode? Try adding the following key programming words; INPUT OUTPUT IF THEN ELSE START False Add the following statements correctly to the flowchart; • Do you want butter on your bread? • Spread butter on the bread • Don’t use butter

4. Algorithm: Writing your instructions 1. Write your instructions for Robbot as pseudocode using the worksheet provided. 2. Convert the instructions into a flowchart within on the next slide using the symbols below; Start / End Task (e. g. spread jam) Decision (e. g. “do you want butter? ”) Direction of flow

4. Flowchart Algorithm Create your flowchart algorithm here!

Testing your Algorithm • In pairs, take it in turns to play the roles of the programmer and Robbot. • If you are the programmer, your job is to read out the instructions. Choose between your pseudocode or your flowchart. • Robbot must follow every instruction exactly! Questions: 1. Who has a good working example? 2. Who has a bad example? ! 3. Why doesn’t it work? How could you fix it? Oops! In programming, everyone makes mistakes, they are part of the learning process! The important thing is to identify the mistake and work out how to overcome it. As a result, the more mistakes you make, the more you learn!

Task For this task, you will need to create all the resources. You can use the ones from the Robbot task if you like. • Essential: Create an algorithm to explain to Robbot how to cross the road. • Stretch: Create an algorithm to explain to Robbot how to play a game of rock paper scissors. • Challenge: Create an algorithm to show Robbot how to play a game of noughts and crosses. Remember: Use computational thinking to break down the problem into smaller parts.

Breaking down the task Task Crossing the Road Decomposition Vehicles, actions, decisions. Rock Paper Scissors Actions, choices, timings, winning conditions. Noughts and Crosses Moves that can be made, winning conditions Pattern recognition Identify the different considerations you can group together to form a pattern of what needs to be done. Abstraction Act out crossing the road. What do you do. Do you do something differently to someone else? Play the game. Think of the actions you perform. Play against someone. What strategies do you use in order to win? Algorithm Write your instructions in either pseudocode or as a flowchart.

1. Decomposition • Consider all the different features to solve the problem here.

2. Pattern Recognition • Group all the different features you considered in decomposition here.

3. Abstraction • It could be useful to write down some notes, or draw diagrams to help you clearly understand how to resolve the problem here.

4. Algorithm • Write your instructions to solve the problem here.

Testing Get three of your classmates to test out your instructions and identify any problems encountered. Use the table below to record any problems encountered and what improvements you need to make. Test 1 2 3 Problems encountered Improvements made Go back to your instructions and make any required changes. Change the font colour to red for any improved instructions.

Programming: Technical Understanding 1. Match the Keywords: Draw a line from the keyword to the correct definition. Programmer Algorithm Coding Debugging Function Parameter Extra bits of information that you can pass into a function to customise it. 2. Why is it important to test your code? A series of instructions on how to accomplish a task. Someone who writes instructions for a computer to follow. A piece of code that can be called over and over. Finding and fixing issues in code. Transforming actions into a symbolic language. 3. Which form of algorithm writing do you prefer (Pseudocode or Flowchart) and why?
- Slides: 21