Parity in depth two with threshold gates #
Every symmetric function has threshold circuits of depth two and linear size
Hajnal et al., Proposition 2.1. For parity, alternating signs give such a circuit with
n + 1 threshold gates. On n bits, let g_j, for j < n, be the threshold gate "at least
j + 1 of the bits are true". If w of the bits are true, g_j is true exactly when j < w.
Negating g_j for every odd j, exactly n / 2 + w % 2 of the n signed values are true
(Threshold.weight_signedLayer), so the threshold gate "at least n / 2 + 1 of them are true"
computes the parity of w.
This circuit (Threshold.parityCircuit) has n + 1 threshold gates and threshold depth two, the
n / 2 negations being free; with them it has n + n / 2 + 1 gates and depth three
(Threshold.exists_computes_parity). So parity has threshold circuits of polynomial size and
constant depth (Threshold.parity_mem_constDepth), and is in TC⁰
(Cslib.Circuits.Boolean.parity_mem_TC0).
Main definitions #
Cslib.Circuits.Boolean.Threshold.parityCircuit: the depth-two threshold circuit for parity.
Main results #
Cslib.Circuits.Boolean.Threshold.exists_computes_parity: the parity ofnbits has a circuit ofn + 1threshold gates and threshold depth two.Cslib.Circuits.Boolean.Threshold.parity_mem_constDepth: parity has threshold circuits of polynomial size and constant depth.
References #
A negation if b is true, and no gate otherwise.
Instances For
The j-th input of the output gate of parityCircuit n: the threshold gate "at least j + 1
of the n bits are true", negated when j is odd.
Instances For
The depth-two threshold circuit for parity: the threshold gate "at least n / 2 + 1 of
them are true" on the signed layer gates signedLayerGate n j.
Instances For
The circuit computes parity.
The circuit has n + 1 threshold gates.
The circuit has n + 1 threshold gates and n / 2 negations.
The circuit has threshold depth two: negations are free.
The circuit has depth three, counting the negations.
Parity in depth two: the parity of n bits has a circuit of n + 1 threshold gates and
threshold depth two, with n / 2 negations, so of n + n / 2 + 1 gates and depth three in all.
Every symmetric function has threshold circuits of depth two and linear size
Hajnal et al., Proposition 2.1.
Parity has threshold circuits of polynomial size and constant depth.