Session 4
Creating simple algorithms to reach a single destination along the shortest route
Objectives
• Identify different algorithms to reach the same destination
• Select the most efficient algorithm and create the code for this
• Begin to debug a sequence of instructions
Resources | Vocabulary |
---|---|
• Levels 13 to 14 in Rapid Router • Computers or large tablet devices with www.codeforlife.education/rapidrouter/ bookmarked • Projector or Interactive Whiteboard (IWB) • Resource sheets | • Shortest, longest • Route |
Let’s get started
Display level 13 of Rapid Router on the IWB [fig S4.1].
Is there more than one way to get to the house? In pairs, give the students a printed copy of pupil resource sheet 1 to discuss and work out the possibilities.
Ask a student to trace their route on the IWB.
Discuss: In real life, van drivers need to be efficient and get their deliveries to the houses as quickly as possible. This usually means taking the shortest route.
Which do you think is the shortest route?
How can we work out the distance the van travels? (You could count this in terms of the grid squares travelled through).
Work out the total distance for the route. Students can record this on a whiteboard.
Look at a different route. Is it longer or shorter? How can we check?
Together, build the code for the route the class thinks is the shortest.
Individual or paired activity
Students use levels 13 and 14 of Rapid Router for this activity. Discuss which the shortest route is each time.
Note — if some students need a further challenge, go to the create (level editor) mode and set up some new routes for them to navigate. Save the routes and share with the class [fig S4.2].
Alternatively, use resource sheet 2 [fig S4.3], which has similar but different routes.
Share and review
Explain the code for an inefficient route at level 14 [fig S4.4] using the IWB.
Ask a pair of students to come up and improve the program, so that the van travels a shorter or the shortest route.
Using the word ‘code’, can you explain what you have done?
Talk about how much shorter the new route is.
Assessment
Look at resource sheet 3 [fig S4.5].
How many different routes can you spot? Which is shortest?
Discuss what they have learnt in this session.
Extension follow–up
Use resource sheet 4 to investigate how many different routes you can find using a distance of 10 grid squares to go from A to B [fig S4.6].
Cross–curricular links
Mathematics
• Number and computation — consolidating number bonds to 20
• Mathematical thinking — following the unplugged extension activity, some students will understand the concept that the total distance travelled is the sum of all the horizontal distances plus the sum of the vertical distances
• Two different routes may cover the same distance but would they take the same time in real life?
• If you have to make more turns in one route it may take more time
Literacy
• Talk about the stories you have read where vehicles make journeys — Postman Pat, the Jolly Postman etc.
Geography
Talk about how we use plans and maps to find our way from one place to another and look at a plan of the school as an example
Last updated