Demo Have (uncountably) infinite values (e.g., real numbers) - - PDF document

demo
SMART_READER_LITE
LIVE PREVIEW

Demo Have (uncountably) infinite values (e.g., real numbers) - - PDF document

Balls, Urns, and the Supreme Court Justice Breyer Meets CS109 Supreme Court case: Berghuis v. Smith Should model this combinatorially If a group is underrepresented in a jury pool, how do you tell? Ball draws not independent trials


slide-1
SLIDE 1

1 Balls, Urns, and the Supreme Court

  • Supreme Court case: Berghuis v. Smith

If a group is underrepresented in a jury pool, how do you tell?

  • Article by Erin Miller – Friday, January 22, 2010
  • Thanks to Josh Falk for pointing out this article

Justice Breyer [Stanford Alum] opened the questioning by invoking the binomial theorem. He hypothesized a scenario involving “an urn with a thousand balls, and sixty are red, and nine hundred forty are black, and then you select them at random… twelve at a time.” According to Justice Breyer and the binomial theorem, if the red balls were black jurors then “you would expect… something like a third to a half of juries would have at least one black person” on them.

  • Justice Scalia’s rejoinder: “We don’t have any urns here.”

Justice Breyer Meets CS109

  • Should model this combinatorially
  • Ball draws not independent trials (balls not replaced)
  • Exact solution:

P(draw 12 black balls) =  0.4739 P(draw ≥ 1 red ball) = 1 – P(draw 12 black balls)  0.5261

  • Approximation using Binomial distribution
  • Assume P(red ball) constant for every draw = 60/1000
  • X = # red balls drawn. X ~ Bin(12, 60/1000 = 0.06)
  • P(X ≥ 1) = 1 – P(X = 0)  1 – 0.4759 = 0.5240

In Breyer’s description, should actually expect just over half

  • f juries to have at least one black person on them

                12 1000 12 940

Demo

From Discrete to Continuous

  • So far, all random variables we saw were discrete
  • Have finite or countably infinite values (e.g., integers)
  • Usually, values are binary or represent a count
  • Now it’s time for continuous random variables
  • Have (uncountably) infinite values (e.g., real numbers)
  • Usually represent measurements (arbitrary precision)
  • Height (centimeters), Weight (lbs.), Time (seconds), etc.
  • Difference between how many and how much
  • Generally, it means replace with

 b a x

