Current location - Training Enrollment Network - Mathematics courses - People's education edition, compulsory mathematics in senior two, chapter one knowledge points: algorithm and program box
People's education edition, compulsory mathematics in senior two, chapter one knowledge points: algorithm and program box
The concept of 1. algorithm

Definition of (1) algorithm: The generalized algorithm refers to the methods and steps to complete a certain job, so we can say that the instruction manual of the washing machine is the algorithm to operate the washing machine, and the menu is the algorithm to cook.

In mathematics, modern algorithm refers to the procedures and steps that can be used to solve a certain kind of problems. These procedures or steps must be clear and effective and can be completed in a limited number of steps.

(2) Features of the algorithm: ① certainty: every step of the algorithm should be accurate, "neither weight nor leakage". "No weight" refers to unnecessary or even useless steps, and "no leakage" refers to the inability to complete the task without any step. ② Logic: The algorithm is interlocking from the first step to the last step. The division of labor is clear, "previous step" is the premise of "last step" and "last step" is the continuation of "previous step". (3) finiteness: the algorithm should have a clear start and end, and the problem to be solved must have a clear result when it reaches the termination step, that is, the task must be completed in a limited number of steps and cannot continue indefinitely.

(3) Algorithm description: natural language, program block diagram and program language.

2. The block diagram of compulsory three algorithms and programs in senior two mathematics.

(1) The concept of program block diagram: The program block diagram, also known as flow chart, is a graph that accurately and intuitively represents the algorithm with specified graphics, pointing lines and text descriptions;

(2) Graphical symbols and their functions that constitute the program box.

(3) Composition of program block diagram

The program block diagram includes the following parts: corresponding program blocks to realize different algorithm functions; Streamlines with arrows; Necessary explanatory text in the program box.

3. Several important structures and program block diagrams of compulsory three algorithms in senior high school mathematics.

(1) sequence structure

Sequence structure is the simplest algorithm structure. Reports and boxes are made from top to bottom. It consists of several steps that are executed in turn, and it is a basic algorithm structure that any algorithm can't do without.

See schematic diagram and examples:

The embodiment of sequence structure in the program block diagram is that the program blocks are connected from top to bottom by pipeline, and the algorithm steps are executed in sequence. For example, in the schematic diagram, box A and box B are executed sequentially, and the operation specified in box B can only be executed after the operation specified in box A is executed.

(2) Conditional structure

As shown in the figure below, there is a conditional structure in the dotted box, which contains a judgment box. When the algorithm is executed, it is judged whether the given condition P holds, and different execution boxes (box A and box B) are selected. No matter whether the P condition is true or not, only one of Box A or Box B can be executed, and it is impossible to execute Box A and Box B at the same time, and neither Box A nor Box B can be executed. Box a or box b can be empty, that is, no operation is performed.

See schematic diagram.

(3) circular structure

In some algorithms, structures that need to perform the same operation repeatedly are called circular structures. That is, starting from a certain place in the algorithm, certain processing procedures are repeatedly executed according to certain conditions. Repeated processing steps are called loop bodies.

There are two forms of circulation structure: time circulation structure and time circulation structure.

(1) When the loop structure is shown in the left figure below, its function is to execute block A when the given condition p holds. After the execution of box A is completed, it will return to determine whether condition P is established. If it is still true, it returns to execute box A again, and so on, until a certain return judgment condition P is not true, it will no longer execute box A and leave the loop structure. Continue with the block diagram below.

(2) Up to the loop structure, as shown in the figure on the right, its function is to execute the repeated box A first, and then judge whether the given condition P holds. If p still does not hold, go back and continue to execute block A, and then judge whether condition p holds. Repeat the operation step by step until the given judgment condition p is established, and then leave the loop structure without returning to execution block a. Continue with the block diagram below.