Administrative - PowerPoint PPT Presentation

About This Presentation
Title:

Administrative

Description:

If you get back. the card with your name I pay you $10. ... X1 = -9 if player 1 gets his card back. 1 otherwise. X2 = -9 if player 2 gets his card back ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 34
Provided by: csRoch
Category:

less

Transcript and Presenter's Notes

Title: Administrative


1
Administrative
Sep. 27 (today) HW4 due Sep. 28 8am
problem session Oct. 2 Oct. 4 QUIZ 2
(pages 45-79 of DPV)
2
Recap
algorithm for k-select with O(n) worst-case
running time modification of quick-sort which
has O(n.log n) worst-case running time
randomized k-select GOAL O(n) expected
running-time
3
Finding the k-th smallest element
Select(k,Ac..d)
xrandom element from Ac..d
Split(Ac..d,x)
? x
gt x
j
j? k ? k-th smallest on left jltk ? (k-j)-th
smallest on right
4
Finite probability space
set ? (sample
space) function P ?? R (probability
distribution)
? P(x) 1
x??
elements of ? are called atomic events subsets of
? are called events
probability of an event A is
? P(x)
P(A)
x?A
5
Examples
A
B
C
Are A,B independent ?Are A,C independent ? Are
B,C independent ? Is it true that
P(A?B?C)P(A)P(B)P(C)?
6
Examples
Events A,B,C are pairwise independent but
not (fully) independent
A
B
C
Are A,B independent ?Are A,C independent ? Are
B,C independent ? Is it true that
P(A?B?C)P(A)P(B)P(C)?
7
Full independence
Events A1,,An are (fully) independent If for
every subset S?n1,2,,n P (
? Ai ) ? P(Ai)
i?S
i?S
8
Random variable
set ? (sample
space) function P ?? R (probability
distribution)
? P(x) 1
x??
A random variable is a function Y ? ? R
The expected value of Y is EX ?
P(x) Y(x)
x??
9
Examples
Roll two dice. Let S be their sum. If S7 then
player A gives player B 6 otherwise player B
gives player A 1
2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12
10
Examples
Roll two dice. Let S be their sum. If S7 then
player A gives player B 6 otherwise player B
gives player A 1
2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12
-1 , -1,-1 ,-1, -1, 6 ,-1 ,-1 , -1 , -1 , -1
Y
Expected income for B
EY 6(1/6)-1(5/6) 1/6
11
Linearity of expectation
LEMMA
EX Y EX EY
More generally
EX1 X2 Xn EX1 EX2EXn
12
Linearity of expectation
Everybody pays me 1 and writes their name on a
card. I mix the cards and give everybody one
card. If you get back the card with your name I
pay you 10.
Let n be the number of people in the class. For
what n is the game advantageous for me?
13
Linearity of expectation
Everybody pays me 1 and writes their name on a
card. I mix the cards and give everybody one
card. If you get back the card with your name I
pay you 10.
X1 -9 if player 1 gets his card back
1 otherwise EX1 ?
14
Linearity of expectation
Everybody pays me 1 and writes their name on a
card. I mix the cards and give everybody one
card. If you get back the card with your name I
pay you 10.
X1 -9 if player 1 gets his card back
1 otherwise EX1 -9/n 1(n-1)/n
15
Linearity of expectation
Everybody pays me 1 and writes their name on a
card. I mix the cards and give everybody one
card. If you get back the card with your name I
pay you 10.
X1 -9 if player 1 gets his card back
1 otherwise X2 -9 if player 2 gets his card
back 1 otherwise
EX1Xn EX1EXn n ( -9/n
1(n-1)/n ) n 10.
16
Do you expect to see the expected value?
  • with probability ½
  • 3 with probability ½

X
EX
17
Expected number of coin-tosses until HEADS?
H ½ TH
¼ TTH 1/8 TTTH 1/16 TTTTH
1/32 ....
18
Expected number of coin-tosses until HEADS?
?
? n.2-n 2
n1
Expected number of dice-throws until you get 6
?
19
Finding the k-th smallest element
Select(k,Ac..d)
xrandom element from Ac..d
Split(Ac..d,x)
? x
gt x
j
j? k ? k-th smallest on left jltk ? (k-j)-th
smallest on right
20
FFT
21
Polynomials
Polynomial of degree d
p(x) a0 a1 x ... ad xd
22
Multiplying polynomials
Polynomial of degree d
p(x) a0 a1 x ... ad xd
Polynomial of degree d
q(x) b0 b1 x ... bd xd
p(x)q(x) (a0b0) (a0b1 a1b0) x
.... (adbd) xdd
23
Polynomials
Polynomial of degree d
p(x) a0 a1 x ... ad xd
THEOREM A non-zero polynomial of degree
d has at most d roots.
COROLLARY A polynomial of degree d is
determined by its value on d1 points.
24
COROLLARY A polynomial of degree d is
determined by its value on d1 points.
Find a polynomial p of degree d such that
p(a0) 1 p(a1) 0 .... p(ad) 0
25
COROLLARY A polynomial of degree d is
determined by its value on d1 points.
Find a polynomial p of degree d such that
p(a0) 1 p(a1) 0 .... p(ad) 0
(x-a1)(x-a2)...(x-ad)
(a0-a1)(a0-a2)...(a0-ad)
26
Representing polynomial of degree d
the coefficient representation
d1 coefficients
evaluation
interpolation
the value representation
evaluation on d1 points
27
Evaluation on multiple points
p(x) 7 x 5x2 3x3 6x4 2x5
p(z) 7 z 5z2 3z3 6z4 2z5 p(-z) 7
z 5z2 3z3 6z4 2z5
p(x) (75x2 6x4) x(13x2 2x4) p(x)
pe(x2) x po(x2) p(-x) pe(x2) x po(x2)
28
Evaluation on multiple points
p(x) a0 a1 x a2 x2 ... ad xd
p(x) pe(x2) x po(x2) p(-x) pe(x2) x
po(x2)
To evaluate p(x) on -x1,x1,-x2,x2,...,-xn,xn
we only evaluate pe(x) and po(x) on
x12,...,xn2
29
Evaluation on multiple points
To evaluate p(x) on -x1,x1,-x2,x2,...,-xn,xn
we only evaluate pe(x) and po(x) on
x12,...,xn2
To evaluate pe(x) on x12,...,xn2 we only
evaluate pe(x) on ?
30
n-th roots of unity
2?ik/n
?k
e
FACT 1
?n 1 ?k . ?l ?kl ?0 ?1 ... ?n-1 0
FACT 2
FACT 3
FACT 4
?k -?kn/2
31
FFT (a0,a1,...,an-1,?) (s0,...,sn/2-1)
FFT(a0,a2,...,an-2,?2) (z0,...,zn/2-1)
FFT(a1,a3,...,an-1,?2)
s0 z0 s1 ? z1 s2 ?2 z2 .... s0 z0 s1 - ?
z1 s2 - ?2 z2 ....
32
Evaluation of a polynomial viewed as vector
mutiplication
1 x x2 . . xd
(a0,a1,a2,...,ad)
33
Evaluation of a polynomial on multiple points
1 x1 x12 . . x1d
1 xn xn2 . . xnd
1 x2 x22 . . x2d
(a0,a1,a2,...,ad)
. . .
Vandermonde matrix
Write a Comment
User Comments (0)
About PowerShow.com