15-251 Great Theoretical Ideas in Computer Science for Some.

Slides:



Advertisements
Similar presentations
Algebraic Rules Please view this tutorial and answer the follow-up questions on loose leaf to turn in to your teacher.
Advertisements

6-1 Stats Unit 6 Sampling Distributions and Statistical Inference - 1 FPP Chapters 16-18, 20-21, 23 The Law of Averages (Ch 16) Box Models (Ch 16) Sampling.
Probability of Compound Events
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability.
Theoretical Probability Distributions We have talked about the idea of frequency distributions as a way to see what is happening with our data. We have.
Great Theoretical Ideas in Computer Science.
17.1 CompSci 102 Today’s topics Instant InsanityInstant Insanity Random WalksRandom Walks.
COMPSCI 102 Introduction to Discrete Mathematics.
Random Walks. Random Walks on Graphs - At any node, go to one of the neighbors of the node with equal probability. -
Copyright ©2011 Brooks/Cole, Cengage Learning Random Variables Chapter 8 1.
Probability.
Prof. Bart Selman Module Probability --- Part d)
Random Walks Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2005 Lecture 23Nov 14, 2005Carnegie Mellon University.
Great Theoretical Ideas in Computer Science.
Probability Theory: Paradoxes and Pitfalls Great Theoretical Ideas In Computer Science Steven Rudich, Anupam Gupta CS Spring 2004 Lecture 19 March.
The probabilistic method & infinite probability spaces Great Theoretical Ideas In Computer Science Steven Rudich, Anupam GuptaCS Spring 2004 Lecture.
Random Walks Great Theoretical Ideas In Computer Science Steven Rudich, Anupam GuptaCS Spring 2004 Lecture 24April 8, 2004Carnegie Mellon University.
Jeopardy Final Jeopardy Definitions Prob Rules Tables Mixed Rules Mis- conceptions $100 $200 $300 $400 $500.
Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x 
Discrete Random Variables: The Binomial Distribution
Probability Theory: Counting in Terms of Proportions Great Theoretical Ideas In Computer Science Steven Rudich, Anupam GuptaCS Spring 2004 Lecture.
Copyright ©2005 Brooks/Cole, a division of Thomson Learning, Inc. Understanding Probability and Long-Term Expectations Chapter 16.
Lectures prepared by: Elchanan Mossel Yelena Shvets Introduction to probability Stat 134 FAll 2005 Berkeley Follows Jim Pitman’s book: Probability Section.
Testing Hypotheses Tuesday, October 28. Objectives: Understand the logic of hypothesis testing and following related concepts Sidedness of a test (left-,
Probability Denoted by P(Event) This method for calculating probabilities is only appropriate when the outcomes of the sample space are equally likely.
Great Theoretical Ideas In Computer Science Steven Rudich, Anupam GuptaCS Spring 2004 Lecture 22April 1, 2004Carnegie Mellon University
CH. 3 Day 4 AP Statistics EQ: What is Simpson’s Paradox?
TIMES 3 Technological Integrations in Mathematical Environments and Studies Jacksonville State University 2010.
Random Walks Great Theoretical Ideas In Computer Science Steven Rudich, Anupam GuptaCS Spring 2005 Lecture 24April 7, 2005Carnegie Mellon University.
Probability III: The probabilistic method & infinite probability spaces Great Theoretical Ideas In Computer Science Steven Rudich, Avrim BlumCS
Great Theoretical Ideas in Computer Science.
Probability III: The Probabilistic Method Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2006 Lecture 11Oct. 3, 2006Carnegie.
DR. DAWNE MARTIN DEPARTMENT OF MARKETING Show Me the Money.
Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 7 Sampling Distributions Target Goal: DISTINGUISH between a parameter and a statistic. DEFINE sampling distribution. DETERMINE whether a statistic.
POSC 202A: Lecture 4 Probability. We begin with the basics of probability and then move on to expected value. Understanding probability is important because.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Welcome to MM570 Psychological Statistics
+ The Practice of Statistics, 4 th edition – For AP* STARNES, YATES, MOORE Chapter 5: Probability: What are the Chances? Section 5.1 Randomness, Probability,
L56 – Discrete Random Variables, Distributions & Expected Values
Random Variables Learn how to characterize the pattern of the distribution of values that a random variable may have, and how to use the pattern to find.
1 Binomial Random Variables Lecture 5  Many experiments are like tossing a coin a fixed number of times and recording the up-face.  The two possible.
PROBABILITY BINGO STAAR REVIEW I am based on uniform probability. I am what SHOULD happen in an experiment.
1 Chapter 4, Part 1 Basic ideas of Probability Relative Frequency, Classical Probability Compound Events, The Addition Rule Disjoint Events.
Pitfalls of Probability CS Lecture 18. You have 3 dice:       Higher Number Wins Higher Number Wins 2 Players each rolls a die. The player.
Great Theoretical Ideas in Computer Science for Some.
COMPSCI 230 Discrete Mathematics for Computer Science.
9.1: Sampling Distributions. Parameter vs. Statistic Parameter: a number that describes the population A parameter is an actual number, but we don’t know.
18.1 CompSci 102 Today’s topics Impaired wanderingImpaired wandering Instant InsanityInstant Insanity 1950s TV Dating1950s TV Dating Final Exam reviewFinal.
Chance We will base on the frequency theory to study chances (or probability).
PROBABILITY DISTRIBUTIONS DISCRETE RANDOM VARIABLES OUTCOMES & EVENTS Mrs. Aldous & Mr. Thauvette IB DP SL Mathematics.
Theory of Computational Complexity Probability and Computing Lee Minseon Iwama and Ito lab M1 1.
The Law of Averages. What does the law of average say? We know that, from the definition of probability, in the long run the frequency of some event will.
Great Theoretical Ideas in Computer Science.
Pitfalls of Probability CS /26/2001. You have 3 dice:       Higher Number Wins Higher Number Wins 2 Players each rolls a die. The player.
Pitfalls of Probability
Statistics 200 Objectives:
The study of randomness
Determining the theoretical probability of an event
Chapter Randomness, Probability, and Simulation
CHAPTER 12: Introducing Probability
Great Theoretical Ideas In Computer Science
Great Theoretical Ideas in Computer Science
Random Walks.
Great Theoretical Ideas in Computer Science
Chapter 17 Measurement Key Concept: If you want to estimate the demand curve, you need to find cases where the supply curve shifts.
Random Walks.
Great Theoretical Ideas in Computer Science
Introduction to Discrete Mathematics
Presentation transcript:

Great Theoretical Ideas in Computer Science for Some

This Course…

Probability Refresher What’s a Random Variable? A Random Variable is a real-valued function on a sample space S E[X+Y] =E[X] + E[Y]

Probability Refresher What does this mean: E[X | A]? E[ X ] = E[ X | A ] Pr[ A ] + E[ X | A ] Pr[ A ] Pr[ A ] = Pr[ A | B ] Pr[ B ] + Pr[ A | B ] Pr[ B ] Is this true: Yes! Similarly:

Air Marshal Problem Every passenger has an assigned seat There are n-1 passengers and n seats Before the passengers board, an air marshal sits on a random seat When a passenger enters the plane, if their assigned seat is taken, they pick a seat at random What is the probability that the last passenger to enter the plane sits in their assigned seat?

Several years ago Berkeley faced a law suit … 1.% of male applicants admitted to graduate school was 10% 2.% of female applicants admitted to graduate school was 5% Grounds for discrimination? SUIT

Berkeley did a survey of its departments to find out which ones were at fault

Every department was more likely to admit a female than a male #of females accepted to department X #of males accepted to department X #of female applicants to department X #of male applicants to department X >

How can this be ?

Answer Women tended to apply to departments that admit a smaller percentage of their applicants WomenMen DeptAppliedAcceptedAppliedAccepted A99410 B total

A single summary statistic (such as an average, or a median) may not summarize the data well !

Try to get a white ball Choose one box and pick a random ball from it. Max the chance of getting a white ball… 5/11 > 3/7 Better

Try to get a white ball Better 6/9 > 9/14 Better

Try to get a white ball Better

Try to get a white ball Better 11/20 < 12/21 !!!

Simpson’s Paradox Arises all the time… Be careful when you interpret numbers

Department of Transportation requires that each month all airlines report their “on-time record” # of on-time flights landing at nation’s 30 busiest airports # of total flights into those airports

Different airlines serve different airports with different frequency An airline sending most of its planes into fair weather airports will crush an airline flying mostly into foggy airports It can even happen that an airline has a better record at each airport, but gets a worse overall rating by this method.

Alaska airlines America West % on time # flights % on time # flights LA Phoenix San Diego SF Seattle OVERALL Alaska Air beats America West at each airport but America West has a better overall rating!

Geometric Random Variable Flip a coin with probability p of heads Let X = number of times the coin has to be flipped until we get a heads E[X] = E[X | flip 1 is H]Pr[flip 1 is H] + E[X | flip 1 is T]Pr[flip 1 is T] = p + E[X+1](1-p) = p + E[X](1-p) + (1-p) E[X] = 1/p

CMULand All CMU SCS students fly off to space and colonize the moon Faced with the problem that there are more men than women, the authorities impose a new rule: When having kids, stop after you have a girl Will the number of new girls be higher than the number of new boys? What if the rule is: stop after having two girls?

Coupon Collector’s Problem There are n types of coupons in cereal boxes Want to collect them all On average, how many cereal boxes do I have to buy to get them all?

Random Walks Lecture 12 (February 19, 2009)

How to walk home drunk

No new ideas Solve HW problem Eat Wait Work probability Hungry Abstraction of Student Life

Example questions: “What is the probability of reaching goal on string Work,Eat,Work?” No new ideas Solve HW problem Eat Wait Work Hungry

- Simpler: Random Walks on Graphs At any node, go to one of the neighbors of the node with equal probability

- Simpler: Random Walks on Graphs At any node, go to one of the neighbors of the node with equal probability

- Simpler: Random Walks on Graphs At any node, go to one of the neighbors of the node with equal probability

- Simpler: Random Walks on Graphs At any node, go to one of the neighbors of the node with equal probability

- Simpler: Random Walks on Graphs At any node, go to one of the neighbors of the node with equal probability

0n k Random Walk on a Line You go into a casino with $k, and at each time step, you bet $1 on a fair game You leave when you are broke or have $n Question 1: what is your expected amount of money at time t? Let X t be a R.V. for the amount of $$$ at time t

0n k Random Walk on a Line You go into a casino with $k, and at each time step, you bet $1 on a fair game You leave when you are broke or have $n X t = k +  1 +   t, (  i is RV for change in your money at time i) So, E[X t ] = k E[  i ] = 0

0n k Random Walk on a Line You go into a casino with $k, and at each time step, you bet $1 on a fair game You leave when you are broke or have $n Question 2: what is the probability that you leave with $n?

Random Walk on a Line Question 2: what is the probability that you leave with $n? E[X t ] = k E[X t ] = E[X t | X t = 0] × Pr(X t = 0) + E[X t | X t = n] × Pr(X t = n) + E[ X t | neither] × Pr(neither) As t  ∞, Pr(neither)  0, also something t < n Hence Pr(X t = n)  k/n k = n × Pr(X t = n) + (something t ) × Pr(neither)

0n k Another Way To Look At It You go into a casino with $k, and at each time step, you bet $1 on a fair game You leave when you are broke or have $n Question 2: what is the probability that you leave with $n? = probability that I hit green before I hit red

- What is chance I reach green before red? Random Walks and Electrical Networks Same as voltage if edges are resistors and we put 1-volt battery between green and red

- Random Walks and Electrical Networks Same as equations for voltage if edges all have same resistance! p x = Pr(reach green first starting from x) p green = 1, p red = 0 And for the rest p x = Average y  Nbr(x) (p y )

0n k Another Way To Look At It You go into a casino with $k, and at each time step, you bet $1 on a fair game You leave when you are broke or have $n Question 2: what is the probability that you leave with $n? voltage(k) = k/n = Pr[ hitting n before 0 starting at k] !!!

Getting Back Home - Lost in a city, you want to get back to your hotel How should you do this? Requires a good memory and a piece of chalk Depth First Search!

Getting Back Home - How about walking randomly?

Will this work? When will I get home? Is Pr[ reach home ] = 1? What is E[ time to reach home ]?

Pr[ will reach home ] = 1

We Will Eventually Get Home Look at the first n steps There is a non-zero chance p 1 that we get home Also, p 1 ≥ (1/n) n Suppose we fail Then, wherever we are, there is a chance p 2 ≥ (1/n) n that we hit home in the next n steps from there Probability of failing to reach home by time kn = (1 – p 1 )(1 – p 2 ) … (1 – p k )  0 as k  ∞

E[ time to reach home ] is at most this Furthermore: If the graph has n nodes and m edges, then E[ time to visit all nodes ] ≤ 2m × (n-1)

Actually, we get home pretty fast… Chance that we don’t hit home by (2k)2m(n-1) steps is (½) k

A Simple Calculation If the average income of people is $100 then more than 50% of the people can be earning more than $200 each False! else the average would be higher!!! True of False:

Andrei A. Markov Markov’s Inequality If X is a non-negative r.v. with mean E[X], then Pr[ X > 2 E[X] ] ≤ ½ Pr[ X > k E[X] ] ≤ 1/k

(since X is non-neg) Markov’s Inequality Non-neg random variable X has expectation 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] Also, E[X | X > 2A] > 2A  A ≥ 2A × Pr[X > 2A] Pr[ X > k × expectation ] ≤ 1/k  ½ ≥ Pr[X > 2A]

Actually, we get home pretty fast… Chance that we don’t hit home by (2k)2m(n-1) steps is (½) k

An Averaging Argument Suppose I start at u E[ time to hit all vertices | start at u ] ≤ C(G) Hence, by Markov’s Inequality: 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 node with more nodes still to visit Pr [ haven’t hit all vertices in 2C(G) more time | start at v ] ≤ ½ Chance that you failed both times ≤ ¼ = (½) 2 Hence, Pr[ havent hit everyone in time k × 2C(G) ] ≤ (½) k

Hence, if we know that Expected Cover Time C(G) < 2m(n-1) then Pr[ home by time 4k m(n-1) ] ≥ 1 – (½) k

Here’s What You Need to Know… Random Walk in a Line Cover Time of a Graph Markov’s Inequality