Description of the presentation by individual slides:

1 slide

Slide description:

Analysis of block diagrams of the algorithm. “An algorithm is not a luxury, but a means to achieve a goal” * Lesson objectives: To consolidate and systematize knowledge on the basics of algorithmization; Learn to read and analyze algorithms in the form of block diagrams; Learn to compose simple algorithms. Lesson structure: Task “Check the strength of the foundation” (testing knowledge of basic concepts of algorithmization); “Read and Analyze” tasks (reading and analyzing algorithm flowcharts); Tasks “Learn to plan” (drawing simple algorithms); Homework (differentiated).

2 slide

Slide description:

Abu ‘ Abd Allah Muhammad ibn Musa al-Khwarismi “Muhammad, son of Musa, father of Abdullah, originally from Khorezm” Khorezm is a historical region in the territory of modern Uzbekistan, the center of which is the ancient city of Khiva. Al-Khorezmi, 9th century. Formulated rules for implementation arithmetic operations an exact, final sequence of actions aimed at achieving a set goal (solving a problem).

3 slide

Slide description:

“I am a part that was a whole” (I. Goethe) What concepts are reflected in the phrases below? “What, from what, how?” “Execution cannot be pardoned” “Go there, I don’t know where, bring something, I don’t know what” (Fairy tale) “Where is the beginning of the end with which the beginning ends?” (Kozma Prutkov) Concept, property, type of algorithm Answer: the property of the algorithm is understandability Answer: the type of algorithm is auxiliary; method of step-by-step detailing Answer: type of algorithm is cyclic Answer: concept of algorithm *

4 slide

Slide description:

What do these concepts mean and how are they related? name Flowchart Task “Check the strength of the foundation (testing knowledge of basic concepts of algorithmization) *

5 slide

Slide description:

Task “Check the strength of the foundation (testing knowledge of basic concepts of algorithmization) Logical chains *

6 slide

Slide description:

Task 1. A) Type of algorithm? Is the algorithm correct? B) What problem does the algorithm solve? Beginning of the “Read and Analyze” task (reading and analyzing algorithm flowcharts) *

7 slide

Slide description:

Task 2. Fragments of the block diagram are given. Determine the type and structure of the algorithm, what problem it solves. Create a mathematical formula for the function (write it on the board). X y “Read and Analyze” Tasks (reading and analyzing flowcharts of algorithms) *

8 slide

Slide description:

Task 3. (A29 demo version 2005, A6 demo version 2006) Given a fragment of a block diagram of an algorithm. What type of algorithmic design is depicted on a fragment of a block diagram? Determine the value of the integer variable x after executing the following block diagram fragment A)1; B)5; AT 2; D)3. “Read and Analyze” tasks (reading and analyzing algorithm flowcharts) *

Slide 9

Slide description:

Task 4. (A6 demo version 2005) A fragment of the block diagram (see Fig. 9) represents an algorithm that contains branching commands: 1) a branching command in an abbreviated form, which contains a branching command in full form; 2) two branch commands in full form, one of which is nested within the other; 3) two branching commands in abbreviated form, one of which is nested within the other; 4) a branch command in full form, which contains a branch command in abbreviated form Solution. Both branch commands included in the block diagram in Fig. 9, - complete, with one of them nested within the other. Therefore, answer option No. 2 will be correct. Answer: 2. “Read and Analyze” tasks (reading and analyzing flowcharts of algorithms) *

10 slide

To use presentation previews, create an account for yourself ( account) Google and log in: https://accounts.google.com


Slide captions:

Tools for presenting and recording algorithms. Block - diagrams. Types of algorithmic structures. Linear algorithm

BLOCK DIAGRAMS Means for representing and recording algorithms

Flowchart is a graphical representation of an algorithm in the form of a sequence of interconnected functional blocks (standard graphic elements), each of which corresponds to the execution of one or more actions.

Beginning of the algorithm, entering the program End of the algorithm, exiting the program Entering initial data or outputting the result Performing actions Checking logical condition Number of cycle repetitions

