views:

111

answers:

1

I an now learning the Las Vegas and Monte Carlo algorithms myself,and have two questions may be simple but I can not answer them,if someone can help me...Thanks in advance

  1. Consider a Monte Carlo algorithms A for a problem P whose expected runnig time is at most T(n) on any instance of size n that produces a corect solution with probability y(n). Suppose further that given a solution to P,we can verify its correctness in time t(n). show how to obtain a Las Vegas algorithm that always gives a correct answer to P and runs in expected time at most (T(n)+t(n))/y(n).

  2. Let 0<ε2<ε1<1. Consider a Monte Carlo algorithm that gives the correct solution to a problem with probability at least 1-ε1,regardless of the input. How many independent executions of this algorithm suffice to raise the probability of obtaining a correct solution at least 1-ε2,regardless of the input?

+1  A: 
  1. Just repeat running your algorithm and testing the result until you get a correct answer. Each run and check takes (T(n) + t(n)) units of time, and the number of runs is a geometric random variable with mean 1 / y(n).

  2. What is the probability of failure for one run? For two runs? n runs? Set the probability of failure for n runs equal to e2 and solve for n.

deinst
Thank you for the answers.The 1 answer i understand but the answer to question 2 is not so clear to me that, compare the probability of failure to "e2"?
I do not want to do you homework for you. If you run the program twice what is the probability that you fail both times? Three times? n times?
deinst
if i run it once, the probability i fail is 1-(1-ε1) right? and if its runs twice its 1-(1-ε1)/2 ? and... /n is that right?
Yes for the probability of one failure, no, otherwise. What is the the probability that two independent events both occur is the product of their probabilities. Please review your elementary probability.
deinst
so for the first one is ok? we start to learn only those algorithms,we didnt pass Probability theory,so its hard to me to do this
what should i study exactly si a can answer this qustion? i check in the net,if its so hard to answer
di u need n so large that n12.
i mean n large that \varepsilon_1^n < \varepsilon_2 ??
yes. now take logs and solve for n.
deinst
is that right... n should be n>log(ε2)/log(ε1)yes??