CS255
Chris Pollett
Feb 25, 2019
A computation in the PRAM model proceeds as a series of parallel steps:
0. LoadProcid 0 1. ReadAcc (0),1 2. JNeg 5, 1 3. Load 1, 1 4. Jump 6 5. Load 0, 1 6. StoreAcc (0), 1 7. Halt
We want to define complexity classes which characterize those problems which can be executed more efficiently if we have more processors.
Recall an alphabet, `Sigma`, is any fixed finite set. Let `Sigma^star` denote the set of strings over the alphabet `Sigma`. We define a language, `L`, over `Sigma` to be any `L subseteq Sigma^star`. The complement of a language `L`, `bar L` consists of those string `w` in `Sigma^star` but not in `L`.
Definition:
The class (uniform) NC consists of languages `L` that have a PRAM algorithm `A` such that for any `x in Sigma^star`,
The class RNC (where addition to an input x in the global memory, one gets access to a input y of 0, 1 coin tosses) is defined the same way except we modify the first two conditions to:
The class ZNC is RNC`cap`co-RNC where co-RNC consists of those languages whose complement is in RNC.
For each of these classes we can define an analogous function/algorithm class. I.e., `FNC` is the class of functions `f: NN -> NN` which on inputs of length `n` produces an output of length bounded by `p(n)` where `p` is a polynomial, such that the `i`th bit of the output of `f` is language in `NC`. We sometimes abuse notation and write NC (resp. RNC, ZNC) for both NC and FNC (resp. RNC and FRNC, ZNC and FZNC).
Which of the following statements is true?
We now work towards a ZNC algorithm for sorting which run in `O(log n)` time doing a total of `O(n log n)` operations on all processors (Reischuk 1985). Let `P_i` denote the `i`th processor.
We begin by considering a PRAM variant of Quicksort:
Notice this algorithm uses randomness, but it has zero error -- we can detect if we are in a bad case in which case we rerun -- it is in this sense it is a ZNC algorithm for sorting.
Suppose we have `n` processors and `n` elements. Suppose the first `r` processors have values in sorted order.