Contacts

Options for tasks on discipline workshop on computer. Workshop to solve the tasks on a computer: a teaching and methodological manual. Lists of adjacent vertices of the graph

Workshop on computer, methods for solving linear systems and finding our own values, part 1, Bogachev K.Yu., 1998

The present allowance contains descriptions of algorithms offered to the implementation of the Mechanics and Mathematical Faculty of Moscow State University on the computer, but a workshop on the computer. " For all algorithms, the necessary theoretical substantiation is given, the corresponding estimated relations and recommendations, but their practical implementation on the computer (the organization of the calculation process. Storage of data and results in the memory of the computer, etc.).

Methods for solving linear systems based on unitary transformations of matrices.
Each of the above methods for solving linear systems can be represented as a sequence. elementary transformations Matrixes (see, for example, such a representation in §4 for the Gauss method). Each of the transformations is given by some matrix P, so that the use of this preparation is equivalent to multiplying (left) of the original matrix A on the matrix R. Thus, each step of the above algorithms is the transition from the matrix A to the matrix A \u003d RA. On the number of conditionality of this new matrix A \u003d RA, it is possible to argue that K (RA)< к(Р)к(А). Поэтому может случиться так. что в процессе проведения преобразований число обусловленности матрицы возрастает и на каждом шаге метод будет вносить все большую вычислительную погрешность. В результате может оказаться, что исходная матрица имела приемлемое число обусловленности, однако после нескольких шагов алгоритма она уже имеет слишком большое число обусловленности, так что последующие шаги алгоритма приведут к появлению очень большой вычислительной погрешности.

An idea arises to select the matrices of the transform number. So that the number of conditionality of the matrix in the process of transformations has not increased. Lemma 1.5 indicates us an example of such matrices: if the Matrix of the transformation of the R unitary (orthogonal in the real case), then relative to the spectral norm to (Ra) \u003d K (A).

The method of rotations and the reflections method are the algorithms for the selection of unitary matrices of transformations P, such as, as a result of all these transformations, the initial matrix A is driven by a triangular form. The system with a triangular matrix is \u200b\u200bthen solved, for example, by the reference of the Gauss method. Despite. What the complexity of these methods is greater than the Gauss method (respectively, 3 and 2 times), these methods were widespread in computational practice due to their sustainability of the accumulation of computational error.


Free download electronic book In a convenient format, watch and read:
Download the book Workshop on computer, methods for solving linear systems and finding our own values, part 1, Bogachev K.Yu., 1998 - FilesKachat.com, fast and free download.

  • Workshop on computer, methods for solving linear systems and finding our own values, part 2, Bogachev K.Yu., 1998
  • Mathematics and design, class 1, training manual for general education organizations, Volkova S.I., 2016
  • Mathematics, oral exercises, grade 1, Tutorial for general education organizations, Volkova S.I., 2016

The following textbooks and books.

ads

Contest 1: Python (in Anytask)

10 SeptemberLesson 2.

NUMPY library. Vectorization of calculations.

Important article documentation NUMPY:

Contest 2: NUMPY (in Anytask)

September 17Lesson 3.

Code Organization in Python.

Functions, modules, classes.

Contest 3: Classes (in Anytask)

September 24Lesson 4.

Metric classification methods.

Discussion of the first practical task.

Introduction to image processing.

Visualization in Python.

October 01Lesson 5.

Preparation of text reports. Tex system.

October 8.Lesson 6.

Exception Handling. Menengers context. Testing.

Preparation of short speeches.

October 15Lesson 7.

Iterators and generators.

Requirements for the report on practical tasks

The report must be a self-sufficient document in pDF formatprepared in the LATEX system. Students who have completed reports on past tasks are able to pass reports in HTML or PDF format, prepared using JUPYTER Notebook.