LINEAR ALGORITHMS Types of algorithmic structures

LINEAR ALGORITHM is an algorithm in which all stages are performed once, in strict sequence input of initial data beginning output of result end action action. . . S E R I A C O M A N D

Example 1 Example 2 start input: A, B, C output: S end P = S= start end I'll go to the river I'll sunbathe

PROBLEM SOLVING

No. 1 AND USING THE ALGORITHM FLOW DIAGRAM, CALCULATE THE VALUE OF THE FUNCTION Y AT X=2, SOLUTION: start X = 2 Z = 8 * 2 = 16 Z = √16 = 4 Z = 4 – 1 = 3 Y = 3 * 2 = 6 Y = 6 / 3 = 2 end start input: X output: Y end Z = 8 * X Z = Z - 1 Y = 3 * X Z = Y = Y / Z

No. 2 USING THE ALGORITHM BLOCK DIAGRAM, CALCULATE THE VALUE OF FUNCTION Y AT X=0; -1; 3 start input: X output: Y end Z = X 2 Y = Y * X Z = Z - 8 Y = Y * 4 Y = Z / Y Y = X + 1

No. 3 MAKE A FLOW DIAGRAM OF AN ALGORITHM FOR SOLVING THE PROBLEM. GIVEN THE COORDINATES OF THE VERTS OF TRIANGLE ABC. FIND ITS AREA.

No. 4 Make a block diagram of the algorithm for solving the problem. Calculate the distance traveled by the boat if its speed in still water is v km/h, the speed of the river current is v 1 km/h, the time of movement along the lake is t 1 hour, and against the flow of the river is t 2 hours. start input: v, v 1 , t 1 , t 2 output: s end s 1 = v * t 1 s 2 = (v – v 1) * t 2 s = s 1 + s 2

No. 5 Using this block diagram for calculating the value of a certain function, restore the condition of the problem; write a formula for calculating the value of a function. start input: X output: Y end A = X 2 C = A + B D = B + 1 Y = C / D B = A 2

HOMEWORK

DRAFT FLOW DIAGRAMS OF AN ALGORITHM FOR SOLVING THE PROBLEMS. No. 1 A square room of width A and height B has a window and a door with dimensions C by D and M by N respectively. Calculate the area of ​​the walls to cover with wallpaper. No. 2 The value A is given, expressing the amount of information in bytes. Convert A to more large units measuring information.

No. 3 Using this block diagram for calculating the value of a certain function, restore the condition of the problem; write a formula for calculating the value of a function. start input: A output: Y end B = A 2 D = C 2 E = D / 7 Y = E +5 C = B + 4

RESULTS OF THE LESSON:

Today I learned... It was interesting... It was difficult... I completed tasks... I realized that... Now I can... I learned... Gave me a lesson for life...


On the topic: methodological developments, presentations and notes

This presentation presents material for the “Algorithmization” section. The presentation covers the following concepts: algorithm, properties of an algorithm, ways of writing algorithms, linear algorithms. Problems presented...

Lesson - journey: “Algorithms. Linear algorithms"

Lesson - journey: “Algorithms. Linear algorithms"Grade: 6Purpose of the lesson: to form an idea of ​​the algorithm as a fundamental concept of computer scienceObjectives: educational: form...

Algorithm for finding the sum of 10 numbers

BLOCKS ON BLOCK DIAGRAMS

Data processing operations and storage media are depicted in the diagram by corresponding blocks.

Most of the blocks are conventionally inscribed in a rectangle with sides a and b. The minimum value of a = 10 mm, the increase in a is made by a multiple of 5 mm. Size b=1.5a. For individual blocks, a ratio between a and b of 1:2 is allowed. Within the same diagram, it is recommended to depict blocks of the same size. All blocks are numbered.

TYPES OF BLOCKS

Named

Designation

Performing an operation or group

operations as a result of which

meaning, form changes

views or arrangement

Converting data into a form,

