Probability and Set Theory Algorithms, Study notes of Algorithms and Programming

Two algorithms related to probability and set theory: one for generating a random subset of a given set with a specified probability, and another one for generating a random independent set of a graph. The first algorithm uses a loop to iterate over the elements of the set, adding each one to the subset with a specified probability, and then randomly removing one endpoint of each edge between elements in the subset. The second algorithm initializes an empty set, then iterates over the vertices of the graph, adding each one to the set with a specified probability. Then, for each edge between vertices in the set, it deletes one endpoint of the edge from the set. The algorithm returns the set of vertices that remain in the set after this process.

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-4on
koofers-user-4on 🇺🇸

5

(1)

9 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1

      
 
C
1
=
x
2
x
3
x
4
C
2
=x
2
x
3
x
4
C
3
=x
1
x
2
x
4
C
4
=x
1
x
2
x
3
C
5
=x
1
x
2
x
4
 
!" 
# $
% &
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Probability and Set Theory Algorithms and more Study notes Algorithms and Programming in PDF only on Docsity!



^  ^ 

^     ^  ^

^   C =^ x ∨^ x ∨^ x^1 2 3 4 C =^ x ∨^ x ∨^ x^2 2 3 4 C =^ x ∨^ x ∨^ x^3 1 2 4 C =^ x ∨^ x ∨^ x^4 1 2 3 C =^ x ∨^ x ∨^ x^5 1 2 ^ 

^ # $ 

'

^   ^

 % ^ 

 ^ 

^  ^      ()* satisfiedisclauseif^1 C  j^ =^ X  j otherwise.^0 

^ ^ + ^ ,-./"-/./^

0 1)'2^ 

6

^  ^ 

^ 7% ()* 

  ^8

^ "- 

 ≥^ ()*

.≥^ )1*^2

^ ^ /^

^ 

^ /≥^ (

) 7 pjXEk ][== j 8 j 0 ≥ pjpj += jj   kj kj 8 / 7 8 /^7 < ≥ k 17 pkp )(+−≤ ^  jj 88 kj kj^8 / 7 8 /^7 < ≥ 17^ pkk 1 )(^ +⋅−≤ 88 <  ≥ )1 2

=

≥^ (>)*  # :  , 

% ^ ≥^ )1*

^2

^ +^ / 

 ^ ≤^ *

^  ^ -< ? @@(.

"/! "ρ^ 

8 9 ρ^ A()*

^ ^ ^   ^ 

  ^ ^         ∞ E [ X ] = j^ ⋅^ Pr[ X^ =^ j ]=^ ^ j =^0 ∞ pj −^1 j^ (1−^ p )^ p =^ j^ (1−^ p ) ^1 −^ p^ j =^0 ∞ p^1 −^ p^1 j^ =^ ⋅^ =^ ^2 1 −^ p^ p^ pj =^0

(

"      &'  ())*+  ^  % ^   E   FG

^ E ' 

^ ;  1% 2≥  1^2 ;  0 ^ ^ ^1

^0 2)'

H^ ">^ /C

D 

'H^ 7^ ^ 1>

H^ #

I% ^ '

6H^ #1

^2 ^ k^2 =^ jnjnk^ −−^2 /)(

^ F

G≤

  •  ≥≥≥≥ -.

^ +^

Pr[ E ∩^ E ^ ∩^ E ]^ =^ Pr^1 2 n −^2 

[ E ]^ ×^ Pr[ E |^ E ]^ ×^ ^ ×^ Pr^12

[ E |^ E ∩^ E ^ ∩^ E ] n −^2 1 2 n −^3 (^222) ≥ 1 − 1 −^ ^1 −^1 −( )^ (^ )(^ )^ n^ n −^14 (^2) ( )^3 n^ −^2 n^ −^321 = ^ ( )^ ( )( )^ (^ )^^ n^ n^ −^1432 = n ( n −1) (^2) ≥ 2 n

L

^ +M 

N>OP^8

^ 2 37% 

+M

^! >%  





^ 2 ^ -8 7.^ Q 

 ^ 

    E  ; J% 

%  ; J% ^ % 

≥^ &

^ 4^ -+M.^ Q 

^  "⊆^ R""

⊆^ #"⊆^! "

^ 3 N

Q "/R"":Q R""/

#": Q #"/! ":



! ^  "  -

^ >^ S

^! ^  ,  

^ 4 

^ " JΘ12 ^ +/^

L% 

+^ / 

/TU T^ 

,-./"-/. /)10 I^

,-. /,-.^ TU^ T,-^ 

. /)^ TU T)'T)

/^1 2/Θ1^2



^ ^ 

H,

1N

>2H

^ < %  

≥^ 

^  ^ / ^

^ T

^1 /2L^

^ "  

 Θ^1 ^ 

^2

^ +^ / 

/TTU TL^ ^ 

 n −^1 n E [ X ] = E [ X^ ]^ ^ =^ j^ n^ −^ j =^0 n −^1^ n^1 ^ =^ n^^ ^ =^ n H ( n )^ j^ ij =^0 i =^1   !"#$%    ^ ^ ! %"#$

B

"   2   2 6   " "-^ ^

.≥^ )1⋅^2

^ ^ K"-^ ^

^  

 ^  '

^ ^ ; 10 ) 2 

0^ ; 10 ) 2 

^ ^   ^   ' * 

(

"   2   2 6   " "-^ ^

^ ^ K

 % "-  ⋅^ ^ ^ .^ ≤^ -10 )1

⋅^  22.^

^  ≤ -). 0 /  "  "-

'⋅^ ^ ^ .≥^ 0 )

^ ^ "-

'⋅^ ^ ^ ./"- '⋅^ ^ ^ . ≤ "- '⋅^ ^ ^ .≤

0'^ ⋅ /)

n  j^1 = n = j 1