The report should give verifying answers to the following questions:

  • What course is the task?
  • What task is done?
  • Who is the task?
  • What was the assignment?
  • What was done? What was not done?
  • Are the correct answers to all theoretical questions of the task?
  • Are all the necessary experiments been carried out? Have you received meaningful conclusions?
  • Is the creative part of the task?
  • Did the student who else use? If so, in which volume?
  • What literature did the student use?

Some elements of a good report:

  • Report volume: 5--20 pages;
  • The report of the report does not repeat the full task formulation;
  • The report structure corresponds to the task items;
  • Vector fonts are used;
  • Graphs are properly decorated;
  • Scale for graphs is chosen correctly;
  • On different graphs, the results for the same methods are displayed in the same color;
  • Between the location of the graphs and the places of their mention in the text regarding small distance (on the same or on the next page);
  • The pages should not have a lot of empty space;
  • In most cases, graphics / tables / pseudocodes of algorithms should not occupy most of one page of the report;
  • All numbers in the text / tables are indicated with the required number of meaningful digits;
  • In most cases, there should be no code in the report;
  • For all experiments, the selected design of experiments is described, as well as conclusions from the results obtained;

Ministry of Education of the Russian Federation

Bashkir State University

Workshop on EUM.

Tasks for C ++

Part 1

Compiler:

Rykov V.I. Workshop on computer. Tasks for C ++ .. Part1. / Edition of the Bashkir University. - Ufa 2006. - Nos. C.

The work is devoted to the programming methodology in C ++.

Contains initial encoding information, launch and debugging programs. Contains texts of tasks and, in the necessary cases, instructions on the technology of solving them.

Methods for programming and encoding programs for each task type is presented in the form of complete examples.

Work is used when performing laboratory and practical work Under the discipline "Workshop on a computer".

1 Introduction 5.

1.1 First Program 5

2 certificate of C ++ 5

2.1 Basic data types 5

3 Simple data types 6

3.1 Model task Input operators, cycle. Attachment of structures 6.

3.2 Structure of pseudocode 7

3.3 Implementation of control structures 7

3.4 Model task integers. Operators for, While, IF 8

4 Arrays 10.

4.1 Model task Set of arrays. Machine zero 10.

4.2 Model task Including managing structures 18

5 procedures and functions 20

5.1 Model task example function 20

5.2 Overload function 21

5.3 Transfer of parameters to function 21

5.4 Transfer of an array address to function 22

6 vectors and matrix 24

6.1 Model task Multidimensional arrays, input from file 24

7 Processing symbolic information 29

7.1 Decision Find the longest symmetrical word of the specified sentence 31

8 Recursion 33.

8.1 Solution Calculation of the factorial of a positive number 33

8.2 Solution Recursive functions. Work with rows. 36.

8.3 Solution to build a syntactic analyzer for the concept of bracket. 38.

9 form of a report on laboratory work 41

10 Options for laboratory work 42

1. Introduction

Programming initial information is set out in the Microsoft Visual C ++ environment and debugging programs.

1.1 Presenting program

The program "2 + 3". In the program after invitation, two numbers are introduced. To enter each number you need to dial it on the keyboard and press the ENTER key.

#Include "iostream.h"

char * Rus (Const Char * Text);

iNT MAIN (Int Argc, Char * Argv)

// COUTRETURN 0;

char * Rus (Const Char * Text)

This tutorial It contains a set of laboratory work on the discipline "Workshop to solve the tasks on a computer." The workshop to address the tasks on the computer is studied in the ninth and tenth semesters and is part of Continuous computer training for students. On the one hand, it relies on the knowledge obtained in the study of classical mathematical disciplines (algebra, geometry, mathematical analysis, probability theory), and on the other hand, on knowledge of the basics of computer science and computing equipment, acquired in the process of learning disciplines: computer science, programming, software COMPUTER. The main purpose of the workshop is to form practical skills and skills in solving applied tasks on personal computers. In the manual, much attention is paid to the analysis of examples of solving problems. Create questions and tasks for an independent decision. For self-test, two options for typical control works are given in the framework of the material being studied.