suitable for processing (input) or

display of processing results

Selecting the direction of execution

algorithm depending on

Predopre

some variable conditions.

Using previously created and

divided

separately written programs

(subroutines).

Data output on paper

carrier.

TYPES OF BLOCKS

Name

Designation

Magnetic

Connector

Intercountry

connector

Comment

Input-output of data, the carrier of which is a magnetic disk.

Start, end, interruption of the data processing process.

Indicating the connection between broken lines connecting blocks.

Indicating the connection between broken lines connecting blocks located on different sheets.

Relationship between diagram element and explanation.

RULES FOR CREATION OF BLOCK DIAGRAMS

1. The lines connecting the blocks and indicating the sequence of connections between them must be drawn parallel to the frame lines.

2. The arrow at the end of the line may not be placed if the line is directed from left to right or from top to bottom.

3. A block can include several lines, that is, a block can be a successor to any number of blocks.

4. Only one line can come out of a block (except for a logical one).

5. A logical block can have one of two blocks as a continuation, and two lines come out of it.

6. If there is a merging of lines in the diagram, then the intersection is marked with a dot. In the case where one line approaches another and their merging is clearly expressed, the point need not be put.

7. The algorithm diagram should be performed as a single whole, however, if necessary, it is allowed to break the lines connecting the blocks.

BLOCK DIAGRAMS OF ALGORITHMS

A sequence of two or more operations; choice of direction; repetition.

Any computing process can be represented as a combination of these elementary algorithmic structures.

TYPES OF ALGORITHMS

linear;

branching;

cyclical.

LINEAR

ALGORITHMS are branching if several directions (branches) are provided for its implementation. Each separate direction of the data processing algorithm is a separate branch of calculations.

Branching in the program- this is the choice of one of several sequences of commands when executing a program. The choice of direction depends on a predetermined attribute, which may relate to the initial data, intermediate or final results. A characteristic characterizes a data property and has two or more meanings.

A branching process that includes two branches is called simple; more than two branches is called complex.

A complex branching process can be represented using simple branching processes.

Lesson “Algorithm. Forms of presentation of the algorithm. Flowcharts" Lesson on computer science and ICT, grade 9

Municipal budgetary educational institution secondary school No. 70 in Lipetsk

Goal 1) educational: study basic concepts such as algorithm, properties of algorithms, algorithm executor, forms of representation of algorithms, flow chart; 2) developing: development of logical and abstract thinking; 3) educational: to cultivate cognitive interest in the subject, to develop such qualities as perseverance and attentiveness. Word "algorithm" Word "algorithm" comes from “algorithmi” - the Latin spelling of the name of the outstanding 9th century mathematician al-Khwarizmi, who formulated the rules for performing arithmetic operations. Algorithm Algorithm– this is a description of a sequence of actions (plan), the execution of which leads to the solution of a given problem in a finite number of steps. Algorithmization is the process of developing an algorithm (action plan) to solve a problem.

Properties of algorithms

1. Discreteness 1. Discreteness– dividing the algorithm into a sequence of individual steps. 2. Massiveness- the algorithm can be used to solve a whole class of similar problems. 3. Determinism– algorithm commands must be executed in a strictly defined sequence. 4. Limb- the algorithm must lead to some result 5. Effectiveness– the algorithm must be completed in a finite number of steps. Executor Executor– an object or person who carries out instructions, prescriptions of an algorithm, program, or sequence of commands. The performer may be person, computer, robot, machine gun, mechanical device, etc. The most common form of representing an algorithm is block diagram. The most common form of representing an algorithm is block diagram. Block diagram – graphical representation of the algorithm.

Standard flowchart graphics

Indication of the beginning and end of the algorithm

Organization of data input and output

Performing an action or group of actions

Logical block (branching). Selecting the direction of algorithm execution depending on the fulfillment of the condition

Using Helper Algorithms

Repetition (cycle) – organizes

repetition of a series of actions

