1 / 12

Computer programming

Computer programming. Algorithms. The following points will be addressed during this lecture: What are algorithms ? Why is the study of algorithms worthwhile ? What is the role of algorithms relative to other technologies used in computers? . Algorithms.

adolfo
Download Presentation

Computer programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer programming

  2. Algorithms • The following points will be addressed during this lecture: • What are algorithms? • Why is the study of algorithms worthwhile? • What is the role of algorithms relative to other technologies used in computers?

  3. Algorithms • an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. • An algorithm is a sequence of computational steps that transform the input into the output. • a tool for solving a well-specified computational problem.

  4. Algorithms • Example “Sorting numbers”: • sorting a sequence of numbers into decreasing or increasing order. • Normal problem appears in practise. • how we formally define the sorting problem?

  5. Algorithms • Input: A sequence of n numbers a1; a2; ….. ;an . • Output: A permutation (reordering)a’1; a’2; ….. ;a’n of the input sequence such that a’1< a’2<….. <a’n . • example, given the input sequence (31; 59; 26; 41; 58), a sorting algorithm would return as output the sequence (26; 31; 41; 58; 59).

  6. Algorithms • the input sequence is called an instance of the sorting problem. • In general, an instance of a problem consists of the input) needed to compute a solution to the problem. • What is a correct algorithm? What is an incorrect algorithm? • An algorithm is said to be correct if, for every input instance, it halts with the correct output. • So, the correct algorithm solves the given computational problem.

  7. Algorithms • An incorrect algorithm might not give an answer at all on some input instances, or it might give an incorrect answer. • Can the incorrect algorithms be useful? • Yes, if the error rate is controllable. How to specify an algorithm? • In English like a computer program • Or as a hardware design.

  8. Specification of an algorithm. • the requirement for the specification: • the specification must provide a precise description of the computational procedure to be followed. What kinds of problems are solved by algorithms? • Sorting a sequence of numbers is not the only problem for whom algorithms were developed.

  9. Ex. Of Problems • Example of problems: • The Human Genome Project has made great progress toward the goals of identifying all the 100,000 genes in human DNA, determining the sequences of the 3 billion chemical base pairs that make up human DNA, storing this information in databases, and developing tools for data analysis. Each of these steps requires sophisticated algorithms.

  10. Ex. Of Problems • The Internet enables people all around the world to quickly access and retrieve large amounts of information. With the aid of clever algorithms, sites on the Internet are able to manage and manipulate this large volume of data. Examples of problems that make essential use of algorithms include finding good routes on which the data will travel.

  11. Ex. Of Problems • Electronic commerce enables goods and services to be negotiated and exchanged electronically, and it depends on the privacy of personal information such as credit card numbers, passwords, and bank statements. The core technologies used in electronic commerce include public-key cryptography and digital signatures which are based on numerical algorithms and number theory.

  12. Algorithm characteristics • Common characteristics to many interesting algorithmic problems: • They have many candidate solutions, majority of them do not solve the problem at hand. Finding one that does, or one that is “best,” can present quite a challenge. • they have practical applications. finding the shortest path provides the easiest examples.

More Related