Markov chains Part 2. Prof. Noah Snavely CS1114

Hasonló dokumentumok
Genome 373: Hidden Markov Models I. Doug Fowler

On The Number Of Slim Semimodular Lattices

Angol Középfokú Nyelvvizsgázók Bibliája: Nyelvtani összefoglalás, 30 kidolgozott szóbeli tétel, esszé és minta levelek + rendhagyó igék jelentéssel

3. MINTAFELADATSOR KÖZÉPSZINT. Az írásbeli vizsga időtartama: 30 perc. III. Hallott szöveg értése

ANGOL NYELVI SZINTFELMÉRŐ 2014 A CSOPORT

ANGOL NYELV KÖZÉPSZINT SZÓBELI VIZSGA I. VIZSGÁZTATÓI PÉLDÁNY

Lopocsi Istvánné MINTA DOLGOZATOK FELTÉTELES MONDATOK. (1 st, 2 nd, 3 rd CONDITIONAL) + ANSWER KEY PRESENT PERFECT + ANSWER KEY

ANGOL NYELVI SZINTFELMÉRŐ 2012 A CSOPORT. to into after of about on for in at from

Előszó.2. Starter exercises. 3. Exercises for kids.. 9. Our comic...17

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet Nonparametric Tests

ANGOL NYELV KÖZÉPSZINT SZÓBELI VIZSGA I. VIZSGÁZTATÓI PÉLDÁNY

Construction of a cube given with its centre and a sideline

Please stay here. Peter asked me to stay there. He asked me if I could do it then. Can you do it now?

Mapping Sequencing Reads to a Reference Genome

Phenotype. Genotype. It is like any other experiment! What is a bioinformatics experiment? Remember the Goal. Infectious Disease Paradigm

PAST ÉS PAST PERFECT SUBJUNCTIVE (múlt idejű kötőmód)

ANGOL NYELVI SZINTFELMÉRŐ 2013 A CSOPORT. on of for from in by with up to at

Tudományos Ismeretterjesztő Társulat

Cluster Analysis. Potyó László

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet. Nonparametric Tests. Petra Petrovics.

Correlation & Linear Regression in SPSS

Minta ANGOL NYELV KÖZÉPSZINT SZÓBELI VIZSGA II. Minta VIZSGÁZTATÓI PÉLDÁNY

HALLÁS UTÁNI SZÖVEGÉRTÉS 25. Beauty and the Beast Chapter Two Beauty s rose


Lesson 1 On the train

(Asking for permission) (-hatok/-hetek?; Szabad ni? Lehet ni?) Az engedélykérés kifejezésére a következő segédigéket használhatjuk: vagy vagy vagy

7. osztály Angol nyelv

STUDENT LOGBOOK. 1 week general practice course for the 6 th year medical students SEMMELWEIS EGYETEM. Name of the student:

- eqµah ³. -ry³eblbmebjkargar³

MATEMATIKA ANGOL NYELVEN

Lexington Public Schools 146 Maple Street Lexington, Massachusetts 02420

EXKLUZÍV AJÁNDÉKANYAGOD A Phrasal Verb hadsereg! 2. rész

I must go now. He said he must leave early. You must learn the poem by heart.

TestLine - Angol teszt Minta feladatsor

PONTOS IDŐ MEGADÁSA. Néha szükséges lehet megjelölni, hogy délelőtti vagy délutáni / esti időpontról van-e szó. Ezt kétféle képpen tehetjük meg:

Angol szóbeli Információkérés

Széchenyi István Egyetem

Where are the parrots? (Hol vannak a papagájok?)

Hogyan használja az OROS online pótalkatrész jegyzéket?

1. feladat: Hallgasd meg az angol szöveget, legalább egyszer.

ANGOL NYELV Helyi tanterv

Budapest By Vince Kiado, Klösz György

1. MINTAFELADATSOR KÖZÉPSZINT. Az írásbeli vizsga időtartama: 30 perc. III. Hallott szöveg értése

Tudok köszönni tegezve és önözve, és el tudok búcsúzni. I can greet people in formal and informal ways. I can also say goodbye to them.

Travel Getting Around

Statistical Inference

Tudományos Ismeretterjesztő Társulat

Regional Expert Meeting Livestock based Geographical Indication chains as an entry point to maintain agro-biodiversity

MATEMATIKA ANGOL NYELVEN

Felhívás. érted is amit olvasol? (Apostolok Cselekedetei 8:30)

MATEMATIKA ANGOL NYELVEN MATHEMATICS

ANGOL NYELVI SZINTFELMÉRŐ 2008 A CSOPORT

Pletykaalapú gépi tanulás teljesen elosztott környezetben

T Á J É K O Z T A T Ó. A 1108INT számú nyomtatvány a webcímen a Letöltések Nyomtatványkitöltő programok fülön érhető el.

Megyei Angol csapatverseny 2015/16. MOVERS - 3. forduló

ANGOL SZINTFELMÉRŐ. Cégnév: Kérem egészítse ki John és Mary beszélgetését a megadott szavakkal! A szavak alakján nem kell változtatnia!

