Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53...
Transcript of Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53...
![Page 1: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/1.jpg)
Mintttasg
FEIGN.fr#_BinargSets
- Vector
:¥ /JSLA ,B)=Itn3 V
IAUBI CompareA={ oil ,
.is/B=#53zLSH13=6,2 , 3.5.73 |{ o.li?3.s.6.73l=F
![Page 2: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/2.jpg)
S,
= { i. 2,53
Sz = { 33JSCS
, ,s3) = 1453114,713/4,531
sz= { 23.4.53 =
eek.io#ooFeeiIi:aefIEiE:TH5
6
M 2 3 2 6
J^s( s, ,§)={ 1 if
mail.mni '
o otherwise
![Page 3: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/3.jpg)
k random reorders it1.2 , . . .k
Set
Si⇒value ( M
, fsi ),
mzcsi , . " mrk:))
Vi=V3= ( 2
,70 ,19023
,...
,@) e tSi, ⇒Viau,=( 3,
70,
42,
..
.
,
@T0 1 0 - ^ . 1
FSG :S . :) ._ { 1 ifmicsi . ) - M ;Cs .. )is,s ,
0 o . in?' 53
5s=÷g¥,J§Gi;E)
![Page 4: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/4.jpg)
wyE€sCs.,sD]=JS(s=3 types f rows
(T×)= # rows Si and S,
have I
⇐D= # rows exactly 1 of s. ,S >
have 1
uthr hasd
⇐⇒ = # rows 5. and 5 have 0
.
JSCS, ,sz)=÷I'g ⇒ can ignore #-)
Collision MG. )=m(sz) iff ef Tx and Toy rows
atx is at the fop .
Psob [ collision ] = ECFS ]=F¥q=JS
![Page 5: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/5.jpg)
Toptnsketchesto 2
S,
1 05<-02 6
3 ← a6 1
4 0
MG .)= ( s, 3)
![Page 6: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/6.jpg)
Fast Min flashingAkooritReplace re - orders w/ hash fans
.
Hash fxns hcchz,
... ,hk
h ; :{ element bset }→[n]={ 1,2
, ...1024 }
S→v=( v.,
a,
- .. Vr )
-
for IES
!;rrinpaaaemm;# trial:tII↳s" has
Vj←h;Ci )
![Page 7: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/7.jpg)
Se { 1,3 ,63
÷hzy; "l¥÷t÷±
4 5→| ( → 65 6→36 592
6→6V.=DVzt I
l V.= 2
as
y=z2<6 hash fxns
6
Vt2 2<3
are fixedH :{ h
.
,
-4 . )fhl a → Rk=vs
for all sets
![Page 8: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/8.jpg)
CentraliaX= { X.
,X
, ...Xr } r random variables
.
iid.
A=¥gIn×iE[A]=E[x :]
var CA ) = Var[x :]izw.IE#hionv;eIValue A
![Page 9: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/9.jpg)
Probably Aprox Correct
Pratt - Ek :] ) > if < S
g p
/ µ error probablytolerance of
estimate whit failurewant
want a,
8 small
Algorithm has r steps
![Page 10: Sets .fr# Binarg .is/B=#53zLSH FEIGNjeffp/teaching/cs5140-S18/cs5140/L4-notes.pdf · S, = {i. 2,53 Sz = {33 JSCS,,s3) = 1453114,713/4,531 sz= {23.4.53 = zsceei.4i63EEsGi.ED-JG.5s@sS.Sz](https://reader034.fdocuments.in/reader034/viewer/2022052005/6018971625919968a04e72c1/html5/thumbnails/10.jpg)
ch.no#-HueCfdingBo=iid X
,...
Xr A- IEI. ,
X .
r=k
D= b- a sit . Xi C- [ a. b]IS #
*oi
Prfltt - Ecxisl > B±2e×p( Ei )press - ss 1 >o÷]£2e×p(-2¥
"2 )# ±ze×p( Toot)=2e×pf :o)
=ze- 10