Presentation is loading. Please wait.

Presentation is loading. Please wait.

Andrei Andreyevich Markov 1856 - 1922. Markov Chains.

Similar presentations


Presentation on theme: "Andrei Andreyevich Markov 1856 - 1922. Markov Chains."— Presentation transcript:

1 Andrei Andreyevich Markov 1856 - 1922

2 Markov Chains

3 Probability Typically measured between 0.0 and 1.0 For events following another event must total 1.0 Important in statistics Be careful in establishing (e.g., the probability of heads up on a tossed coin is forever 0.5 no matter how many times the coin is tossed). Americans have 2.5 children

4 Zero order Markov Chain Pseudo-random choices.

5 First order Markov Chain indicates that the current event will effect the choice of the following event.

6 First order state transition matrix (stm)

7 Second order Markov chain Two successive events will influence the next event

8

9 Markov Chains Are a type of grammar (syntax) Many types of grammars (e.g., finite state, recursive, augmented transition, etc.) These are typically linear Robust grammars require hierarchy Hierarchy is non-linear

10 Markov Analysis Select data Extract pitches Place pitches in STM Create code for doing above

11 Details Some cope-events: ’((0 60 1000 1 127) (1000 60 1000 1 127)(2000 62 1000 1 127) (3000 61 1000 1 127)(4000 60 1000 1 127)(5000 60 1000 1 127)) Get the pitches: (mapcar #’second....) = (60 60 62 61 60 60) Place in an stm (defvar *stm* ()) Data can look like this ((60 (60 61 60)) (62 (61)) (61 (60))) which equates to:

12 Code details Create a blank *stm* Create a function that adds stuff to *stm* Create two sub functions 1) that adds a new entry if none exists 2) adds a new following pitch to an existing entry if one does exist

13 Needs “assoc” is a good function for testing whether or not an entry is present in a composite list as in (assoc 2 '((1 (2 2))(2 (3 3))) :test #'equal) which returns (2 (3 3))

14 Also (substitute ‘(2 (3 3 3)) '(2 (3 3)) '((1 (2 2))(2 (3 3))) :test #'equal) returns ((1 (2 2)) (2 (3 3 3))) But “substitute” is not destructive. That is, “substitute” does not actually alter a global variable, you’ll have to reset the variable yourself. In other words, if: (defvar *stm* ‘((2 (3 3))(4 (5 5)))) and you do (substitute ‘(4 (5 5 6)) ‘(4 (5 5)) *stm* :test #’equal) *stm* will remain the same you’ll have to (setf *stm* (substitute ‘(4 (5 5 6) ‘(4 (5 5)) *stm* :test #’equal))

15 Markov Composition Use an STM Select first pitch randomly (careful) Continue until unable to proceed


Download ppt "Andrei Andreyevich Markov 1856 - 1922. Markov Chains."

Similar presentations


Ads by Google