Computer Architecture

EGY KIS ZŰRZAVAR. Lecke (Középhaladó 1. / 1.) SOMETIMES, SOMETIME VAGY SOME TIME?

Magyar - Angol Orvosi Szotar - Hungarian English Medical Dictionary (English And Hungarian Edition) READ ONLINE

7. Bemutatom a barátomat, Pétert. 8. Hogy hívják Önt? 9. Nagyon örülök, hogy találkoztunk. 10. Nem értem Önt. 11. Kérem, beszéljen lassabban.

Relative Clauses Alárendelő mellékmondat

JustareminderaboutschoolphotosonThursday2May.Summeruniformplease.

Csima Judit április 9.

Correlation & Linear Regression in SPSS

Can/be able to. Using Can in Present, Past, and Future. A Can jelen, múlt és jövő idejű használata

OLYMPICS! SUMMER CAMP

Tavaszi Sporttábor / Spring Sports Camp május (péntek vasárnap) May 2016 (Friday Sunday)

USER MANUAL Guest user

mondat ami nélkül ne indulj el külföldre

EGYSZERŰNEK TŰNIK IV. RÉSZ

Véges szavak általánosított részszó-bonyolultsága

Lecture 11: Genetic Algorithms

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet. Hypothesis Testing. Petra Petrovics.

MATEMATIKA ANGOL NYELVEN MATHEMATICS

Adatbázisok 1. Rekurzió a Datalogban és SQL-99

Miskolci Egyetem Gazdaságtudományi Kar Üzleti Információgazdálkodási és Módszertani Intézet. Correlation & Linear. Petra Petrovics.

3. MINTAFELADATSOR EMELT SZINT. Az írásbeli vizsga időtartama: 30 perc. III. Hallott szöveg értése

EN United in diversity EN A8-0206/419. Amendment

MATEMATIKA ANGOL NYELVEN MATHEMATICS

UTÓKÉRDÉSEK (Tag-questions)

bab.la Cümle Kalıpları: İş Sipariş İngilizce-Macarca

bab.la Cümle Kalıpları: İş Sipariş Macarca-İngilizce

Using the CW-Net in a user defined IP network

IGEIDŐK -ÖSSZEFOGLALÓ HALADÓ SZINT

Intézményi IKI Gazdasági Nyelvi Vizsga

Angol érettségi témakörök 12.KL, 13.KM, 12.F

6. évfolyam Angol nyelv

Mr. Adam Smith Smith's Plastics 8 Crossfield Road Selly Oak Birmingham West Midlands B29 1WQ

A modern e-learning lehetőségei a tűzoltók oktatásának fejlesztésében. Dicse Jenő üzletfejlesztési igazgató

Tel.: (+361) , FAX: (+361) vagy Honlap:

Tájékoztató a évi határon átnyúló pénzügyi fogyasztói jogviták rendezésével összefüggő és egyéb nemzetközi tevékenységről

82. FELADATLAP 3 feladat 3 szinten

ANGOL NYELVI SZINTFELMÉRŐ 2015 B CSOPORT

Személyes adatváltoztatási formanyomtatvány- Magyarország / Personal Data Change Form - Hungary

There is/are/were/was/will be

DF HELYETTESÍTŐ NYELVVIZSGA 1. (Angol nyelv) február 21. Név:. Neptunkód: 1. feladat

Unit 10: In Context 55. In Context. What's the Exam Task? Mediation Task B 2: Translation of an informal letter from Hungarian to English.

MATEMATIKA ANGOL NYELVEN

Tájékoztató azon kérelmezési eljárásokról, melyek az elméleti, gyakorlati és szakszolgálati engedélyezésre vonatkoznak

Átírás:

Markov chains Part 2 Prof. Noah Snavely CS4 http://cs4.cs.cornell.edu

Administrivia Guest lecture on Thursday, Prof. Charles Van Loan Assignments: A5P2 due on Friday by 5pm A6 will be out on Friday Quiz next Thursday, 4/23 2

Administrivia Final projects Due on Friday, May 8 (tentative) You can work in groups of up to 3 Please form groups and send me a proposal for your final project by Wednesday Not graded, but required 3

Least squares Objective function: Model: 4

Sorting and convex hull Suppose we had an O(n) algorithm for sorting What does this tell us about the problem of computing a convex hull? 5

Incremental convex hull Starting from a triangle, we add n points, one at a time Given a convex hull with k points assume: It takes k operations to test if a new point is inside the convex hull It takes k operations to add a new point to the convex hull Our convex hull never shrinks (in terms of number of points) 6

Incremental convex hull How long does it take if: All of the points are inside the original triangle? Answer: 3 + 3 + 3 + (n times) + 3 = O(n) None of the points are inside the prev. conv. hull? Answer: 6 + 8 + 0 + (n times) + 2n = O(n 2 ) The first 0% of points are added, last 90% aren t Answer: 6 + 8 + (0.n times) + 0.2n + 0.n + (0.9n times) + 0.n = O(n 2 ) n sqrt(n) are not added, then sqrt(n) are Answer: 3 + 3 + (n sqrt(n) times) + 3 + 6 + (sqrt(n) times) + 2sqrt(n) = O(n) 7