Example. Linear algorithm Types of cyclic algorithms

  • Loop with precondition
  • Loop with postcondition
  • Loop with parameter
Loop with precondition Task No. 1. Given the number 6. Until this number becomes greater than 45, add 7 to it and multiply by 2. As soon as the resulting number becomes greater than 45, exit the loop. Branching algorithm Task No. 2 A number is given. 5 is added to it. If this number is greater than 10, then 7 is subtracted from it; if less, 47 is added. Print the result.
  • Ugrinovich N. D. Informatics and ICT: textbook for grade 9 / N. D. Ugrinovich. – 2nd ed. – M.: BINOM. Knowledge Laboratory, 2010. – 295 p.
  • Electronic support of teaching materials:

    2. EOR on CD and DVD (set of 4 discs) for the methodological manual by N.D. Ugrinovich “Informatics and ICT. Methodological manual" for grades 8 - 11.

    Educational Internet portals:

    1. http://school-collektion.edu/ru - “Unified collection of digital educational resources”

    2. http://fcior.edu.ru, http://eor.edu.ru “Federal Center for Information Educational Resources”

    3. http://www.ed.gov.ru - Rosobrazovanie website

    4. http://www.school.edu.ru - Russian educational portal

List of used literature























Back forward

Attention! Slide previews are for informational purposes only and may not represent all the features of the presentation. If you are interested this work, please download the full version.

Target: studying algorithmic structure cycles, creation of models and algorithms for solving practical problems.

During the classes

I. Updating knowledge

  • Review the concept of an algorithm and the basic constructs of an algorithmic language.
  • Be able to develop a mathematical model, algorithm and block diagram for solving a problem.
  • Have an understanding of programming languages ​​and their purposes.
  • Be able to work in a programming environment.
  • Know program structures.
  • Be able to write expressions containing numerical and symbolic quantities.
  • Know the structures of operators and the features of their work.
  • Be able to use operators when writing programs with linear and branching structures.
  • Be able to create and run programs on a computer for debugging.

II. Theoretical material of the lesson

Most practical problems require repeated repetition of the same actions, i.e. reuse one or more operators. (Presentation)

Suppose you need to enter and process a sequence of numbers. If there are only five numbers, you can create a linear algorithm. If there are a thousand of them, it is possible to write a linear algorithm, but it is very tedious and irrational. If the number of numbers is unknown at the time the algorithm is developed, then a linear algorithm is fundamentally impossible.

Another example. To find a person's last name on the list, you need to check the first last name on the list, then the second, third, etc. until the desired one is found or the end of the list is reached. You can overcome such difficulties with the help of cycles.

A cycle is a section of an algorithm (program) that is executed repeatedly. Respectively round robin algorithm is an algorithm containing loops.

There are two types of cycles: with a known number of repetitions and with an unknown number of repetitions. In both cases, this refers to the number of repetitions at the algorithm development stage.

There are 3 types of cyclic structures:

  • Loop with precondition;
  • Loop with postcondition;
  • Loop with parameter;

Otherwise, these structures are called cycles like “While”, “Before”, “For”.

Graphic form of recording data of algorithmic structures:

Loop with precondition (aka loop Bye) has the form:

condition – expression of logical type.

The loop may not be executed even once if the value logical expression It immediately turns out to be a lie.

The series of commands between begin and end are executed until while the condition is true .

For that for the cycle to end, it is necessary that the sequence of instructions between BEGIN and END changes the value of the variables included in condition.

Loop with postcondition (aka loop before) has the form:

condition – expression of logical type.

Note:

Sequence of instructions betweenrepeat Anduntil will always be fulfilled at least once;

In order for the loop to complete, it is necessary that the sequence of statements betweenrepeat Anduntil changed the values ​​of the variables included in the condition expression.

The repeat instruction, like the while instruction, is used in a program if it is necessary to carry out some repeated calculations (a loop), but the number of repetitions is not known in advance and is determined by the progress of the calculation itself.

Loop with a parameter (aka loop For) has the form:

