How to walk home drunk. Some Great Theoretical Ideas in Computer Science for. Probability Refresher. Probability Refresher.

Similar documents
Randomized Algorithms I, Spring 2018, Department of Computer Science, University of Helsinki Homework 1: Solutions (Discussed January 25, 2018)

n outcome is (+1,+1, 1,..., 1). Let the r.v. X denote our position (relative to our starting point 0) after n moves. Thus X = X 1 + X 2 + +X n,

PRACTICE PROBLEMS FOR THE FINAL

6.3 Testing Series With Positive Terms

Problem Set 2 Solutions

Random Models. Tusheng Zhang. February 14, 2013

Final Review for MATH 3510

( ) = p and P( i = b) = q.

Lecture 2: April 3, 2013

Infinite Sequences and Series

Discrete Mathematics for CS Spring 2007 Luca Trevisan Lecture 22

Discrete Mathematics and Probability Theory Fall 2016 Walrand Probability: An Overview

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 19

(b) What is the probability that a particle reaches the upper boundary n before the lower boundary m?

Lecture Chapter 6: Convergence of Random Sequences

The Random Walk For Dummies

PUTNAM TRAINING PROBABILITY

f X (12) = Pr(X = 12) = Pr({(6, 6)}) = 1/36

PRACTICE PROBLEMS FOR THE FINAL

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Lecture 16

CS 171 Lecture Outline October 09, 2008

f X (12) = Pr(X = 12) = Pr({(6, 6)}) = 1/36

Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 21. Some Important Distributions

An Introduction to Randomized Algorithms

CS / MCS 401 Homework 3 grader solutions

MATH 472 / SPRING 2013 ASSIGNMENT 2: DUE FEBRUARY 4 FINALIZED

Quiz No. 1. ln n n. 1. Define: an infinite sequence A function whose domain is N 2. Define: a convergent sequence A sequence that has a limit

1. Hilbert s Grand Hotel. The Hilbert s Grand Hotel has infinite many rooms numbered 1, 2, 3, 4

CSE 202 Homework 1 Matthias Springer, A Yes, there does always exist a perfect matching without a strong instability.

MA131 - Analysis 1. Workbook 2 Sequences I

Discrete Mathematics for CS Spring 2008 David Wagner Note 22

Design and Analysis of Algorithms

Problems from 9th edition of Probability and Statistical Inference by Hogg, Tanis and Zimmerman:

Sequences I. Chapter Introduction

Understanding Samples

UC Berkeley Department of Electrical Engineering and Computer Sciences. EE126: Probability and Random Processes

Math 113 Exam 3 Practice

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

Induction: Solutions

HOMEWORK 2 SOLUTIONS

For example suppose we divide the interval [0,2] into 5 equal subintervals of length

1 Generating functions for balls in boxes

Massachusetts Institute of Technology

Putnam Training Exercise Counting, Probability, Pigeonhole Principle (Answers)

Random Variables, Sampling and Estimation

Econ 325/327 Notes on Sample Mean, Sample Proportion, Central Limit Theorem, Chi-square Distribution, Student s t distribution 1.

