What are the characteristics of geometric probability and how to calculate it?
The examination requirements of compulsory three are not big, mainly basic questions, with emphasis on program block diagram. Chapter 1 Preliminary Algorithm 1. 1 Concept of Algorithm 1 Concept of Algorithm: Mathematically, an "algorithm" in a modern sense usually refers to a certain kind of problem that can be solved by a computer, and it must be clear and effective. And it can be done in a limited number of steps. 2. Features of the algorithm: (1) finiteness: the sequence of steps of the algorithm is finite, and it must be stopped after a finite operation, not infinite. (2) Determinism: Every step in the algorithm should be deterministic, and can be effectively executed and get certain results, and should not be vague. (3) Sequence and correctness: algorithm. Each step can only have one definite subsequent step, and the former step is the premise of the latter step. Only when the previous step is completed can the next step be carried out, and the problem can be completed if every step is done correctly. (4) Uniqueness: The solution of a problem is not necessarily unique, and different algorithms can be used for a problem. (5) Universality: Many specific problems can be solved by designing reasonable algorithms. For example, mental arithmetic and calculator calculation must be solved through limited and pre-designed steps. 1. 1.2 program block diagram 1, the basic concept of program block diagram: (1) the concept of program composition: 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. The program block diagram includes the following parts: program blocks representing corresponding operations; Streamlines with arrows; Necessary text description outside the program box. (2) The graphic symbols that make up the program box and their function program box names. The function start-stop box indicates the beginning and end of an algorithm, which is indispensable for any flow chart. I/O box represents the input and output information of the algorithm, which can be used in any position where input and output are needed in the algorithm. In the algorithm, formulas such as box assignment, calculation and calculation formula required for data processing are written in different processing boxes for data processing. The judgment box judges whether a certain condition is established, and marks "Yes" or "Y" at the exit when it is established; If not, please mark "No" or "No". When learning this part of knowledge, we should master the shape, function and usage rules of each graphic. The drawing rules of program block diagram are as follows: 1. Use standard graphic symbols. 2. The block diagram is generally drawn from top to bottom and from left to right. 3. Except for the judgment box, most flow chart symbols have only one entry point and one exit point. The decision box has a unique symbol and multiple exit points. 4. The judgment box is divided into two categories, one is the judgment of "yes" and "no", and there are only two results; The other is multi-branch judgment, which has several different results. 5. The language described in graphic symbols should be very concise and clear. (3) Three basic logical structures of the algorithm: sequence structure, conditional structure and cyclic structure. 1, sequence structure: sequence structure is the simplest algorithm structure. Reports and boxes are made from top to bottom. It consists of several processing steps that are executed in turn. It is the basic algorithm structure that any algorithm can't do without. 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: Conditional structure refers to the algorithm structure of choosing different flow directions according to whether the conditions in the algorithm are established or not. Whether the condition P is true or not, choose to execute box A or box B. No matter whether the condition P is true or not, only one of box A or box B can be executed. It is impossible to execute box a and box b at the same time, and it is impossible to execute both. A judgment structure can have multiple judgment boxes. 3. Circular structure: In some algorithms, it is often that a processing step is repeatedly executed from a certain place according to certain conditions. This is the cycle structure, and the repeated processing steps are the cycle body. Obviously, the loop structure must contain the conditional structure. Cyclic structure is also called repetitive structure. Cycle structure can be subdivided into two categories: (1) and current cycle structure, as shown in the figure on the left below. Its function is to execute block a when the given condition p holds. After the execution of block A is completed, it is judged whether the condition p is established. If it is still true, block A is executed again, and so on, until condition P is not established once, and block A is not executed at this time. (2) The other is the until cycle structure, as shown in the right figure below. Its function is to execute first, and then judge whether the given condition P is true or not. If p still does not hold, continue to execute block A until the given condition P holds, then stop executing block A and leave the loop structure. Note: 1 loop structure will terminate the loop under certain conditions, which requires conditional structure to judge. Therefore, there must be a conditional structure in the loop structure, but "loop" is not allowed. There is a count variable and an accumulation variable in the loop structure. The counting variable is used to record the number of cycles, and the cumulative variable is used to output the results. Counting variables and accumulating variables are generally executed synchronously, accumulating once and counting once. 1.2. 1 input, output and assignment statements 1, input statement (1) General format of input statement (2) The function of input statement is to realize the input information function of the algorithm; (3) "Prompt content" prompts the user what information to input, and variables refer to variables whose values can be changed when the program is running; (4) The input statement requires that the input value can only be a specific constant, not a function, variable or expression; (5) Use semicolon ";" Between the prompt content and the variable. Separate. If multiple variables are entered, the variables are separated by commas. 2. Output statement (1) General format of output statement (2) The function of output statement is to realize the output result function of the algorithm; (3) "Prompt content" prompts the user what information to input, and the expression refers to the data to be output by the program; (4) The output statement can output the values of constants, variables or expressions and characters. 3. Assignment statement (1) General format of assignment statement (2) The function of assignment statement is to assign the value expressed by expression to the variable; (3) The "=" in the assignment statement is called the assignment number, which is different from the equivalent number in mathematics. The left and right sides of the assignment number cannot be interchanged, it assigns the value of the expression on the right side of the assignment number to the variable on the left side of the assignment number; (4) The left side of the assignment statement can only be a variable name, not an expression, and the expression on the right side can be data, constant or formula; (5) A variable can be assigned multiple times. Note: ① The left side of the assignment number can only be a variable name, not an expression. 2=X is wrong. ② The left and right distribution numbers cannot be interchanged. For example, "A = B" and "B = A" have different meanings. ③ Algebraic calculus cannot use assignment statements. (such as simplification, factorization, solving equations, etc.). (4) The assignment symbol "=" has different meanings from the equal sign in mathematics. 1.2.2 conditional statement 1. Conditional statements generally have two formats: (1) if-then-else statement; (2) If-then statement. 2.If-then-else statement The general format of if-then-else statement is Figure 1, and the corresponding program block diagram is Figure 2. Figure 1 Figure 2 Analysis: In the if-then-else statement, "condition" indicates the condition of judgment, and "statement 1" indicates the operation content to be executed when the condition is met; "Statement 2" indicates the content of the operation to be performed when the conditions are not met; END IF indicates the end of the conditional statement. When the computer executes, the condition after IF is judged first, and if the condition is met, the statement after THEN is executed1; If the condition is not met, statement 2 is executed after ELSE. 3.If-then statement The general format of if-then statement is shown in Figure 3, and the corresponding program block diagram is shown in Figure 4. Note: "condition" refers to the condition of judgment; "Statement" refers to the operation content to be executed when the conditions are met, and the program is terminated when the conditions are not met; END IF indicates the end of the conditional statement. When the computer executes, the condition if is judged first. IF the condition is met, the statement after the condition if is executed. If the condition is not met, the conditional statement is directly ended and other statements are executed. The loop structure of 1.2.3 loop statement is realized by loop statement. Corresponding to the two loop structures in the program block diagram, there are also two statement structures in the general programming language: WHILE type and UNTIL type. That is, WHILE statement and UNTIL statement. 1, WHILE statement (1) The general format of the WHILE statement is the corresponding program block diagram: (2) When the computer encounters the WHILE statement, it first judges whether the condition is established, and if it meets the condition, it executes the loop between while and WEND; Then check the above conditions. If the condition is still met, the loop is executed again and the process is repeated until the condition is not met once. At this time, the computer will not execute the loop body, jump directly after the WEND statement, and then execute the statement after WEND. Therefore, the period is sometimes called "pretest" period. 2. Untill statement (1) The general format of untill statement is the corresponding program block diagram. (2) UNTIL cycle is also called "post-test" cycle. From the analysis of untill loop structure, when a computer executes a statement, it first executes the loop body and then judges the conditions. If the condition is not satisfied, continue to return to the execution loop body, and then judge the condition. Repeat this process. The loop body will not be executed until a certain condition is met, and other statements will be executed after jumping to the LOOP UNTIL statement. This is a loop statement that executes the loop body first and then judges the condition. Analysis: The difference between when-type loop and until-type loop: (Students discuss before induction) (1) When-type loop is judged before execution, and until-type loop is judged before execution; In the WHILE statement, the loop body is executed when the condition is met, and in the UNTIL statement, the loop 1.3. 1 is executed when the condition is not met, and division and subtraction 1 and division are executed. Also known as Euclid algorithm, the steps of finding the greatest common divisor by division are as follows: (1): divide the larger number m by the smaller number n to get a quotient and a remainder; (2): If = 0, then n is the greatest common divisor of m and n; If ≠0, divide the divisor n by the remainder to get a quotient and a remainder; (3): If = 0, it is the greatest common divisor of m and n; If ≠0, divide the divisor by the remainder to get a quotient and a remainder; ..... in turn, until = 0, at this time is the greatest common divisor. 2. Polyphase Subtraction Technology In the early days of China, there was another algorithm for finding the greatest common divisor, namely polyphase subtraction technology. The steps to find the greatest common divisor by multi-subtraction are useful in "Nine Chapters Arithmetic": the number of mother and son can be divided in half, and the number of mother and son can not be divided in half, so as to reduce more and reduce more, equal and make them equal. Translated as: (1): Give two positive numbers at will; Determine whether they are all even numbers. If so, reduce by 2; If not, proceed to the second step. (2): Subtract the smaller number from the larger number, then compare the smaller number with the difference, and subtract the number from the larger number. Continue this operation until the numbers obtained are equal, then this number (equal number) is the greatest common divisor. Example 2 Find the greatest common divisor of 98 and 63 by polyphase subtraction. Analysis: (omitted) 3. The difference between cross-phase subtraction and cross-phase subtraction: (1) are both methods to find the greatest common divisor. In the calculation, the cross-phase subtraction is the main method, and the calculation times of the cross-phase subtraction are relatively few, especially when the two numbers are quite different. (2) From the form of the result, the result of division is obtained by taking the division remainder as 0. The Qin algorithm and ranking of 1.3.2 are obtained by the cross-subtraction. The concept of Qin algorithm is f (x) = anxn+an-1 xn-1+...+a1x+A0, which is the evaluation problem F. = +a 1x+A0 =(anxn- 1+an- 1xn-2+…。 +a 1)x+A0 =((anxn-2+an- 1xn-3+…。 +a2) x+a1) x+A0 = ... = (... (anx+an-1) x+an-2) x+...+a1) x+A0 to find the value of the polynomial, first calculate the sequence in the innermost bracket. That is, v2 = v 1 x+an-2v3 = v2x+an-3 ... VN = VN-1x+A0, so that the problem of finding the value of a polynomial of degree n becomes the problem of finding the value of a polynomial of degree n.2. Two sorting methods: direct insertion sorting and bubble sorting/kloc-. The basic idea of direct insertion sorting: the idea of insertion sorting is to read one and arrange one. Put the 1 th number into the 1 th element of the array, and compare the number read later with the number stored in the array to determine its position from the largest to the smallest in the arrangement. Move this position and subsequent elements back one position, and fill in the empty position with the new number read. (Because the algorithm is simple, it can be illustrated by examples. ) 2. The basic idea of bubble sorting is to compare two adjacent numbers in turn. Put the small one in the back. That is, first compare the number of 1 with the second number, with the large number in front and the decimal number in the back. Then compare the second number with the third number ... until the last two numbers are compared. The first trip down, the smallest must sink to the end. Repeat this process, still starting with 1 and ending with the last second sign ... because in the sorting process, large numbers always move forward. Therefore, it is called bubble sorting. 1.3.3 decimal 1. Concept: Decimal system is a counting method, which uses a finite number to represent different values in different positions. The number of digital symbols that can be used is called radix, and when radix is n, it can be called N-ary, which is abbreviated as N-ary. Decimal system is most commonly used now, and it is usually counted by 10 Arabic numerals 0-9. For any number, we can use different carry systems to represent it. For example, the decimal number 57, binary can be expressed as11001,octal can be expressed as 7 1, and hexadecimal can be expressed as 39, and their values are all the same. Generally speaking, if k is an integer greater than 1, then the K-ary system based on k can be expressed as:, and all kinds of decimal places are generally expressed by adding notes at the lower right foot of the number, for example, the binary number is11001(2). 34(5) stands for decimal number. Chapter 2 Statistics 2. 1. 1 simple random sampling 1. Population and sample In statistics, the whole research object is called population. Each subject is called an individual. The total number of individuals in a group is called the total capacity. In order to study the related properties of the population, we usually randomly select a part from the population:,, research, which we call. I.e. without any grouping, sorting, queuing, etc. In general, the investigation unit is completely selected by the machine. The characteristics are: the probability of each sample unit being extracted is the same (the probability is equal), and each unit of the sample is completely independent, and there is no certain correlation and exclusion between them. Simple random sampling is the basis of other sampling forms. This method is usually only used when the difference between the whole units is small and the number is small. 3. Common methods of simple random sampling: (1) lottery method; (2) Random number table method; ⑶ Computer simulation method; ⑷ Direct extraction with statistical software. In the sample size design of simple random sampling, the main considerations are: ① population variation; ② Allowable error range; ③ Degree of probability assurance. 4. Draw lots: (1) number each object in the investigation team; (2) Prepare the lottery tool and draw lots. (3) Measure or investigate each individual in the sample. Please investigate the sports activities that students in your school like. 5. Random number table method: For example, use random number table to select 65,438+00 students from their class to participate in an activity. 2. 1.2 systematic sampling 1. Systematic sampling (equidistant sampling or mechanical sampling): sort the units of the population, then calculate the sampling distance, and then sample according to this fixed sampling distance. The first sample was selected by simple random sampling. K (sampling distance) =N (population size) /n (sample size) Precondition: The arrangement of individuals in the population should be random for the variables studied, that is, there is no regular distribution related to the variables studied. You can start sampling from different samples and compare the characteristics of several samples under the conditions allowed by the investigation. If there are obvious differences, it shows that the distribution of samples in the population follows a certain cycle law, and this cycle coincides with the sampling distance. 2. Systematic sampling, namely equidistant sampling, is one of the most commonly used sampling methods in practice. Because it has low requirements for sampling frames and simple implementation. More importantly, if there are some auxiliary variables related to the survey indicators available, and the whole unit is queued according to the size of the auxiliary variables, systematic sampling can greatly improve the estimation accuracy. 2. 1.3 stratified sampling 1. Stratified sampling (type sampling): firstly, all units in the crowd are divided into several types or levels according to certain characteristics or signs (gender, age, etc.). ), and then through simple random sampling or systematic sampling, extract a sub-sample from each type or level, and finally combine these sub-samples to form a total sample. Two methods: 1. Firstly, the population is divided into several layers by stratification variables, and then extracted from each layer according to the proportion of each layer in the population. 2. Firstly, the population is divided into several layers by stratification variables, and then the elements in each layer are arranged neatly in hierarchical order. Finally, samples are extracted by systematic sampling. 2. Stratified sampling is to divide people with strong heterogeneity into sub-populations with strong homogeneity, and then draw samples from different sub-populations to represent sub-populations, and all samples represent people again. Stratification standard: (1) Take the main variables or related variables to be analyzed and studied as stratification standard. (2) Ensure that the variables with strong homogeneity in each layer, strong interlayer heterogeneity and outstanding overall internal structure are used as stratified variables. (3) Take those variables with obvious stratification as hierarchical variables. 3. Stratified proportion problem: (1) Stratified sampling in proportion: the method of extracting sub-samples according to the proportion of units of various types or levels to the total units. (2) Non-proportional stratified sampling: If the proportion of some levels in the population is too small, the sample size will be very small. At this time, this method is mainly used to facilitate special research or comparison of different levels of subpopulations. If we want to infer the population from the sample data, we need to first weight the data of each layer, adjust the proportion of each layer in the sample, and restore the data to the actual proportion structure of each layer in the population. 2.2.2 Use the digital features of the sample to estimate the digital features of the population 1, the local mean: 2, and the standard deviation of the sample: 3. When using samples to estimate the population, if the sampling method is reasonable, then the sample can reflect the information of the population, but the information obtained from the sample will be biased. In random sampling, this deviation is inevitable. Although the distribution, mean and standard deviation we get from the sample data are not the real distribution, mean and standard deviation of the population, but only an estimate, this estimate is reasonable, especially when the sample size is large, and they do reflect the information of the population. 4.( 1) If every data in a set of data is added or subtracted with the same constant, the standard deviation will remain unchanged. (2) If every data in a set of data is multiplied by a constant k, the standard deviation will become k times the original. (3) The influence of the maximum and minimum values in a set of data on the standard deviation and the application of the interval. The scientific principle in "Remove the highest score and remove the lowest score" 2.3.2 Linear correlation of two variables 1, concept: (1) Regression linear equation (2) Regression coefficient 2. Least square method 3. Linear regression equation (1) is used to describe the dependence between two variables. Linear regression equation can be used to quantitatively describe the quantitative relationship between two variables (2) regression equation is used to predict; Substituting the predictor (independent variable x) into the regression equation to estimate the predictor (dependent variable y), the allowable interval of individual y value can be obtained. (3) Use regression equation for statistical control, specify the change of Y value, and achieve the purpose of statistical control by controlling the range of X. If the regression equation between NO2 concentration in the air and traffic flow is obtained, the NO2 concentration in the air can be controlled by controlling traffic flow. 4. It is of practical significance to apply the precautions of linear regression (1) to regression analysis; (2) Before regression analysis, it is best to make a scatter plot; (3) Don't extend the tropic of cancer. Chapter 3 Probability 3. 1.1-3.1.2 Probability of random events and the significance of probability1. Basic concept: (1) inevitable event: the event that will happen under condition S is called the inevitable event relative to condition S; (2) Impossible events: events that will not happen under condition S are called impossible events relative to condition S; (3) Deterministic events: inevitable events and impossible events are collectively referred to as deterministic events relative to condition S; (4) Random events: events that may or may not occur under condition S are called random events relative to condition S; (5) Frequency and frequency: repeat the test for n times under the same condition S, and observe whether there is an event A, and call the frequency nA of the event A in the n tests as the frequency of the event A; The ratio fn(A) of event A = the probability of event A: for a given random event A, if the frequency fn (a) of event A is stable at a certain constant with the increase of the number of tests, the constant is recorded as P(A) and called as the probability of event A. (6) The difference and connection between frequency and probability: the frequency of random event refers to the ratio of the number of times nA of the event to the total number of tests N, which has certain stability. We call this constant the probability of random events, which quantitatively reflects the probability of random events. On the premise of a large number of repeated experiments, frequency can be approximately regarded as the basic property of the probability of this event 3. 1.3 1. Basic concepts: (1) inclusion, union, intersection, etc. of events. (2) If A∩B is an impossible event, that is, a ∩ b = Ф, it is called. (3) If A∩B is an impossible event and A∪B is an inevitable event, then event A and event B are mutually opposite events; (4) When events A and B are mutually exclusive, the addition formula is satisfied: p (a ∪ b) = p (a)+p (b); If events A and B are opposite events, then A∪B is an inevitable event, so P(A∪B)= P(A)+ P(B)= 1, so there is P (A) = 1-P (B) 2. Basic properties of probability: 65440. 2) When events A and B are mutually exclusive, the addition formula is satisfied: p (a ∪ b) = p (a)+p (b); 3) If events A and B are opposite, then A∪B is inevitable, so P(A∪B)= P(A)+ P(B)= 1, so there is P (A) =1-P (B); 4) The difference and connection between mutually exclusive events and opposing events, mutually exclusive events means that in an experiment, event A and event B will not happen at the same time, including three different situations: (1) Event A happens and event B doesn't happen; (2) Event A does not occur, but Event B does; (3) Event A and Event B do not occur at the same time, while the opposite event means that there is only one event A and Event B, including two situations; (1) Event A occurs, but event B does not; (2) Event B happens and Event A doesn't, which is a special case of mutually exclusive events. 3.2. 1 —3.2.2 Generation of classical probability and random number; The condition of using classical probability: the finiteness of test results and the equal possibility of all results. (2) the solution steps of classical probability; ① Find the total number of basic events; ② Find the basic number of events contained in event A, and then use the formula P (a) = 3.3. 1-3.3.2 to generate geometric probability and uniform random number1. Basic concepts: (1) geometric probability model: If the probability of each event is only proportional to the length (area or volume) of the event area, (2) probability formula of geometric probability: p (a) =; (3) Characteristics of geometric probability: 1) There are infinitely many possible results (basic events) in the experiment; 2) The possibility of each basic event is equal.