Computing nearest neighbors Suppose we have two sets of (d-dimensional) vectors, A and B A has m vectors, B has n vectors For each vector in A, we want to find the closest vector in B How do we do this quickly? The straightforward way (nested for loops) is horribly slow You learned a better way in section You ll learn another one tomorrow 8

Markov chains Example: Springtime in Ithaca We can represent this as a kind of graph (N = Nice, S = Snowy, R = Rainy) 0.75 0.25 N 0.25 0.25 0.25 S 0.5 R 0.5 N R S N R S 0.25 Transition probabilities 9

Markov chains What s the weather in 20 days? Almost completely independent of the weather today The row [0.2 0.44 0.36] is called the stationary distribution of the Markov chain Over a long time, we expect 20% of days to be nice, 44% to be rainy, and 36% to be snowy 0

Stationary distributions Constant columns are mapped to themselves: So why do we converge to these particular columns?

Stationary distributions The vector [0.2 0.2 0.2] is unchanged by multiplication by P : The vector [0.2 0.44 0.36] is unchanged by multiplication by P T : Where have we seen this before? 2

Stationary distributions [0.2 0.2 0.2] is called an eigenvector of P a vector x such that Px = x (in linear algebra, you ll learn that the exact definition is a vector x such that Px = λx) [0.2 0.44 0.36] is an eigenvector of P P x = x If we look at a long sequence, the proportion of days we expect to be nice/rainy/snowy You won t have to remember this (at least for this class) 3

Markov Chain Example: Text A dog is a man s best friend. It s a dog eat dog world out there. a dog is man s best 2/3 /3 /3 /3 /3 friend it s eat world out there. a dog is man s best friend it s world eat out there. (Slide credit: Steve Seitz)

Text synthesis It s a dog is a man s best friend. It s a dog eat dog eat dog is a dog This is called a random walk Questions about random walks: What s the probability of being at the word dog after generating n words? How long does it take (on average) to generate all words at least once? These have important applications 5

Google s PageRank http://en.wikipedia.org/wiki/markov_chain Page, Lawrence; Brin, Sergey; Motwani, Rajeev and Winograd, Terry (999). The PageRank citation ranking: Bringing order to the Web. See also: J. Kleinberg. Authoritative sources in a hyperlinked environment. Proc. 9th ACM-SIAM Symposium on Discrete Algorithms, 998. 6

Google s PageRank H A Graph of the Internet (pages and links) I D B E C F J G 7

Google s PageRank H A Start at a random page, take a random walk. Where do we end up? I D B E C F J G 8

Google s PageRank H A Add 5% probability of moving to a random page. Now where do we end up? I D B E C F J G 9

Google s PageRank H A PageRank(P) = Probability that a long random walk ends at node P I D B E C F J G 20

(The ranks are an eigenvector of the transition matrix) 2

Back to text We can use Markov chains to generate new text Can they also help us recognize text? In particular, the author? Who wrote this paragraph? Suppose that communal kitchen years to come perhaps. All trotting down with porringers and tommycans to be filled. Devour contents in the street. John Howard Parnell example the provost of Trinity every mother's son don't talk of your provosts and provost of Trinity women and children cabmen priests parsons fieldmarshals archbishops. 22

Author recognition We can use Markov chains to generate new text Can they also help us recognize text? How about this one? Diess Alles schaute Zarathustra mit grosser Verwunderung; dann prüfte er jeden Einzelnen seiner Gäste mit leutseliger Neugierde, las ihre Seelen ab und wunderte sich von Neuem. Inzwischen hatten sich die Versammelten von ihren Sitzen erhoben und warteten mit Ehrfurcht, dass Zarathustra reden werde. 23

The Federalist Papers 85 articles addressed to New York State, arguing for ratification of the Constitution (787-788) Written by Publius (?) Really written by three different authors: John Jay, James Madison, Andrew Hamilton Who wrote which one? 73 have known authors, 2 are in dispute 24

Can we help? Suppose we want to know who wrote a given paragraph/page/article of text Idea: for each suspected author: Download all of their works Compute the transition matrix Find out which author s transition matrix is the best fit to the paragraph 25

Author recognition Simple problem: Given two Markov chains, say Austen (A) and Dickens (D), and a string s (with n words), how do we decide whether A or D wrote s? Idea: For both A and D, compute the probability that a random walk of length n generates s 26

Probability of a sequence What is the probability of a given n-length sequence s? s = s s 2 s 3 s n Probability of generating s = the product of transition probabilities: Probability that a sequence starts with s Transition probabilities 27

Likelihood Compute this probability for A and D likelihood of A Jane Austen wrote s Charles Dickens wrote s likelihood of D??? 28

a dog is man s best 2/3 /3 /3 /3 /3 friend it s eat world out there. a dog is man s best friend it s world eat out there. Pr( is a dog is a dog ) =? Pr( is dog man s best friend ) =?

Next time Section: more information on how to actually compute this Guest lecture by Charles Van Loan 30