Graph With Probable Mathematics for Computer Science Transitions MIT 6.042J/18.062J Outgoingedge 1/3 probabilities O sum to 1 Random Walks 1/4 2/3 B G 1/4 1/2 1 randomwalk.1 randomwalk.2 Albert R Meyer, May 13, 2015 Albert R Meyer, May 13, 2015 Example: Gambler’s Ruin Applications of Random Walk View as random walk on a line. • Physics — Brownian motion • Finance — stocks, options $0 $1 n1 n n+1 T1 T • Algorithms — web search, p p ::=Pr[win a bet] k clustering k+1 q ::= 1p = Pr[lose a bet] k k1 q What is Pr[reach T before 0]? randomwalk.3 randomwalk.4 Albert R Meyer, May 13, 2015 Albert R Meyer, May 13, 2015 1
Questions Example: Toss HTH before TTH ½ ½ H T 1/3 O H T T 1/4 2/3 B 1/4 G 1/2 1 • Pr[reach O in 7 steps| start at B] Pr[win] = Pr[win| ] • Average # steps from B to O = ½Pr[win| ] + ½Pr[win| ] H T • Pr[reach G before O | start at B] randomwalk.5 randomwalk.6 Albert R Meyer, May 13, 2015 Albert R Meyer, May 13, 2015 Example: Toss HTH before TTH Example: Toss HTH before TTH ½ ½ ½ ½ H T H T ½ ½ ½ H T T ½ H T T H T H T HH HT T HH HT T Pr[win| ] H = ½Pr[win| ] HH randomwalk.7 randomwalk.8 Albert R Meyer, May 13, 2015 Albert R Meyer, May 13, 2015 2
Example: Toss HTH before TTH Example: Toss HTH before TTH ½ ½ ½ ½ H T H T ½ H ½ T T ½ H ½ T T H T H T T H HH HT T HH HT T TH TT T Pr[win| ] H = ½Pr[win| ] + ½Pr[win| ] HH HT randomwalk.9 randomwalk.10 Albert R Meyer, May 13, 2015 Albert R Meyer, May 13, 2015 Example: Toss HTH before TTH Example: Toss HTH before TTH ½ ½ ½ ½ H T H T ½ ½ ½ H T ½ H T T H T H T T T H H HH HT T TH TT T HH HT T TH TT T T H Pr[win| ] T = ½Pr[win| ] + ½Pr[win| ] TH TT randomwalk.11 randomwalk.12 Albert R Meyer, May 13, 2015 Albert R Meyer, May 13, 2015 3
Example: Toss HTH before TTH Example: Toss HTH before TTH ½ ½ ½ ½ H T H T ½ H ½ T T ½ H ½ T T H T H T T T T H H HH HT T TH TT T HH HT T TH TT T T T H H T H T H H Pr[win| ] HH T H win H lose T = ½Pr[win| ] + ½Pr[win| ] HH HT Pr[win| ] = 1 Pr[win| ] = 0 lose win Now solve system of linear equations for Pr[win] randomwalk.13 randomwalk.14 Albert R Meyer, May 13, 2015 Albert R Meyer, May 13, 2015 Questions 1/3 O 1/4 2/3 B 1/4 G 1/2 1 • Pr[reach O in 7 steps| start at B] • Average # steps from B to O • Pr[reach G before O | start at B] Just solve systems of linear equations randomwalk.15 Albert R Meyer, May 13, 2015 4
MIT OpenCourseWare http s ://ocw.mit.edu 6.042J / 18.062J Mathematics for Computer Science Spring 20 15 For information about citing these materials or our Terms of Use, visit: http s ://ocw.mit.edu/terms.
Recommend
More recommend