The text below is obtained by automatically removing from the original PDF document and is intended for preview.
Images (pictures, formulas, graphs) are absent.

Ministry of Education and Science of the Russian Federation Federal Agency for Education of the Russian Federation Moscow State Regional University Yelets state University I. A. Bunina Tarova I.N., Terekhov Yu.P., Masina O.N., Skokov A.V. Moscow - Elets 2005 UDC is printed by the editorial decision-002 but-publishing council of Elets BBK whom the State Uni-22.18 of the Versterate. I.A. Bunin Protocol19 Number 5 dated November 30, 2005 Reviewers: Doctor of Physical and Mathematics Sciences, Professor of the Department of Algebra and Geometry Merenkov Yu.N. (Yega them. I.A. Bunin); Doctor of Physical and Mathematical Sciences, Professor, leading employee of the computing center. A.A. Dorodnitsina - RAS Dikusar V.V. (MODE); Candidate of Physical and Mathematical Sciences, Senior Lecturer of Ka Fedra of Equations in Partial Derivatives and the Theory of Probability Malyukov O.P. (VSU, Voronezh) Tarova I.N., Terekhov Yu.P., Masina O.N., Skokov A.V. T19 Workshop to solve the tasks on a computer: Educational and methodical place. - Elets: Yega. I.A. Bunina, 2005. - 194 p. ISVN 5-7017-0825 In the study of the discipline "Workshop to address the tasks on a computer", students face difficulties related to the lack of necessary literature on individual topics in the library. This educational program contains a set of laboratory work on discipline. Much attention is paid to the analysis of examples of solving problems. Prosles and tasks are made for an independent solution. For self-test, there are two variants of typical tests within the framework of the studied material. This educational and methodological manual is addressed to students of the day and absentee departments of the physico-mathematical faculties of universities. UDC 002 ISVN 5-7017-0825-X BBK 22.18 © YSH them. I.A. Bunina, 2005 © Tarova I.N., Terekhov Yu.P., Masina O.N., Skokov A.V., 2005 © MGOU, 2005 © MGOU Publishing House, 2005 Workshop on solving computer tasks Contents Introduction 5 Part I Language Programming high level 9 semester language pascal programming. Theoretical Material 7 1. The arithmetic of real numbers is calculated for 2 hours of 25 by formulas 2. branching 2 hours 27 3. Simplest integer arithmetic 2 hours 31 4. The simplest cycles of 2 hours 35 5. The simplest graphic constructions for 2 hours 39 6. Step-by-step data entry and output Results 2 hours 42 7. Cycle combinations and fork 2 hours 46 8. Processing of symbol sequences 2 hours 51 9. Calculations with storage sequentially 2 hours 56 stages 10. Nested cycles 2 hours 59 11. Invested cycles in matrix tasks 2 hours 62 12. Using procedures 2 hours 66 13. Files 4 hours 69 14. Calculations with storage sequentially 4 hours 75 steits, the number of members of which depends on the initial data 15. Test №1 2 hours 79 16. Activities 4 hours 81 17. Numbers 4 hours 88 18. Geometry 6 hours 96 19. Sorting arrays and files 4 hours 99 10 semester 20. Mounted 2 hours 101 21. Conversion and construction of matrices 4 hours 103 22. Matrix algebra 4 hours 105 23. Numerical methods 10 hours 110 24. Random numbers 4 hours 124 25. Calculations with some accuracy of 4 hours 127 26. Graphics 2 hours 130 27. Graphics and 6 hours 137 28. Games 2 hours 144 Part II Mathematical Calculations in Mathcad Mathematical Calculations in Mathcad. Theoretical material. 146 29. Introduction to Mathcad 4 hours 162 3 Tarova I.N., Terekhov Yu.P., Masina O.N., Skokov A.V. 30. Examination number 2 2 hours 164 31. Mathcad Tasks of linear algebra 10 hours 166 32. Mathcad Mathematical analysis tasks 10 hours 167 33. Mathcad Ordinary differential 10 hours 168 Equations 34. Mathcad Mathematical Schedule Tasks - 4 hours 170 Pile Conclusion 171 Bibliography 172 Appendix Working programm Under the discipline of 174, "workshop to solve the tasks on a computer", the introduction of workshops to solve the tasks on the computer is studied in the ninth and tenth semesters and is an integral part of the continuous computer training of students. On the one hand, it relies on the knowledge obtained in the study of classical mathematical disciplines (algebra, geometry, mathematical analysis, probability theory), and on the other hand, on knowledge of the basics of computer science and computing equipment acquired in the process of learning disciplines: informatics, Programming, computer software. The main goal of the workshop is to form practical skills and skills in solving applied tasks on personal computers. The following tasks are set before students: consolidate and deepen programming skills for PEVM (Pascal programming language); deepen and systematize the idea of \u200b\u200bthe application of new information technologies in mathematics applications; gain experience of building the simplest mathematical models and their implementation on a computer (computing experiment); learn to solve the classical geometry challenges on the PEVM, algebla, matrix algebra, as well as sorting arrays and files; To get the skills of solving on the PEVM tasks relating to the special sections of mathematics and informatics: numerical methods; case numbers; graphics and movement; computer games. This educational and methodological manual consists of two parts: the first part is a set of twenty seven laboratory work oriented programming in high-level languages, the second part is calculated on calculations in mathematical packages and consists of five laboratory work. In total, the allowance contains thirty-two laboratory work, each of which includes examples of solving tasks and tasks for an independent solution. 4 Workshop to solve the tasks on a computer to organize a self-test in the manual included two test work, designed for two options each. Both parts contain theoretical material corresponding to their television. The educational and methodological manual is based on the material studied by the stunts within the framework of the discipline: "Workshop to solve the tasks on the computer" for a number of years. When drawing up tasks, a collection of tasks of the following auto is used: S.A. Abramov, G.G. Genzdilova, E.N. Kapustina, M.I. Selyon. The authors of the educational and methodological manual express gratitude to the subsequent and assesses of the department of computing mathematics and informatics of the I.AHA Bunin for help in laying laboratory work. Part I Programming in High Level Tongue Theoretical Material: Pascal Language Language Pascal Created by N. Vertom in 1971. He plays a special role in practical programming and studying it. There is a lot of tongue Pascal. Any program on Pascal is a text file with its own name and extension. PAS. It has the form of the sequence of symbols of Latin and Russian letters, Arabic numbers, signs of operations, brackets, punctuation marks and some additional characters. Schematically, the program is represented as a sequence of eight sections: 1. The title of the program (starts with the word Program); 2. Description of external modules, procedures and functions; 3. Description of labels; 4. Description of the constant (begins with the word const); 5. Description of variables (starts with the word var); 6. Description of variables; 7. description of functions and procedures; 8. Section of operators (begins with the word begin). Not every sections are necessarily present in each program. Each section begins with a service word, the purpose of which is shifted in such a way that it cannot be used for other purposes. The program is caught in a service word End, after which the point is set. Opportunities and operators are separated from each other with a comma point. Names are used to designate values. They consist of Latin letters and numbers, and the first character should be the letter. The name of the program is selected by the author and is drawn up by the same rule. Permanent values \u200b\u200bare numeric or symbolic. The values \u200b\u200bof symbol vessels 5 Tarova I.N., Terekhov Yu.P., Masina O.N., Skokov A.V. Licinis are to apostrophes. Permanent values \u200b\u200bare described in the Constant Scheme section: Const<имя>=<константа>. The data processed by the program may be different types. The type determines the area of \u200b\u200bpermissible values, as well as operators and functions applicable to the value. In Pascal, there are several built-in simple types with standard names. The scalar type is the type, the values \u200b\u200bof which can be listed in some list. For them, the ordinal function ORD (X) is defined - the values \u200b\u200bnumber in the list (for integer X ORD (X) \u003d X), PRED (X) - the value in the list preceding X, SUCC (X) - the value in the list, Next Ordered type - type whose values \u200b\u200bare ordered in the usual sense. These applications are applicable<,>,<=,>=,<>. False inequality is performed for logical values :<тип>. The names are divided by a comma. Over whole values \u200b\u200b(type Integer), operations are defined: *, DIV (based on actions), MOD (division with the residue), +, - (are given in the order of start). Over real values \u200b\u200b(type REAL) defined: *, +, -, /, as well as functions with real or whole argument: ABS (X), SQR (X), SIN (X), COS (X), Arctan (x) , ln (x), exp (x), sqrt (x), int (x), random. They give a substantive result. Over logical values \u200b\u200b(String type) defined operations: not - denial, and - conjunction, or - disjunction. The ODD (X) logical function takes True if an integer X is odd, false - if even. The set of all characters form symbol values \u200b\u200b(type CHAR) which are ordered. Expressions are structures that specify the rules for calculating the values \u200b\u200bof variables. They are built from variables, constants, functions with operations and brackets. Basic designs. Following - implemented using a composite operator: Begin<последовательность операторов> end. The fork - is implemented using the conditional operator and the operator of the option (selection). Structure of the conditional operator: if<логическое выражение> Then.<оператор 1> ELSE.<оператор 2> Option operator shape: 6 Workshop on solving tasks on computer CASE<выражение> Of.<список констант 1>:<оператор 1>; <список констант 2>:<оператор 2>; ……………… <список констант N>:< оператор N > end. There are three operators for the implementation of cycles. If the number of repetitions is estimated in advance, then the cycle with the parameter is used: 1) for<параметр>:= <выражение 1> to.<выражение 2> do.<оператор>, 2) for<параметр>:= <выражение 1> Downto.<выражение 2> do.<оператор>; In other cases, use a cycle with precondition: While<логическое выражение> do.<оператор>(Action: The value is calculated logical expressionIf it is true, the operator is performed, after which the value of the logical expression is calculated again, otherwise the action is completed); or Cycle with postband: repeat<последовательность операторов> Until.<логическое выражение>, (Action: The sequence of operators is performed, then the value of the logical expression is calculated, if it is true, the action ends, otherwise the sequence of operators is completely output). Arrays. Composite types of quantities are formed from other types, while the method of formation or structure of a composite type plays a significant role. Frequently used composite type - array. An array is a sequence consisting of a fixed number of single-type elements. All elements of the array have a common name and differ indexes. Indices can be calculated. When describing arrays, words are used: Array and of. In the array description, the type of its elements and indexes is indicated: Type<имя массива>\u003d Array [<список типов индексов>] OF.<тип элементов>. The number of indexes is called the dimension of the array. The solution to the element of the array is carried out using the task of the variable name, followed by the element index list enclosed in square brackets. Example. Consider the task of streamlining members of a numerical sequence according to any sign (ascending). We use the method that is called the "bubble". To do this, we will consider the pairs of elements consistently from left to right and rearrange the elements in a pair, if they are wrong. At the beginning we assign a certain logical variable value P: \u003d TRUE if, when viewed steam, at least one transit change the value of the logical variable. The cycle is finishing if after the next viewing the condition is satisfied: P \u003d True. 7 Tarova I.N., Terekhov Yu.P., Masina O.N., Skokov A.V. Program: Program Bubble; Const A: Array of Integer \u003d (19,817,6,15,4,13,2,1,0); VAR B, I: Integer; P: Boolean; Begin CLRSCR; For i: \u003d 1 to 10 Do While (A [I]: 3); Writeln; Writeln; REPEAT P: \u003d TRUE; For i: \u003d 10 Downto 2 DO IF A [I] (<список описаний формальных параметров>). The description of the parameters is<список имен>: <тип> or var<список имен>: <тип>. In the first case, they talk about the parameters values, in the second - about parameters of variables. In the simplest case, the title procedure contains only its name. The procedure call operator has the form:<имя процедуры> (<список выражений>). These expressions are called actual parameters. The list must accurately comply with the list of descriptions of formal parameters of the procedure. During the procedure call, each parameter value is assigned the value of the appropriate actual parameter, and therefore they are usually used to transmit input data. Variables-parameters should be used to represent the results of the procedure. 8 Workshop to solve computer tasks The function is a subroutine that defines the only scalar, real or string value. Differences of the function from the procedure: The function header begins with the service word FUNCTION and is deposited by the type of function value; The function of the function operators should contain at least one function assignment operator; Appeal to the function - not the operator, but the expression of the form<имя функции> (<список фактических параметров>). Functions and procedures can use their own name in their own design, i.e. can be recursive. Working with files. File (sequence) is one of the most fundamental data structures. Program organization of computers, their connection with external devices are based on the file structure. Files allow you to solve two problems: 1) the possibility of forming and maintaining values \u200b\u200bfor subsequent use by other programs (for example, in multiple processing programs of information systems, such as payment statements, various ACS, databases, the need for long-term storage is obvious ); 2) Interaction of programs with external I / O devices: display, printer, ASP, etc. In Pascal, these problems are removed using structured data type. The file type of data in the program is set as follows: Type<имя файлового типа>\u003d File Of.<тип компонентов> As a type of file components, it is allowed to use any data type other than the file. For example: Type intfile \u003d File of Integer; Refile \u003d File of Real; Chfile \u003d File of Char; Ran \u003d 1..10; ST \u003d SET OF RAN; Vector \u003d Array of Real; compl \u003d recORd; Re, IM: Integer; end; setFile \u003d File of ST; vecfile \u003d File of Vector; compfile \u003d File of compl; The file variable description is set in the usual way in section 9 Tarova I.N., Terekhov Yu.P., Masina O.N., Skokov A.V. descriptions. For example: VAR F: Intfile; or VAR F: File of Integer. The file variable is a buffer between the Pascal program and the external device and should be logically connected to it. Communication is carried out by the Pascal Language Operator: Assign (<имя файловой переменной>,"<имя устройства>") Typically, files for storing data are associated with an external memory device on magnetic media (drive) and are called external files. If, for example, the file named primer.dat is logically connected to the disk-house A:, then all data placed in a file will be stored on this disk drive, and setting the "window" between the program and the file will be determined via the file variable F by the Assign operator (f, "primer.dat") if the external device is the printer, the connection is carried out by the operator Assign (F, "1st:"). Here 1st is the logical name of the printing device. Below are the logical names of external I / O devices: Con - Console; TRM - Terminal; KBD - Keyboard; 1st - Printer; AUX - Fer network; usr - user driver. After communication, the file variable F is identified with the corresponding file. To work with the file, it must be opened, and at the end of the work - close. The file opens to read the Reset operator (F), for recording - Operator Oer Rewrite (F). Reading and writing data is carried out by known READ / WRITE commands, only at the beginning of the list the file variable is placed: Read (F,<список ввода>); READLN (F,<список ввода>); Write (F,<список вывода>); Writeln (F,<список вывода>). Closing the file is carried out by command Close (F). Conditionally, the file can be represented as a tape that has the beginning, and the end of the NE is fixed. The components of the file are recorded on this tape sequentially, DPYR after another: ... M. F0 F1 F2 F3 K. ^ T.M. Here TM - Current marker indicating the operating position (window) of the file; MK (The end of the file marker) is a special code that is automatically formulated following the last element of the file. This kind of files are called sequential access files. In the original version of Pascal direct access files for which you can directly "get" any component is not provided; However, in Turbo-Pascal, direct access elements are (for example, through the SEEK function). Rewrite (F) command - Open file for recording - Sets the file to the initial status of the recording mode; Current marker is installed on 10



Did you like the article? Share it