Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

Derandomization

De randomization : First devise a randomized algorithm then


argue that it can be derandomized to yield a deterministic
algorithm

Consider the following formula.

(A1 V Ā2 V A3) Λ ( Ā2 V Ā3 V A1) Λ( Ā3 V A2 V Ā1 )

The assignment for the literals in the above clauses can be


drawn in the form of a binary tree.

Indian Institute of Technology, Delhi


Assignment of the Variables
A1=0
A1=1

A2=0 A2=1
A2=0 A2=1

A3=0 A3=0 A3=1 A3=0 A3=1


A3=1 A3=0 A3=1

Indian Institute of Technology, Delhi


At each leaf node, the number of clauses satisfied by the
assignment of the variables is shown on selection of the particular
path towards that leaf. If n variables, then the tree will consist of n
levels.
If n levels are there, 2n leaves are there. Thus 2n assignments are
possible. The average of the numbers on the leaves = 7/8 * m

In 7/8 of the leaves, the clause will be contributing for appearing


in the leaf.There are 2n leaves. Each clause contributes 1 to 7/8 *
2n leaves

Sum of the numbers on leaves = 7/8 * 2n * m = 21 (Since m = 3 in


the example here)

Avg. of the numbers on leaves = (7/8 * 2n * m)/ 2n = 21/8=2.65


Indian Institute of Technology, Delhi
Here, starting from the root, first compute the average at each node.
Then pick the path having greater average.
The process for computing the average is
Consider the root assignment A1=0, A1 = 1
if A1 = 1 , compute the satisfiable clauses probability.
i.e. (A1 V Ā2 V A3) ... satisfied.

( Ā2 V Ā3 V A1) ... satisfied

( Ā3 V A2 V Ā1 ) ... not satisfied. ->

By discarding Ā1 from the clause we obtain ( A2 V Ā3 ).

The probability that this clause is not satisfied is 1/4. So the


probabilitythat this clause is satisfied is ¾ . Thus the total probability
turns out to be (1 + 1 + ¾) =1+1/4. This is the average when A 1 = 1
Similarly compute the average for A1 = 0. which comes out to be 10/4.
Choose the greater average and move towards that path. So we move
Indian Institute of Technology, Delhi
towards A1 = 1 path.
Now compute the average by taking the assignment A 2=0
and A2=1 and move towards the path with greater average.
Thus at each level i, we have to compute the average, with
assignment true, and with false.
Thus, on reaching the leaf, we would have the average
number of clauses which will be satisfiable with the
assignment on the chosen path.

Indian Institute of Technology, Delhi


• In the above algorithm greedy approach is been

followed, at each level we check which sub tree will

give the best average & we take decision according to

the current maximum. Thus algorithm may result in

an sub-optimal result.

Indian Institute of Technology, Delhi

You might also like