Deterministik “görünen” algoritma?


31

Dahili rastgele olmasına bakılmaksızın, her zaman aynı (doğru) yanıtı veren, ancak rastlantısallığı kullanan, beklenen çalışma zamanının bilinen en hızlı çalışma zamanından daha iyi olması için rastgele bir algoritma için ilginç bir örnek var mı? problem için deterministik algoritma?

Özellikle, n ile 2n arasında bir üs bulmak için böyle bir algoritma olup olmadığını merak ediyordum. Bilinen polinom zaman deterministik algoritması yoktur. Sadece asal sayı teoremi sayesinde çalışan aralıktaki rastgele tamsayıları örnekleyerek işe yarayan önemsiz bir randomize algoritma vardır . Ancak beklenen çalışma süresi ikisi arasında orta olan yukarıdaki türden bir algoritma var mı?

EDIT: Sorumu biraz hassaslaştırmak için, birçok olası doğru çıktının olduğu bir problem için böyle bir algoritma istedim ve yine de randomize algoritma, rastgeleliğinden bağımsız bir taneye yerleştirildi. Sorunun muhtemelen tam olarak belirtilmediğinin farkındayım ...


3
To give you some search keywords, randomized algorithms which always produces the correct answer (and uses randomness for shorter running time) are called Las Vegas algorithms (as opposed to Monte Carlo algorithms) or zero-error algorithms, and a related complexity class is ZPP.
Tsuyoshi Ito

@Tsuyoshi: Thanks for your comment. But I'm not aware of Las Vegas-type algorithms for search problems. This is my question.
arnab

Sorunuza cevap verecek benzersiz Nash dengesi bulmak için rastgele bir algoritma varsa.
Warren Schudy

Belki de doğum günü saldırılarıyla ilgili ( en.wikipedia.org/wiki/Birthday_attack ) gereksinimlerinize uyacak bir sorun var ?
Warren Schudy

Yanıtlar:


23

Shafi Goldwasser, ben ve ortak yazarların, sayı teorik problemler için tam olarak bu tür algoritmaları araştırdıklarını söyledi! Aşağıdaki bilinmektedir:

  1. Lenstra, verilen bir birinci dereceden ikinci dereceden tortusuz mod bulmak için böyle bir algoritma olduğunu göstermiştir.

  2. Gat ve Goldwasser, bir jeneratörünü bulmak için böyle bir algoritma olduğunu göstermiştir; buradaki p , 2 q + 1 formunun verilen bir asalıdır.Zpp2q+1 for a prime q.

(I don't know of citable references.) There is also ongoing research on the question I asked about finding a prime between n and 2n.

EDIT: The paper by Gat and Goldwasser is now published: http://eccc.hpi-web.de/report/2011/136/. This paper though doesn't resolve the question of finding a prime between n and 2n.


1
Virtual +1. This is really interesting, will look out for the paper.
András Salamon

2
In spite of the note, I upvoted this answer simply because this is a good answer. I do not think that there is anything wrong with upvoting a good answer posted for someone else. I started a discussion on Meta about this.
Tsuyoshi Ito

1
I removed the note and made it "community wiki" as per the discussion on the meta thread.
arnab

The meta thread mentioned by arnab can be found here: meta.cstheory.stackexchange.com/q/607/873.
M.S. Dousti

18

Do randomized data structures count?

There’s the skip list which is a sorted associative map data structure.

Its running time for common operations such as insertion, retrieval and deletion are (in the expected case) on par with those in balanced search trees – i.e. O(logn). However, the data structure is sometimes claimed to have a much better constant factor than search tree implementations when done properly (this relies critically on a good and efficient source of randomness). The better constant factor probably results from the fact that no rebalancing (or any similar operation) has to take place.


Thanks! This definitely does count and is a non-trivial answer to my original question. I wanted a problem though more analogous to the prime-finding problem, where there are many potential solutions.
arnab

Add jump lists to that train of thought.
Raphael

13

How about Kelner and Spielman's randomized polynomial-time simplex algorithm? It finds the optimal vertex of a linear program. No deterministic simplex algorithm is known which is proven to run in polynomial time, and for many of them, pathological instances can be constructed that make the algorithm take exponential time.

Of course, there are polynomial-time interior-point algorithms, so it's not exactly what you're looking for.


If there are several optimal points, would Kelner-Spielman always return the same point?
Sasho Nikolov

3
Generic linear programs have only one optimal point, so using perturbation, a variant of Kelner-Spielman could be made that always returns the same optimal point.
Peter Shor

12

Consider a complete binary tree with all 2n leaves containing 0, except one leaf that contains 1. The task is to find the leaf that contains 1. Against any deterministic search algorithm it is possible to construct an infinite family of trees (one for each n) for which the algorithm has to check every leaf. So for this worst-case family the deterministic algorithm has expected runtime 2n.

Now consider an algorithm that randomly chooses the first leaf uniformly at random, and then checks all successive leaves deterministically (wrapping around to the beginning). This will find the 1 after examining half of all leaves, on average. So the randomized algorithm has expected runtime 2n1.

Does this qualify?


Nice!! This definitely qualifies, though I was looking for a more non-trivial example where the improvement in running time is more substantial.
arnab

You don't need the tree structure, this works on an array.
sdcvvc

7

Polynomial factorization algorithms might be the kind of example you are looking for. The Cantor-Zassenhaus algorithm uses randomness to compute the (unique upto scaling) irreducible polynomial factors of a given univariate polynomial over a finite field Fp in time polynomial in the size of the input and logp. If you really want the problem to have a unique answer, you can ask for the monic irreducible prime factors of a monic polynomial. As far as I know, it is not known how to factorize in deterministic polynomial time unless p is guaranteed to be small.

By the way, the above can be made a zero-error algorithm, since we know how to test for irreducibility of a polynomial deterministically in time polynomial in the degree of the polynomial and logp. (See these lecture notes.)



3

Regarding your first question, I thought of Quicksort first but that should be obvious.

There is a string matching algorithm (Nebel, 2006) that uses probabilistic ideas. I do know wether this is the fastest approach existing, though, and you apparently need some samples for training.


Median-finding also is faster, but not dramatically so.
Aram Harrow

3

The following STACS '97 paper might be interesting for your case: The Complexity of Generating Test Instances.

Abstract: Recently, Watanabe proposed a new framework for testing the correctness and average case behavior of algorithms that purport to solve a given NP search problem efficiently on average. The idea is to randomly generate certified instances in a way that resembles the underlying distribution. We discuss this approach and show that test instances can be generated for every NP search problem with non-adaptive queries to an NP oracle. Further, we introduce Las Vegas as well as Monte Carlo types of test instance generators and show that these generators can be used to find out whether an algorithm is correct and efficient on average. In fact, it is not hard to construct Monte Carlo generators for all RP search problems as well as Las Vegas generators for all ZPP search problems. On the other hand, we prove that Monte Carlo generators can only exist for problems in co-AM.

Specially, take a look at page 384, under Corollary 12:

It is not hard to construct a Las Vegas generator for any ZPP search problem, i.e. for any RP search problem whose domain is in ZPP. On the other hand, Las Vegas generators can only exist for NP problems whose domain belongs to NPcoNP...


2

Before [AKS], Primality had coRP and RP algorithms (Miller-Rabin for coRP, Adleman-Huang for RP). A natural zero error extension would be to run both simultaneously until you push the error down to 1nc or so, and then run the brute-force algorithm. The expected running time would then remain polylog(n).


3
This refers to testing and not finding...
Dana Moshkovitz

I was interested more in search problems. For decision problems, there are Las Vegas algorithms.
arnab
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.