1 / 58

Algorithms (wait, Math?) Everywhere…

Algorithms (wait, Math?) Everywhere…. Gerald Kruse, PhD . John ‘54 and Irene ‘58 Dale Professor of MA, CS and I T Interim Assistant Provost 2013-14 Juniata College Huntingdon, PA kruse@juniata.edu http://faculty.juniata.edu/kruse. Some Context / Confessions….

Download Presentation

Algorithms (wait, Math?) Everywhere…

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 (wait, Math?) Everywhere… Gerald Kruse, PhD. John ‘54 and Irene ‘58 Dale Professor of MA, CS and I T Interim Assistant Provost 2013-14 Juniata College Huntingdon, PA kruse@juniata.edu http://faculty.juniata.edu/kruse

  2. Some Context / Confessions… • Prepare to be underwhelmed. I can’t return the hour or so you spend here. • I am impressed by the elegance of the algorithms I will present today, and I will probably try too hard to explain the underlying math (“but it’s so cool…”). • We like and depend on many automated processes, we just have issues implementing or interacting with them. • But, when we understand an algorithm, we can manipulate it. (my CS 315 students “Google Bombed” Juniata… in a good way…). • Are we really surprised to learn that a Google search isn’t “free?”

  3. What movie should we pick?$1,000,000 to the first algorithm that was 10% better than Netflix’s original algorithm

  4. The first 8% improvement was easy…

  5. The first 8% improvement was easy… “Just A Guy In A Garage” Psychiatrist father and “hacker” daughter team

  6. The first 8% improvement was easy… Team from Bell Labs ended up winning

  7. Here’s an interesting billboard, from a few years ago in Silicon Valley

  8. First 70 digits ofe2.718281828459045235360287471352662497757247093699959574966967627724077

  9. What happened for those who found the answer? • The answer is 7427466391

  10. What happened for those who found the answer? • The answer is 7427466391 • Those who typed in the URL, http://7427466391.com , ended up getting another puzzle. Solving that lead them to a page with a job application for…

  11. What happened for those who found the answer? • The answer is 7427466391 • Those who typed in the URL, http://7427466391.com , ended up getting another puzzle. Solving that lead them to a page with a job application for… • Google!

  12. First Question (1) Just what does it take to solve that problem?

  13. First Question (1) Just what does it take to solve that problem?Calculations (most probably on a computer), knowledge of number theory, a general aptitude and interest in problem solving.

  14. Second Question (2) Why does Google want to hire people who know how to find that number, and what does it have to do with a search engine?

  15. Second Question (2) Why does Google want to hire people who know how to find that number, and what does it have to do with a search engine? Hmmm… Google wants you to choose it for your web searches.

  16. Second Question (2) Why does Google want to hire people who know how to find that number, and what does it have to do with a search engine? Hmmm… Google wants you to choose it for your web searches.Maybe their algorithms are mathematically based?

  17. “Google-ing” Google

  18. Results in an early paper from Page, Brin et. al. while in graduate school

  19. Search EnginesWe’ve all used them, but what is “under the hood?” • Crawl the web and locate all* public pages • Index the “crawled” data so it can be searched • Rank the pages for more effective searching ( the “math” part of this talk ) • Each word which is searched on is linked with a list of pages (just URL’s) which contain it. The pages with the highest rank are returned first. * - can’t get a “snapshot” of the web at a particular instance

  20. Note:Google’s PageRank uses the link structure (“crowd sourcing”) of the World Wide Web to determine a page’s rank, it doesn’t grade content of a page.

  21. PageRank is NOT a simple citation index Which is the more popular page below, A or B? A B

  22. PageRank is NOT a simple citation index Which is the more popular page below, A or B?What if the links to A were from unpopular pages, and the one link to B was from www.yahoo.com ? (High School…) A B • NOTE: • Rankings based on citation index would be very easy to manipulate

  23. PageRank is NOT a simple citation index Which is the more popular page below, A or B?What if the links to A were from unpopular pages, and the one link to B was from www.yahoo.com ? (High School…) A B • NOTE: • Rankings based on citation index would be very easy to manipulate • PageRank has evolved to be a minor part of Google’s search results.

  24. Intuitively PageRank is analogous to popularity • The web as a graph: each page is a vertex, each hyperlink a directed edge. Page A Page B Which of these three would have the highest page rank? Page C

  25. Intuitively PageRank is analogous to popularity • The web as a graph: each page is a vertex, each hyperlink a directed edge. • A page is popular if a few very popular pages point (via hyperlinks) to it. Page A Page B Which of these three would have the highest page rank? Page C

  26. Intuitively PageRank is analogous to popularity • The web as a graph: each page is a vertex, each hyperlink a directed edge. • A page is popular if a few very popular pages point (via hyperlinks) to it. • A page could be popular if many not-necessarily popular pages point (via hyperlinks) to it. Page A Page B Which of these three would have the highest page rank? Page C

  27. So what is the mathematical definition of PageRank? In particular, a page’s rank is equal to the sum of the ranks of all the pages pointing to it. note the scaling of each page rank

  28. Writing out the equation for each web-page in our example gives: Page A Page B Page C

  29. Even though this is a circular definition we can calculate the ranks.

  30. Even though this is a circular definition we can calculate the ranks.Re-write the system of equations as a Matrix-Vector product.

  31. Even though this is a circular definition we can calculate the ranks.Re-write the system of equations as a Matrix-Vector product. The PageRank vector is simply an eigenvector of the coefficient matrix, with

  32. Wait… what’s an eigenvector?

  33. PageRank = 0.4 PageRank = 0.2 Page A Page B Page C PageRank = 0.4 Note: we choose the eigenvector with

  34. Implementation Details • Billions of web-pages would make a huge matrix • The matrix (in theory) is column-stochastic, which allows for iterative calculation • Previous PageRank is used as an initial guess • Random-Surfer term handles computational difficulties associated with a “disconnected graph”

  35. Wait… whatelse gets searched?

  36. Attempts to Manipulate Search Results Via a “Google Bomb”

  37. Liberals vs. Conservatives! In 2007, Google addressed Google Bombs, too many people thought the results were intentional and not merely a function of the structure of the web

  38. Juniata’s own “Google Bomb”

  39. At Juniata, CS 315 is my “Analysis and Algorithms” course

  40. Try a search in Google on “PigeonRank.” • What types of sites would Google NOT give good results on? • PageRankhas been deprecated. Google is continuosly trying new ranking algorithms. Miscellaneous points

  41. A “rules” approach… filter out all messages with things like, “Dear Friend” or “Click.” • The first 80% is captured easily, with few false-positives. • But the last few % (remember Netflix) will be difficult to catch, the rules will offer many more false-positives, and the SPAMM’ers can adapt. • A statistical approach, called a Bayesian filter, is much more effective. • It “learns” from a given set of SPAM and non-SPAM emails, automatically counting the frequency of words. • Some words are incriminating, like “Madam,” others almost guarantee the email is non-SPAM, like “describe,” or “example.” SPAM filters

  42. [1] S. Brin, L. Page, et. al., The PageRank Citation Ranking: Bringing Order to the Web, http://dbpubs.stanford.edu/pub/1999-66 , Stanford Digital Libraries Project (January 29, 1998). [2] K. Bryan and T. Leise, The $25,000,000,000 Eigenvector: The Linear Algebra behind Google, SIAM Review, 48 (2006), pp. 569-581. [3] G. Strang, Linear Algebra and Its Applications, Brooks-Cole, Boston, MA, 2005. [4] D. Poole, Linear Algebra: A Modern Introduction, Brooks-Cole, Boston, MA, 2005. Bibliography

  43. Any Questions? Slides available at http://faculty.juniata.edu/kruse

  44. The following slides give some of the more in-depth mathematics behind Google

  45. A Graphical Interpretation of a 2-Dimensional Eigenvectorhttp://cnx.org/content/m10736/latest/ If we have some 2-D vector x, and some 2 x 2 matrix A, generally their product, A*x = b, will result in a new vector, b, which is pointing in a different direction and having a different length than x.

  46. A Graphical Interpretation of a 2-Dimensional Eigenvectorhttp://cnx.org/content/m10736/latest/ If we have some 2-D vector x, and some 2 x 2 matrix A, generally their product, A*x = b, will result in a new vector, b, which is pointing in a different direction and having a different length than x. But, if the vector (v in the image at the left) is an eigenvector of A, then A*v will give a vector which is same direction as v,but just scaled a different length, by λ. Note that λ is called an eigenvalue of A.

More Related