CS255
Chris Pollett
Feb 28, 2022
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`. For a string `w in Sigma^star` we use the notation |w| to denote its length.
Definition:
The class (uniform) `NC` is defined as `cup_k NC^k` where `NC^k` consists of languages `L` that have a PRAM algorithm `A` such that for any `x in Sigma^star`,
The name NC is short for Nick's Class, in honor of Nick Pippenger. In our diagram, the class `P` consists of languages with polynomial time single processor algorithms.
The class RNC (where in addition to an input x in the global memory, one gets access to a input y of 0, 1 coin tosses such that `|y| < |x|^k` ) 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).
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.
Which of the following statements is true?