## Focus Area: Robotics

4th Grade

Day 14-15 Algorithms

**1.**:

__Vocabulary____Algorithm__- a process or set of rules to be followed in calculations or other problem-solving operations, esp. by a computer. The sequence of steps used to solve a problem or complete a task (usually in plain English and the computer does not understand)- Program - the actual instructions given to the computer
__Sequence:__a particular order in which related events, movements, or things follow each other.

__Specific__: clearly defined or identified

**2.**

__Lesson:__

Look at Algorithm Maze on page 16 of your journal

You will be creating an ALGORITHM for getting a bear through the maze

FILL OUT THE ALGORITHM TABLE AS YOU GO THROUGH THIS ACTIVITY

Talk/Walk the students through the first 3 commands demonstrating with the bear

Give us the next commands (AND WRITE THEM IN) until the maze is complete

Explain that the table including ALL the steps is known as an Algorithm

**3.**

__Activity:__1. Get with your program partner and go through the Algorithm Maze in your Journal (Page 17). Test each of the 2 algorithms. Use the bear to help you navigate.

2. For each algorithm, one partner will read the steps while the other directs the bear. After testing one algorithm, the partners will switch roles

3. Once you complete BOTH Algorithms, answer the questions found at the bottom of the page

If you finish early, talk with your partner about which algorithm was more efficient and if either could be improved to reduce the number of steps. Create your own algorithm.

As a group, go through each Algorithm

Group discussion:

TRIAL AND ERROR and the PROCESS

2. For each algorithm, one partner will read the steps while the other directs the bear. After testing one algorithm, the partners will switch roles

3. Once you complete BOTH Algorithms, answer the questions found at the bottom of the page

If you finish early, talk with your partner about which algorithm was more efficient and if either could be improved to reduce the number of steps. Create your own algorithm.

**Get back with group:**As a group, go through each Algorithm

Group discussion:

- Which algorithm was correct? Explain why you think so. How can you have 2 algorithms that work?
- Which Algorithm was more efficient? Does efficiency matter? sometimes yes, sometimes no.
- For this course we want to be as efficient as possible because it will mean fewer steps and easier coding/programming and also makes it easier to find out where our mistakes are in the coding
- Look back to the PB&J and discuss how you can switch some pieces up and the sequence still works and explain that the same can be done with Algorithms

TRIAL AND ERROR and the PROCESS

- Sometimes there are multiple ways to get from Point A to Point B, sometimes there is only one way. The process that we go through as programmers helps us to figure out what works and what doesn’t
- Often times, little tweaks are needed to make the program more efficient or even work
- PROCESS, PROCESS, PROCESS, TEST, TEST, TEST

**4.**

__Wrap-Up:__Think back to the “HOUR OF CODE” last year. All the blocks were there, but if you put them in the wrong order, was your program successful?

In this programming project, you will have all the commands (things the robot does) in front of you but if you put them in the wrong order, your robot will not be able to complete the course.

Sequence and Specifics are VERY important to programming