Topicmc4e4e9513448e945_1528449000663_0Topic

From problem to algorithmalgorithmalgorithm

Levelmc4e4e9513448e945_1528449084556_0Level

Second

Core curriculummc4e4e9513448e945_1528449076687_0Core curriculum

Grades IV‑VI

I. Understanding, analysing and solving problems. The student:

2) formulates and writes in the form of algorithms instructions which form:

a) the solutions to problems of everyday life or from various subject areas.

Timingmc4e4e9513448e945_1528449068082_0Timing

45 minutes

General objectivemc4e4e9513448e945_1528449523725_0General objective

Understanding the basic principles of creating algorithms.

Specific objectivesmc4e4e9513448e945_1528449552113_0Specific objectives

1. Can define the problem to be solved.

2. Acquiring the ability to determine the next steps to solve a simple problem.

Learning outcomesmc4e4e9513448e945_1528450430307_0Learning outcomes

The student:

- can provide a way to solve a simple problem,

- can create simple algorithms.

Methodsmc4e4e9513448e945_1528449534267_0Methods

1. Discussion.

2. Flipped classroom.

Forms of workmc4e4e9513448e945_1528449514617_0Forms of work

1. Student's own work.

2. Group work.

Lesson stages

Introductionmc4e4e9513448e945_1528450127855_0Introduction

Answer the introductory questions:

1. What is an algorithmalgorithmalgorithm?
2. Provide a recipe for boiling water in an electric kettle?
3. Will the recipe for boiling water in the kettle on the stove look the same?
4. Suggest a recipe for boiling water describing both cases.

Discuss answer in the class forum.

Proceduremc4e4e9513448e945_1528446435040_0Procedure

Certainly you have already realized that electronic devices, including computers, tablets or smartphones, work strictly according to the „recipes” developed by people. However, before the programmer enters the code into the memory of such a machine, on the basis of which it will perform the tasks assigned to it, it is necessary to carefully analyse what the device should do and in what situation. Seemingly, it seems to be simple, but when we start to create such a recipe, which is technically called an algorithm, it turns out that it is complicated and many situations have to be anticipated.
Let's try to create an algorithm for ... an elevator - a device we often use.
mc4e4e9513448e945_1527752256679_0Certainly you have already realized that electronic devices, including computers, tablets or smartphones, work strictly according to the „recipes” developed by people. However, before the programmer enters the code into the memory of such a machine, on the basis of which it will perform the tasks assigned to it, it is necessary to carefully analyse what the device should do and in what situation. Seemingly, it seems to be simple, but when we start to create such a recipe, which is technically called an algorithm, it turns out that it is complicated and many situations have to be anticipated.
Let's try to create an algorithm for ... an elevator - a device we often use.

Imagine that the elevator runs only between two floors:

- ground floor level,
- first floor level.

Our algorithmalgorithmalgorithm in the simplest case will be based on the following commands:

- go up,
- go down,
- stop the elevator,
- open the door,
- close the door.

And information:

- the call button was pressed on the ground floor,
- the call button was pressed on the first floor,
- the „to the ground floor” selection button was pressed in the elevator,
- the „to the first floor” selection button was pressed in the elevator.

And the variablevariablevariable „storey”, which will take the valuevaluevalue 'ground floor' if the elevator will be located on the ground floor or 'first floor' when it is on the first floor.

The simplest algorithmalgorithmalgorithm that would cause a passenger who approaches the elevator on the ground floor to go up, would look like this:

- if „the call button was pressed on the ground floor” - open the door,
- if the „to the first floor” selection button was pressed in the elevator - close the door,
- go up,
- if level = „first floor” - stop the elevator,
- open the door.

The algorithm is very simple, but we actually assumed that the elevator is downstairs waiting for the passenger, and that does not have to be true.

So it's time for you.

Task 1

Rewrite the algorithmalgorithmalgorithm so that the elevator works as before, but in addition:

A: first it goes down to the passenger, if it was left upstairs.
B: it serves both passengers going up and down.
C: additionally, it serves the third storey (basement).

When you deal with the above tasks, think that the real elevator still:

- reacts to the „stop” emergency button,
- takes passengers on the way from other storeys if they pressed the call button in the direction in which the elevator moves („up or down”),
- will not stop „on the way” if there is already a maximum number of passengers in the elevator.

The commands used by you in the algorithms are written using the graphic symbols shown in the interactive picture.

[Interactive graphics]

Lesson summarymc4e4e9513448e945_1528450119332_0Lesson summary

An algorithm is a procedure that ultimately leads to a specific effect. The algorithm should be correct, finite, effective, unambiguous and universal. It means that it should cover all possible cases describing a given situation. In the end it should always give the correct result after completing the finite number of actions.mc4e4e9513448e945_1527752263647_0An algorithm is a procedure that ultimately leads to a specific effect. The algorithm should be correct, finite, effective, unambiguous and universal. It means that it should cover all possible cases describing a given situation. In the end it should always give the correct result after completing the finite number of actions.

Selected words and expressions used in the lesson plan

algorithmalgorithmalgorithm

codecodecode

commandcommandcommand

constantconstantconstant

final resultfinal resultfinal result

instructioninstructioninstruction

programmerprogrammerprogrammer

recipereciperecipe

valuevaluevalue

variablevariablevariable

mc4e4e9513448e945_1527752263647_0
mc4e4e9513448e945_1527752256679_0
mc4e4e9513448e945_1528449000663_0
mc4e4e9513448e945_1528449084556_0
mc4e4e9513448e945_1528449076687_0
mc4e4e9513448e945_1528449068082_0
mc4e4e9513448e945_1528449523725_0
mc4e4e9513448e945_1528449552113_0
mc4e4e9513448e945_1528450430307_0
mc4e4e9513448e945_1528449534267_0
mc4e4e9513448e945_1528449514617_0
mc4e4e9513448e945_1528450135461_0
mc4e4e9513448e945_1528450127855_0
mc4e4e9513448e945_1528446435040_0
mc4e4e9513448e945_1528450119332_0
algorithm1
algorithm

algorytm

RgH5syagLTXeE1
wymowa w języku angielskim: algorithm
variable1
variable

zmienna

RCBeE3UIqQDMk1
wymowa w języku angielskim: variable
value1
value

wartość

RkcOiDV89Jt0V1
wymowa w języku angielskim: value
code1
code

kod

R1JorZ2D5ClUr1
wymowa w języku angielskim: code
command1
command

polecenie

RjncVhVx1BA7L1
wymowa w języku angielskim: command
constant1
constant

stała

RzEPgfwX9ZtAR1
wymowa w języku angielskim: constant
final result1
final result

wynik końcowy

R1Tgd5Q2ioUm91
wymowa w języku angielskim: final result
instruction1
instruction

instrukcja

RyCCuvEkuAYh81
wymowa w języku angielskim: instruction
programmer1
programmer

programista

R1YBSnOoEIops1
wymowa w języku angielskim: programmer
recipe1
recipe

przepis

R1PGNtrm1bwLD1
wymowa w języku angielskim: recipe