1 / 10

What Is An Algorithm?

Algorithms. What Is An Algorithm?. Simply put, an algorithm is a series of instructions (a procedure) that solves a problem by using a finite number of steps.

yardley
Télécharger la présentation

What Is An Algorithm?

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. Algorithms What Is An Algorithm? Simply put, an algorithm is a series of instructions (a procedure) that solves a problem by using a finite number of steps. A Computer Scientist would more accurately describe an algorithm as an effective method expressed as a finite list of well-defined instructionsfor calculating a function.Starting from an initial state and initial input the instructions describe a computation that, when executed, will proceed through a finite number of well-defined successive states, eventually producing output and terminating at a final ending state. (Phew)! Source: Wikipedia Source: http://en.wikipedia.org/wiki/Algorithm

  2. Algorithms: Example 1 Food Recipe A food recipe is a step-by-step procedure – like a list of instructions - to complete a task. A food recipe therefore is like an algorithm. In this analogy it can be compared to the software in a system. The hardware is the oven and the other cooking utensils. The input is the ingredients and the output is the cake. Source: Wikipedia

  3. Algorithms: Example 2 “Get To School” Designing algorithms is about designing solutions to solve problems. If you were to design an algorithm to solve the problem of ‘getting to school’ you would be able to solve this problem in several different ways (see left). Different algorithms can solve the same problem – but in different ways. Algorithms that solve the same problem may differ in length, efficiency and cost. In computer programming there are many different ways - algorithms - of solving a problem and completing a task. A computer program can be viewed as an elaborate algorithm. Walk to bus stop Wait for bus No.123 Get on bus Ride bus to school Get off bus at school bus stop Walk to class Get in car Be driven along City Road Turn left into Town Lane Car stops in drop off zone Get out of car Walk to class For more examples visit : http://computer.howstuffworks.com/question717.htm

  4. Algorithms: Flowcharts …making your thinking ‘visible’ Developing a flowchart helps to formalise the algorithm – and allows more choices, complexity and variables - crucial as you move past the simplest of algorithms. Simple problems can often be shown best as a flowchart. Flowcharts can help you to think logically about problems by working through each step. Flowcharts can help you explain your work to others – and they can follow your thinking (very useful when trying to ‘fault find’ errors /mistakes’ in your algorithms). Lamp does not work Lamp plugged in? No Plug in lamp Yes Bulb ‘blown’? Yes Replace bulb No What other steps could be included in this example? Repair lamp

  5. Algorithms: Flowcharts A Guide to understanding flow charts Source: xkcd.com/518/ http://www.cs.nyu.edu/~acase/classes/spring11/introprog/handouts/notes/class5.pdf stion717.htm

  6. Algorithms: Pseudocode ….like ‘real’ code Computer languages need the correct syntax or they do not work properly. Pseudocode has no real syntax rules because it is not real computer code – it is a natural language that is close to ‘computer ‘language. The benefit of pseudocode is that it enables the programmer to concentrate on the algorithms without worrying about all the syntax which is specific to a particular programming language. You can even write pseudocode without knowing what programming language you will use for the solution – and others could take your code but use it with a different language! 1.. If student's grade is greater than or equal to 60 Print "passed" else Print "failed" 2. Set total to zero Set grade counter to one While grade counter is less than or equal to ten Input the next grade Add the grade into the total Set the class average to the total divided by ten Print the class average.

  7. Algorithms On The Internet (1) PageRank PageRank is a famous algorithm used by the Google Internet search engine, that assigns a numeric value that represents how important a page is on the web. When one page links to another page, it is effectively casting a vote for the other page. The more votes that are cast for a page, the more important (in theory) the page must be. PageRank is Google's way of deciding a page's importance. It matters because it is one of the factors that determines a page's ranking in the search results. It isn't the only factor that Google uses to rank pages, but it is an important one. Cartoon representation of PageRank. Source Wikipedia: http://en.wikipedia.org/wiki/PageRank

  8. Algorithms On The Internet (2) EdgeRank / Amazon / Facebook EdgeRank is an algorithm developed by Facebook to govern what is displayed—and how high—on each users News Feed. Amazon uses a number of algorithms. The popularity list algorithm is the accumulated sales of a book’s last 30 days compared to those in its category–but free books given away only count for roughly 10% of a paid sale, and price is factored in as well, in that the higher your price, the more each sale counts for on the list. Formula: (sales + (0.1 x free downloads)) x (unknown sales factor) / last 30 days. Youtube uses a number of modified Amazon algorithms.

  9. Algorithms In The News (1) ‘Right Place Right Time’ Picture yourself in an expensive designer clothes shop. Your smartphone knows where you are – (thanks to the GPS) - and it alerts your bank through an automated system that you've signed up to. Knowing you've got a history of buying from similar stores, your bank also knows that you're running a bit low on cash. Your phone beeps. A text message. Buy it in the next 20 minutes and you can borrow the money at a good rate. Also you'll get 20% off the clothes. You make the purchase – thanks in part to a ‘right place, right time’ algorithm. Image: Cutegeek.com Research: Find out more about this type of algorithm: http://www.bbc.co.uk/news/business-19286426

  10. Algorithms In The News (2) Google Algorithms Sued Bettina Wulff - the wife of a former German president has filed a lawsuit against Google to remove autocomplete suggestions that she is claiming as libel.  Some of the suggestions that pop-up when searching for Bettina include the words “prostitute” and “red light”.   Head of PR for Google Germany, Kay Oberbeck, said the site's search terms were "algorithmically generated" and "include the popularity of the entered search terms". "All terms that appear have been previously entered by Google users," he added in a statement. Image source: http://pulse2.com Debate: Can the Google algorithm be manipulated? What problems may a case like this cause for Google?

More Related