x f ) (

b a

dx x f ) (

Continuous Random Variables

  • X is a Continuous Random Variable if there is

function f(x) ≥ 0 for - ≤ x ≤ , such that:

  • f is a Probability Density Function (PDF) if:

  

b a

dx x f b X a P ) ( ) ( 1 ) ( ) (      

  

dx x f X P

Probability Density Functions

  • Say f is a Probability Density Function (PDF)
  • f(x) is not a probability, it is probability/units of X
  • Not meaningful without some subinterval over X
  • Contrast with Probability Mass Function (PMF) in

discrete case: where for X taking on values x1, x2, x3, ...

) ( ) (   

a a

dx x f a X P ) ( ) ( a X P a p  

1 ) (

1

  i i

x p

1 ) ( ) (      

  

dx x f X P

slide-2
SLIDE 2

2 Cumulative Distribution Functions

  • For a continuous random variable X, the

Cumulative Distribution Function (CDF) is:

  • Density f is derivative of CDF F:
  • For continuous f and small  :

 

     

2 / 2 /

) ( ) ( ) (

2 2

 

 

a a

a f dx x f a X a P

 

    

a

dx x f a X P a X P a F ) ( ) ( ) ( ) (

) ( ) ( a F da d a f 

  • X is continuous random variable (CRV) with PDF:
  • What is C?
  • What is P(X > 1)?

Simple Example

      

  • therwise

2 x n whe ) 2 4 ( ) (

2

x x C x f 1 3 2 2 1 ) 2 4 (

2 3 2 2 2

            

x x C dx x x C 8 3 1 3 8 1 3 16 8                      C C C 2 1 3 2 2 3 16 8 8 3 3 2 2 8 3 ) 2 4 ( ) (

1 2 3 2 2 1 2 1

8 3

                                   

x x dx x x dx x f

Disk Crashes

  • X = hours before your disk crashes
  • First, determine  to have actual PDF
  • Good integral to know:
  • What is P(50 < X < 150)?
  • What is P(X < 10)?

    

  • therwise

) (

100 /

x e x f

x

u u

e du e 

100 1 100 1

100 100 100 1

100 / 100 / 100 /

       

   

 

    

x x x

e dx e dx e 383 . ) 50 ( ) 150 (

2 / 1 2 / 3 50 150 100 / 150 50 100 /

100 1

       

   

e e e dx e F F

x x

095 . 1 ) 10 (

10 / 1 10 100 / 10 100 /

100 1

      

  

e e dx e F

x x

For continuous RV X:

Expectation and Variance

For discrete RV X:

x

x p x X E ) ( ] [

2 2 2

]) [ ( ] [ ] ) [( ) ( Var X E X E X E X      dx x f x X E

  

 ) ( ] [ dx x f x g X g E

  

 ) ( ) ( )] ( [

x

x p x g X g E ) ( ) ( )] ( [

b X aE b aX E    ] [ ] [

x n n

x p x X E ) ( ] [ dx x f x X E

n n

  

 ) ( ] [ ) ( ) ( Var

2

X Var a b aX  

For both discrete and continuous RVs:

Linearly Increasing Density

  • X is a continuous random variable with PDF:
  • What is E[X]?
  • What is Var(X)?

     

  • therwise

1 2 ) ( x x x f

3 2 3 2 2 ) ( ] [

1 3 1 2

   

 

  

x dx x dx x f x X E

x

) (x f

2 1 2 1 2 ) ( ] [

1 4 1 3 2 2

   

 

  

x dx x dx x f x X E 18 1 3 2 2 1 ]) [ ( ] [ ) (

2 2 2

           X E X E X Var

Uniform Random Variable

  • X is a Uniform Random Variable: X ~ Uni(a, b)
  • Probability Density Function (PDF):

      

  • therwise

) (

1

b a

a b

x x f

a b      

a b dx x f b x a P

b a

) ( ) ( 2 ) ( 2 ) ( ] [

2 2

b a a b a b

a b

      

 

      

dx dx x f x X E

x

12 ) ( ) (

2

a b   X Var

a  b 1

x

) (x f

slide-3
SLIDE 3

3 Fun with the Uniform Distribution

  • X ~ Uni(0, 20)
  • P(X < 6)?
  • P(4 < X < 17)?

20 6 20 1 ) 6 (

6

  

dx x P 20 13 20 4 20 17 20 1 ) 17 4 (

17 4

     

dx x P

       

  • therwise

20 ) (

20 1

x x f

Riding the Marguerite Bus

  • Say the Marguerite bus stops at the Gates bldg.

at 15 minute intervals (2:00, 2:15, 2:30, etc.)

  • Passenger arrives at stop uniformly between 2-2:30pm
  • X ~ Uni(0, 30)
  • P(Passenger waits < 5 minutes for bus)?
  • Must arrive between 2:10-2:15pm or 2:25-2:30pm
  • P(Passenger waits > 14 minutes for bus)?
  • Must arrive between 2:00-2:01pm or 2:15-2:16pm

3 1 30 5 30 5 ) 30 25 ( ) 15 10 (

30 25 30 1 15 10 30 1

         

 

dx dx x P X P 15 1 30 1 30 1 ) 16 15 ( ) 1 (

16 15 30 1 1 30 1

         

 

dx dx x P X P

When to Leave For Class

  • Biking to a class on campus
  • Leave t minutes before class starts
  • X = travel time (minutes).

X has PDF: f(x)

  • If early, incur cost: c/min.

If late, incur cost: k/min.

  • Choose t (when to leave) to minimize E[C(X, t)]:

dx x f t x k dx x f x t c dx x f t X C t X C E

t t

) ( ) ( ) ( ) ( ) ( ) , ( )] , ( [

  

 

    

          t x t X k t x X t c t X C if ) ( if ) ( ) , ( : Cost

Minimization via Differentiation

  • What to minimize w.r.t. t:
  • Differentiate E[C(X, t)] w.r.t. t, and set = 0 (to obtain t*):
  • Leibniz integral rule:

 

    

) ( ) ( 1 1 2 2 ) ( ) (

2 1 2 1

) , ( ) ), ( ( ) ( ) ), ( ( ) ( ) , (

t f t f t f t f

dx t t x g t t f g dt t df t t f g dt t df dx t x g dt d

 

     

t t

dx x kf t f t t k dx x cf t f t t c t X C E dt d ) ( ) ( ) ( ) ( ) ( ) ( )] , ( [ dx x f t x k dx x f x t c t X C E

t t

) ( ) ( ) ( ) ( )] , ( [

 

    k c k t F t F k t cF       *) ( *)] ( 1 [ *) (