Algorithm as a model of activity. What is an algorithmic model? An algorithm is a clear and precise instruction to a specific performer to perform the final task.
To use presentation previews, create an account for yourself ( account) Google and log in: https://accounts.google.com
Slide captions:
Algorithm as a model of activity 900igr.net
What is an algorithmic model? An algorithm is a clear and precise instruction to a specific performer to perform a specific sequence of actions leading to a set goal. The stages of activity from determining the goal (setting tasks) to obtaining the result are as follows: defining the goal; planning the work of the performer; performer's work; getting the result.
An algorithm is a detailed plan for the performer’s work; it is a description of the sequence of elementary actions that the performer must perform. But every plan or description is an information model. Therefore: The algorithm is information model performer's activities
Algorithmic model: Defining the goal (setting tasks) Building a plan - algorithm Work of the performer Obtaining a result Model of the work of the performer
To build a real algorithm plan that will be executed, you need to know exactly the capabilities of the performer. These capabilities are determined by the system of executive commands (SKI). When composing an algorithm, one must not go beyond the framework of the SKI. This is the understandability property of the algorithm. A programming language is a formalized language for describing algorithms.
Example of an algorithmic model Algorithm: Guessing a number Given: a range of numbers from A to B Needed: guess the number X conceived by the player using the halves algorithm. Start Ask: Is X less than the average between A and B? If the answer is “yes”, then take the integer part of the average value as value B. If the answer is “no”, then take the value A as the nearest integer greater than the average If the values of A and B are equal, then their total value is the desired number X If values A and B are not equal, then return to step 1 End
no yes no Alg Half division Integral A, B, X Start Enter A, B, X While A≠B, repeat NC If X≤(A+B)/2 Then B: = whole (A+B)/2 Else A :=integer((A+B)/2)+1 kV Kc Output A End beginning end Input A, B, X A≠B X≤(A+B)/2 B: = integer(A+B)/2 A:=integer((A+B)/2)+1 Output A
Tracing an algorithm - a model of the processor's operation When performing manual tracing, a person models the operation of the processor.
Trace table of the “Half Division” algorithm Step No. Algorithm command variables Performed actions X A B 1 Input A, B, X 3 1 8 2 A≠B 1≠8, yes 3 X≤(A+B)/2 3≤4, 5, yes 4 V: = int((A+B)/2 4 V: =4 5 A≠B 1≠4, yes 6 X≤(A+B)/2 3≤2.5, no 7 A: =integer((A+B)/2)+1 3 A: =3 8 A≠B 3=4, yes 9 X≤(A+B)/2 3≤3.5, yes 10 V: = integer( (A+B)/2 3 B:3 11 A≠B 3≠3, no 12 Conclusion A Answer: 3
The trace table is a model of how the processor operates during program execution. The program is running (first column of the table). The “Algorithm Command” column displays the contents of the processor command register, where the next command is placed. The “Variables” column displays the contents of computer memory cells (or processor memory registers) allocated for variable values. The “Action in progress” column reflects the actions performed by the arithmetic-logical unit of the processor. Thus, the algorithm, together with the trace table, completely simulates the information processing process occurring in the computer.
System of basic concepts Algorithm - model of activity Modeling object - purposeful activity of the performer Human performer Automatic performer (including a computer) Unformalized SKI Formalized SKI Forms of representation of algorithms Flowchart Educational algorithmic language Programming language Trace of the algorithm - step-by-step execution of the algorithm with a test version of the initial ones data “Manual” tracing – filling in the trace table Trace table – model of processor operation during algorithm execution
Completed by 10th grade students: Slobodenyuk Olesya Kudruk Victoria Prokopiv Olesya
On the topic: methodological developments, presentations and notes
Open lesson on computer science, grade 10 "Algorithm - model of activity"
This lesson covers all the stages of the lesson. The lesson is based on project technology. Students create mini projects in class...
Lesson topic: “An algorithm is a model of the activity of an algorithm executor. Performer Draftsman. Draughtsman management. Working in the Idol environment"
Lesson topic: “An algorithm is a model of the activity of an algorithm executor. Performer Draftsman. Draughtsman management. Work in the Idol environment"Lesson objectives: To systematize students' ideas about the...
Municipal budgetary educational institution
"Chubuklinskaya secondary school"
Zainsky municipal district of the Republic of Tatarstan
Algorithm as an activity model
(outline of a computer science lesson in 10th grade)
Computer science teacher: Safiullina R.I.
Topic: Algorithm as a model of activity
Objectives: Repeat the definition of an algorithm, recall the concept of a model and give a definition of an algorithmic model; Learn to represent any activity in the form of an algorithm graphically; recall the basic forms of representing the algorithm in the form of block diagrams. Develop the ability to plan a sequence of actions to achieve a goal. Formation of cognitive interest as a component of educational motivation.
During the classes
Organizing time
Greeting students
Updating the acquired knowledge
What is a graph? What does it consist of?
Which graph is called undirected (directed)?
What is a network? What characteristic features does the network have?
What systems are called hierarchical?
What is the convenience of tabular presentation of information?
What is a binary matrix? What information does it contain?
Problem solving
No. 2. The bottle, glass, jug and jar contain milk, lemonade, kvass and water. It is known that water and milk are not in a bottle, a vessel with lemonade is located between a jug and a vessel with kvass, there is neither lemonade nor water in a jar. The glass stands next to the can and the vessel with milk. Where is each liquid poured?
No. 3. In the gymnastics competition, Anya, Vera, Galya and Natasha took the first four places. Determine who took what place if it is known that Galya is second, Natasha, although she did not become the winner, was among the prize-winners, and Vera lost to Anya.
Learning new material
An algorithm is a clear and precise instruction to a specific performer to perform a final sequence of actions leading to a set goal.
Stages of activity from defining the goal to obtaining the result:
Examples of an algorithmic model
The first player guesses a whole number from a given range of numbers, for example from 1 to 100. The second player must guess this number in the least number of questions.
Let's write an algorithm for guessing a number using the halving method, focused on the performer - a person
Given: range of numbers from A to B
Necessary: guess the number X conceived by the player using the half division algorithm
Start
1. Ask the question: Is X less than the average between A and B?
2. If the answer is “yes”, then take the whole part of the average value as value B
3. if the answer is “no”, then take the nearest integer greater than the average as value A
4. If the values of A and B are equal, then their common value is the desired number X
5. If the values of A and B are not equal, then return to step 1
End
Let us present the algorithm in the form of a block diagram.
In order to check the correctness of the algorithm, you need to perform a trace.
Algorithm command |
Variables |
Executed |
||||||
actions |
||||||||
Input A,B,X |
||||||||
Reinforcing the material learned
A) Page 48 of the textbook describes an algorithm for finding the greatest common divisor (Euclidean algorithm), aimed at a human performer. Present it in the form of a block diagram and in an algorithmic language for the computer performer.
B) Having completed the previous task, trace the Euclidean algorithm to find the GCD of the numbers 128 and 56.
Operation |
||||
Document |
Slide 1
Slide 2
What is an algorithmic model? Why can an algorithm be called a model and what does it model? An algorithm is a clear and precise instruction to a specific performer to perform a final sequence of actions leading to a set goal. The goal is achieved through the activity of some performer.Slide 3
Stages of activity: Defining the goal; Planning the work of the performer; Performer's work; Getting the result. Where is the place for an algorithm here? An algorithm is a detailed plan for the performer’s work; it is a description of the sequence of actions that the performer must perform.Slide 4
The algorithm is an information model of the performer’s activity. We will call such a model algorithmic. Rice. Stages of movement from goal to result. Defining the goal Building a plan-algorithm Work of the performer Obtaining a result Model of the performer’s workSlide 5
System of executor's commands To build a real plan-algorithm, you need to know the capabilities of the executor. These capabilities are determined by the SKI. When composing an algorithm, one must not go beyond the framework of the SKI. It is easier to build an algorithm for a software-controlled machine than for a human. For an automaton, SKI is a strictly defined set of commands in a formalized language for describing algorithms. Such languages are called programming languages, and the algorithm is called a program. The human SCI cannot be fully described.Slide 6
An example of an algorithmic model. Task: guessing an integer from a given range using the halving method. The first player guesses a whole number from a given range of numbers, for example from 1 to 100. The second player must guess the number in the fewest number of questions.Slide 7
Algorithm for a human performer. Algorithm Guessing a number Given: a range of numbers from A to B Must: guess the number X conceived by the player using the half division algorithm Beginning 1. Ask a question: Is X less than the average value between A and B? 2.If the answer is “yes”, then take the whole part of the average value as value B. 3.If the answer is “no,” then take the nearest integer greater than the average as value A. 4. If the values of A and B are equal, then their common value is the desired number X. 5. If the values of A and B are not equal, then return to step 1. EndSlide 8
Slide 9
Algorithm for a computer performer. Algorithmic language Alg Half division Whole A, B, X Start Enter A, B, X While A≠B, repeat Nts If X≤(A+B)/2 Then B:=TAL((A+B)/2) Otherwise A: =INTEGR((A+B)/2)+1 Kts Output A EndSlide 10
Structured programming The structure of the constructed algorithm is a loop with nested branching. Any algorithm can be built from a combination of three basic algorithmic structures: following, branching and looping. This statement is the basis of a technique called structured programming. If the algorithm is constructed structurally, then it is easy to move from the description of the algorithm to the program.Slide 11
Algorithm tracing is a model of processor operation. To check the correctness of an algorithm, it is not at all necessary to translate it into a programming language. A person can also test the algorithm - by tracing. When performing manual tracing, a person simulates the operation of the processor by executing each command and recording the results of the command execution in a trace table. Let's choose the range of guessed numbers from 1 to 8. Let the player think of the number 3.Slide 12
Step No. Algorithm command Variables Performed actions X A B 1 Input A, B, X 3 1 8 2 A ≠ B 1 ≠ 8, yes 3 X ≤ (A+B)/2 3 ≤ 4.5, yes 4 B:= TARGET((A+B)/2) B:= 4 5 A ≠ B 1 ≠ 4, yes 6 X ≤ (A+B)/2 3 ≤ 2.5 Step No. Algorithm command Variables Performed actions X A B 1 Input A, B, X 3 1 8 2 A ≠ B 1 ≠ 8, yes 3 X ≤ (A+B)/2 3 ≤ 4.5, yes 4 B:=INTEGR((A+B)/2) 3 1 4 V:= 4 5 A ≠ V 1 ≠ 4, yes 6 X ≤ (A+B)/2 3 ≤ 2.5, no