(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3

Class 23. Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science. Marquette University MATH 1700

Chapter 6: Numerical Series

Lecture 14: Randomized Computation (cont.)

Monkeys and Walks. Muhammad Waliji. August 12, 2006

Data Analysis and Statistical Methods Statistics 651

BHW #13 1/ Cooper. ENGR 323 Probabilistic Analysis Beautiful Homework # 13

kp(x = k) = λe λ λ k 1 (k 1)! = λe λ r k e λλk k! = e λ g(r) = e λ e rλ = e λ(r 1) g (1) = E[X] = λ g(r) = kr k 1 e λλk k! = E[X]

MAT1026 Calculus II Basic Convergence Tests for Series

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 15

Lecture 12: November 13, 2018

multiplies all measures of center and the standard deviation and range by k, while the variance is multiplied by k 2.

Mathematics Extension 2

Discrete Mathematics and Probability Theory Spring 2012 Alistair Sinclair Note 15

Lecture 9: Hierarchy Theorems

0, otherwise. EX = E(X 1 + X n ) = EX j = np and. Var(X j ) = np(1 p). Var(X) = Var(X X n ) =

MA131 - Analysis 1. Workbook 3 Sequences II

MAT136H1F - Calculus I (B) Long Quiz 1. T0101 (M3) Time: 20 minutes. The quiz consists of four questions. Each question is worth 2 points. Good Luck!

Math 110 Assignment #6 Due: Monday, February 10

USA Mathematical Talent Search Round 3 Solutions Year 27 Academic Year

Part A, for both Section 200 and Section 501

Math 120 Answers for Homework 23

WORKING WITH NUMBERS

Convergence of random variables. (telegram style notes) P.J.C. Spreij

Part I: Covers Sequence through Series Comparison Tests

Ma 530 Introduction to Power Series

Math 525: Lecture 5. January 18, 2018

f(x) dx as we do. 2x dx x also diverges. Solution: We compute 2x dx lim

Roberto s Notes on Infinite Series Chapter 1: Sequences and series Section 3. Geometric series

For example suppose we divide the interval [0,2] into 5 equal subintervals of length

Homework 5 Solutions

DS 100: Principles and Techniques of Data Science Date: April 13, Discussion #10

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled

Math 113 Exam 3 Practice

Hypothesis Testing. Evaluation of Performance of Learned h. Issues. Trade-off Between Bias and Variance

Lecture 3: August 31

Chapter 5. Inequalities. 5.1 The Markov and Chebyshev inequalities

Chapter 6 Overview: Sequences and Numerical Series. For the purposes of AP, this topic is broken into four basic subtopics:

SEQUENCE AND SERIES NCERT

Chapter 7: Numerical Series

SCORE. Exam 2. MA 114 Exam 2 Fall 2016

Lecture 2: Concentration Bounds

University of Colorado Denver Dept. Math. & Stat. Sciences Applied Analysis Preliminary Exam 13 January 2012, 10:00 am 2:00 pm. Good luck!

Skip Lists. Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 S 3 S S 1

CS 270 Algorithms. Oliver Kullmann. Growth of Functions. Divide-and- Conquer Min-Max- Problem. Tutorial. Reading from CLRS for week 2

7.1 Convergence of sequences of random variables

STA 348 Introduction to Stochastic Processes. Lecture 1

Confidence Intervals QMET103

10.2 Infinite Series Contemporary Calculus 1

P1 Chapter 8 :: Binomial Expansion

SEQUENCES AND SERIES

Massachusetts Institute of Technology

Taylor Series (BC Only)

Lecture 2 February 8, 2016

Transcription:

15251 Some Great Theoretical Ideas i Computer Sciece for "My frieds keep askig me what 251 is like. I lik them to this video: http://youtube.com/watch?v=m275pjvwrli" Probability Refresher What s a Radom Variable? A Radom Variable is a realvalued fuctio o a sample space S E[X+Y] = E[X] + E[Y] Probability Refresher What does this mea: E[X A]? Is this true: Pr[ A ] = Pr[ A B ] Pr[ B ] + Pr[ A B ] Pr[ B ] Similarly: Yes! E[ X ] = E[ X A ] Pr[ A ] + E[ X A ] Pr[ A ] Radom Walks Lecture 13 (February 26, 2008) How to walk home druk 1

Abstractio of Studet Life 0.4 probability No ew ideas Work 0.3 Wait 0.3 Eat 0.01 Solve HW problem Hugry Work 0.99 Abstractio of Studet Life No ew ideas Wait Eat Hugry Work Like fiite automata, but istead 0.4 of a determiisic 0.3 or odetermiistic 0.3 0.01 0.99 actio, we have a probabilistic actio Work Solve HW Example questios: What problem is the probability of reachig goal o strig Work,Eat,Work? Simpler: Radom Walks o Graphs Simpler: Radom Walks o Graphs At ay ode, go to oe of the eighbors of the ode with equal probability At ay ode, go to oe of the eighbors of the ode with equal probability Simpler: Radom Walks o Graphs Simpler: Radom Walks o Graphs At ay ode, go to oe of the eighbors of the ode with equal probability At ay ode, go to oe of the eighbors of the ode with equal probability 2

Simpler: Radom Walks o Graphs Radom Walk o a Lie You go ito a casio with $k, ad at each time step, you bet $1 o a fair game You leave whe you are broke or have $ At ay ode, go to oe of the eighbors of the ode with equal probability 0 Questio 1: what is your expected amout of moey at time t? k Let X t be a R.V. for the amout of $$$ at time t Radom Walk o a Lie You go ito a casio with $k, ad at each time step, you bet $1 o a fair game You leave whe you are broke or have $ 0 k X t = k + δ 1 + δ 2 +... + δ t, (δ i is RV for chage i your moey at time i) E[δ i ] = 0 So, E[X t ] = k Radom Walk o a Lie You go ito a casio with $k, ad at each time step, you bet $1 o a fair game You leave whe you are broke or have $ 0 k Questio 2: what is the probability that you leave with $? Radom Walk o a Lie Questio 2: what is the probability that you leave with $? E[X t ] = k E[X t ] = E[X t X t = 0] Pr(X t = 0) + E[X t X t = ] Pr(X t = ) + E[ X t either] Pr(either) k = Pr(X t = ) + (somethig t ) Pr(either) As t, Pr(either) 0, also somethig t < Hece Pr(X t = ) k/ Aother Way To Look At It You go ito a casio with $k, ad at each time step, you bet $1 o a fair game You leave whe you are broke or have $ 0 k Questio 2: what is the probability that you leave with $? = probability that I hit gree before I hit red 3

Radom Walks ad Electrical Networks What is chace I reach gree before red? Radom Walks ad Electrical Networks Same as voltage if edges are resistors ad we put 1volt battery betwee gree ad red p x = Pr(reach gree first startig from x) p gree = 1, p red = 0 Ad for the rest p x = Average y Nbr(x) (p y ) Same as equatios for voltage if edges all have same resistace! Aother Way To Look At It You go ito a casio with $k, ad at each time step, you bet $1 o a fair game You leave whe you are broke or have $ 0 k Questio 2: what is the probability that you leave with $? voltage(k) = k/ = Pr[ hittig before 0 startig at k]!!! Gettig Back Home Lost i a city, you wat to get back to your hotel How should you do this? Depth First Search! Requires a good memory ad a piece of chalk Gettig Back Home Will this work? Is Pr[ reach home ] = 1? Whe will I get home? What is E[ time to reach home ]? How about walkig radomly? 4

Pr[ will reach home ] = 1 We Will Evetually Get Home Look at the first steps There is a ozero chace p 1 that we get home Also, p 1 (1/) Suppose we fail The, wherever we are, there is a chace p 2 (1/) that we hit home i the ext steps from there Probability of failig to reach home by time k = (1 p 1 )(1 p 2 ) (1 p k ) 0 as k Furthermore: If the graph has odes ad m edges, the E[ time to visit all odes ] 2m (1) Cover Times Cover time (from u) C u = E [ time to visit all vertices start at u ] Cover time of the graph C(G) = max u { C u } (worst case expected time to see all vertices) E[ time to reach home ]is at most this Cover Time Theorem If the graph G has odes ad m edges, the the cover time of G is C(G) 2m ( 1) Actually, we get home pretty fast Chace that we do t hit home by (2k)2m(1) steps is () k Ay graph o vertices has < 2 /2 edges Hece C(G) < 3 for all graphs G 5

A Simple Calculatio True of False: If the average icome of people is $100 the more tha 50% of the people ca be earig more tha $200 each Markov s Iequality If X is a oegative r.v. with mea E[X], the Pr[ X > 2 E[X] ] Pr[ X > k E[X] ] 1/k False! else the average would be higher!!! Adrei A. Markov Markov s Iequality Noeg radom variable X has expectatio A = E[X] A = E[X] = E[X X > 2A ] Pr[X > 2A] + E[X X 2A ] Pr[X 2A] E[X X > 2A ] Pr[X > 2A] (sice X is oeg) Actually, we get home pretty fast Chace that we do t hit home by (2k)2m(1) steps is () k Also, E[X X > 2A] > 2A A 2A Pr[X > 2A] Pr[X > 2A] Pr[ X > k expectatio ] 1/k A Averagig Argumet Suppose I start at u E[ time to hit all vertices start at u ] C(G) Hece, by Markov s Iequality: Pr[ time to hit all vertices > 2C(G) start at u ] So Let s Walk Some Mo! Pr [ time to hit all vertices > 2C(G) start at u ] Suppose at time 2C(G), I m at some ode with more odes still to visit Pr [ have t hit all vertices i 2C(G) more time start at v ] Chace that you failed both times = () 2 Hece, Pr[ havet hit everyoe i time k 2C(G) ] () k 6

Hece, if we kow that Expected Cover Time C(G) < 2m(1) the Pr[ home by time 4k m(1) ] 1 () k Radom walks o ifiite graphs Radom Walk O a Lie Radom Walk O a Lie 0 i Flip a ubiased coi ad go left/right Let X t be the positio at time t Pr[ X t = i ] = Pr[ #heads #tails = i] = Pr[ #heads (t #heads) = i] = t (t+i)/2 /2t Pr[ X 2t = 0] = 2t t 0 i /2 2t ˡ (1/ t) Y 2t = idicator for (X 2t = 0) E[ Y 2t ] = ˡ Z 2 = umber of visits to origi i 2 steps E[ Z 2 ] = E[ t = 1 Y 2t ] ˡ (1/ 1 + 1/ 2 + + 1/ ) = ˡ Sterlig s approx ( ) (1/ t) How About a 2d Grid? I steps, you expect to retur to the origi ( ) times! Let us simplify our 2d radom walk: move i both the xdirectio ad ydirectio 7

How About a 2d Grid? Let us simplify our 2d radom walk: move i both the xdirectio ad ydirectio How About a 2d Grid? Let us simplify our 2d radom walk: move i both the xdirectio ad ydirectio How About a 2d Grid? Let us simplify our 2d radom walk: move i both the xdirectio ad ydirectio How About a 2d Grid? Let us simplify our 2d radom walk: move i both the xdirectio ad ydirectio I The 2d Walk Returig to the origi i the grid both lie radom walks retur to their origis ˡ Pr[ visit origi at time t ] = (1/ t) (1/ t) (1/t) = ˡ But I 3D Pr[ visit origi at time t ] = ˡ (1/ t) 3 = ˡ (1/t 3/2 ) lim E[ # of visits by time ] < K (costat) Hece Pr[ ever retur to origi ] > 1/K E[ # of visits to origi by time ] = ˡ (1/1 + 1/2 + 1/3 + + 1/ ) = ˡ (log ) 8

Druk ma will fid way home, but druk bird may get lost forever Dot Proofs Shizuo Kakutai Prehistoric Uary 1 2 3 4 Hag o a miute! Is t uary too literal as a represetatio? Does it deserve to be a abstract represetatio? It s importat to respect each represetatio, o matter how primitive Uary is a perfect example Cosider the problem of fidig a formula for the sum of the first umbers You already used iductio to verify that the aswer is (+1) 9

1 + 2 + 3 + + 1 + = S 1 + 2 + 3 + + 1 + = S + 1 + 2 + + 2 + 1 = S + 1 + 2 + + 2 + 1 = S +1 + +1 + +1 + + +1 + +1 = 2S S = (+1) 2 (+1) = 2S S = (+1) 2 There are (+1) dots i the grid! (+1) = 2S....... 2 1 1 2........ th Triagular Number = 1 + 2 + 3 +... + 1 + = (+1)/2 th Square Number = 2 = + 1 1 Breakig a square up i a ew way Breakig a square up i a ew way 10

1 + 3 Breakig a square up i a ew way 1 + 3 + 5 Breakig a square up i a ew way 1 + 3 + 5 + 7 Breakig a square up i a ew way 1 + 3 + 5 + 7 + 9 Breakig a square up i a ew way The sum of the first odd umbers is 2 1 + 3 + 5 + 7 + 9 = 5 2 Breakig a square up i a ew way Pythagoras 11

th Square Number Here is a alterative dot proof of the same sum. = + 1 = 2 th Square Number th Square Number = + 1 = + 1 = 2 th Square Number = + 1 = Sum of first odd umbers Check the ext oe out 12

Area of square = ( ) 2 Area of square = ( ) 2 1 1 Area of square = ( ) 2 Area of square = ( ) 2 1? 1 1 1? Area of square = ( ) 2 Area of square = ( ) 2 = (1 ) 2 + 1 + = (1 ) 2 + (1 + ) = (1 ) 2 + ( ) 1 1 = (1 ) 2 + 3 1 1 (1 ) 2 1 13

( ) 2 = 3 + (1 ) 2 = 3 + (1) 3 + (2 ) 2 = 3 + (1) 3 + (2) 3 + (3 ) 2 = 3 + (1) 3 + (2) 3 + + 1 3 ( ) 2 = 1 3 + 2 3 + 3 3 + + 3 = [ (+1)/2 ] 2 Radom Walk i a Lie Cover Time of a Graph Markov s Iequality Here s What You Need to Kow Dot Proofs 14