* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Information Input and Output
Survey
Document related concepts
Computational complexity theory wikipedia , lookup
Pattern recognition wikipedia , lookup
Probabilistic context-free grammar wikipedia , lookup
Travelling salesman problem wikipedia , lookup
Simulated annealing wikipedia , lookup
K-nearest neighbors algorithm wikipedia , lookup
Operational transformation wikipedia , lookup
Fast Fourier transform wikipedia , lookup
Selection algorithm wikipedia , lookup
Theoretical computer science wikipedia , lookup
Smith–Waterman algorithm wikipedia , lookup
Genetic algorithm wikipedia , lookup
Fisher–Yates shuffle wikipedia , lookup
Algorithm characterizations wikipedia , lookup
Factorization of polynomials over finite fields wikipedia , lookup
Transcript
Algorithm & Program Week 5 Learning Outcomes • By the end of this session, students will understand how to create computer software. Students will learn : – Algorithm – Program – Analytic & numeric solution. Algorithm & Program • Algorithm is a method for carrying out a specific calculation that is guaranteed to produce a result in a finite number of steps. • However, some results cannot be obtained by an algorithm [Findlay, Watt,1985]. • Although algorithms can produce results, sometimes it may no be feasible to use them in practice (e.g. too slow execution, too much store). • A heuristic approach is used in the field of artificial intelligence. • Programs are working models of algorithms and heuristics. Simple Algorithm to Find an Integration Result (1) • Integration is basically a summation. • A mathematical function may be divided into a large finite numbers which constitutes a series of square area. • Summing all these squares would produce the integration results. • Rather than producing the integration result in an analytical way (as in Calculus), the integration result can be obtained numerically (the way a computer does). Simple Algorithm to Find an Integration Result (2) f(x) f(x) x a b Algorithm : 1. Divide a function into a small step of delta x, delta x = (b-a)/n 2. x = a 3. Find the value of y1= f(x) 3a. y1=y1*delta x 4, Increase the value of x by delta x, x = x + deltax 5. Find the value of y2=f(x) 5a. y2 = y2*delta x 6. A= y1+y2 7 y1=y2 8 Back to 4 x Simple Program Program Integration (input, output) Declare variables Begin . . . Algorithm . . End. Important Terms • • • • • • • Low Level Language High Level Language Translator Source Code Object Program Compilation Execution Important Terms • Analytic solution • Numeric solution • Flow chart