i – cycle parameter;
a – initial value of the cycle;
b – final value of the cycle;
h – parameter change step.

The structure of this cycle is otherwise called cycle i times.

This command is executed in this way: the parameter i is set to the initial value a, compared with the final value b, and if it is less than or equal to the final value b, a series of commands is executed. The parameter is assigned the value of the previous one, increased by h– step of parameter change and is again compared with the final value b.

In the Pascal programming language, the parameter change step can be equal to one or minus one.

If there is only one statement between begin and end, then operator brackets do not need to be written. This rule works for loops like “While” and “For”.

Let's look at an example of solving problems using these structures

Example.

Calculate the product of numbers from 1 to 5 using various loop options

Mathematical model:

Р= 1·2·3·4·5=120

Let's compose the algorithm in the form of a block diagram.

To check the correctness of the algorithm, let's fill in the trace table.

Step Operation R i Condition check
1 P:=1 1
2 i:=1; 1 1
3 i<=5
P:=P*I
i:=i+1
1 1 1<=5, да (истина)
4 i<=5
P:=P*I
i:=i+1
2 2 2<=5, да (истина)
5 i<=5
P:=P*I
i:=i+1
6 3 3<=5, да (истина)
6 i<=5
P:=P*I
i:=i+1
24 4 4<=5, да (истина)
7 i<=5
P:=P*I
i:=i+1
120 5 5<=5, да (истина)
8 i<=5
P:=P*I
i:=i+1
6<=5, нет (ложь)

Checking a condition occurs in several steps: checking the condition and executing commands on one of the branches. Therefore, the trace table does not record algorithm commands, but individual operations performed by the computer at each step.

Step one: P is assigned a value of one.

Step two: i is assigned the value one.

Step three: when i is equal to one, we check the condition one is less than or equal to five, yes, the condition is true, which means P is assigned the value one multiplied by one, there will be two. For i: one plus one equals two.

Step four: when i is equal to two, we check the condition two is less than or equal to five, yes, the condition is true, which means P is assigned the value 2 times one, it will be 2. For i: two plus one, it will be three.

Step five: with i equal to three, we check the condition three is less than or equal to five, yes, the condition is true, which means P is assigned the value of two multiplied by three, it will be six. For i: three plus one equals four.

Step six: with i equal to four, we check the condition four is less than or equal to five, yes, the condition is true, which means P is assigned the value of six times four, it will be twenty-four. For i: four plus one equals five.

Step seven: with i equal to five, we check the condition five is less than or equal to five, yes, the condition is true, which means P is assigned the value of twenty-four multiplied by five, it will be one hundred and twenty. For i: five plus one is six.

Step eight: when i is equal to six, we check the condition six is ​​less than or equal to five, no, the condition is false, then we exit the loop, and as a result we get the last value equal to one hundred and twenty.

Program Pr1;
Var i: integer;
Begin
P:=1;
i:=1;
While i<=5 do
begin
P:=P*i;
i:=i+1;
end;
Write('P=', P);
end.

For a loop with a postcondition, we will build a block diagram and a trace table. (slide16)

As a result, we get the last value equal to one hundred and twenty at the seventh step

And for the Cycle with a parameter we will build a block diagram and a trace table. (slide 17)

As a result, we get the last value equal to one hundred twenty at the sixth step

Task:

Display numbers from 1 to 5 in:

  1. direct order;
  2. in reverse order.

Mathematical model:

  1. 1 2 3 4 5;
  2. 5 4 3 2 1.

The block diagram and program for solving the problem are presented for numbers in forward and reverse order.

(slide 21)

Let us write the considered algorithms in the Pascal programming language.

(slide 22)

III. Summing up the lesson

And so we considered the following questions:

  1. Algorithmic structure cycle;
  2. Types of algorithmic structures:
    1. Loop with precondition;
    2. Loop with postcondition;
    3. Loop with parameter;
  3. We looked at ways to record these structures;
  4. We looked at examples of solving problems using these structures.