1
Sublinear Algorithms
Lecture 26
Sofya Raskhodnikova
Penn State University
Thanks to Madhav Jha (Penn State) for help with creating these slides.
Sublinear Algorithms Lecture 26 Sofya Raskhodnikova Penn State - - PowerPoint PPT Presentation
Sublinear Algorithms Lecture 26 Sofya Raskhodnikova Penn State University Thanks to Madhav Jha (Penn State) for help with creating these slides. 1 Testing Linearity Linear Functions Over Finite Field 2 A Boolean function : 0,1
1
Thanks to Madhav Jha (Penn State) for help with creating these slides.
3
β Other accepted notation for πΎ2: π»πΊ
2 and β€2
β Addition and multiplication is mod 2 β π= π¦1, β¦ , π¦π , π= π§1, β¦ , π§π , that is, π, π β 0,1 π π + π= π¦1 + π§1, β¦ , π¦π + π§π no free term
Based on Ryan OβDonellβs lecture notes: http://www.cs.cmu.edu/~odonnell/boolean-analysis/
001001 011001 010000
+ example
4
Input: Boolean function π: 0,1 π β {0,1} Question: Is the function linear or π-far from linear (β₯ π2π values need to be changed to make it linear)? Today: can answer in π
1 π time
β A special case of many important property tests β Computations over finite fields are used in
β Originally designed for program checkers and self-correctors β Low-degree testing is needed in constructions of Probabilistically Checkable Proofs (PCPs)
β Powerful and widely used technique in understanding the structure of Boolean functions
5
6
β π π¦1, β¦ , π¦π = π¦π
πβS
for some π β π . Definitionβ². π is linear if π π + π = π π + π(π) for all π, π β 0,1 π.
π π + π = π + π π = π¦π +
πβπ
π§π = π π + π π .
πβπ πβπ
Let π½π = π((0, β¦ , 0,1,0, β¦ , 0
ππ
)) Repeatedly apply Definitionβ²: π π¦1, β¦ , π¦π = π π¦πππ = π¦ππ ππ = π½ππ¦π.
Based on Ryan OβDonellβs lecture notes: http://www.cs.cmu.edu/~odonnell/boolean-analysis/
[π] is a shorthand for {1, β¦ π}
7
1. Pick π and π independently and uniformly at random from 0,1 π. 2. Set π = π + π and query πon π, π, and π. Accept iff π π = π π + π π . Analysis If πis linear, BLR always accepts. If π is π-far from linear then > π fraction of pairs π and π fail BLR test.
BLR Test (f, Ξ΅)
Correctness Theorem [Bellare Coppersmith Hastad Kiwi Sudan 95]
Stack the 2π values of π(π) and treat it as a vector in {0,1}2π.
π = 1 1 1 β β β 1
π(0000) π(0001) π(0010) π(0011) π(0100) β β β π(1101) π(1110) π(1111)
9
There are 2π linear functions: one for each subset π β [π]. πβ = β β β , π 1 = 1 1 β β β 1 1 , β― β―, π π = 1 1 1 β β β 1
10
Parity on the positions indexed by set π is ππ π¦1, β¦ , π¦π = π¦π
πβS
Idea: Change notation, so that we work over reals instead of a finite field.
1/True βΆ -1.
π¦π
πβπ
.
11
(# πβs such that π π = π(π)) β (# πβs such that π π β π(π)) = 2π β 2 β (# πβs such that π π β π(π)) π, π = 1 2π dot product of π and π as vectors = avg
πβ β1,1 π π π π π
= E
πβ β1,1 π[ π π π π ].
π, π = 1 β 2 β (fraction of disagreements between π and π)
12
disagreements between π and π
β Let π be an element on which π and π differ (w.l.o.g. π β π β π) β Pair up all π-bit strings: (π, π π ) where π π is π with the πth bit flipped. β Each such pair contributes ππ β ππ = 0 to ππ, ππ . β Since all πβs are paired up, ππ, ππ = 0.
β In fact, π, π = 1 for all π βΆ β1, 1 π β β1, 1 . β (The norm of π, denoted π , is π, π )
13
π π π
ππ ππ
+1 β1 +1 +π +1 β β β βπ +1 β1 β1 β1 +1 +1 π +1 β β β π β1 +1 +1 The functions ππ πβ π form an orthonormal basis for β2π. Claim.
Idea: Work in the basis ππ πβ π , so it is easy to see how close a specific function π is to each of the linear functions.
Every function π βΆ β1, 1 π β β is uniquely expressible as a linear combination (over β) of the 2π linear functions: where π π = π, ππ is the Fourier Coefficient of π on set π. Proof: π can be written uniquely as a linear combination of basis vectors: π = ππ β ππ
πβ π
It remains to prove that ππ=π π for all π. π π = π, ππ = ππ β ππ
πβ[π]
, ππ = ππ β ππ, ππ
πβ[π]
= ππ
14
Fourier Expansion Theorem
π = π π ππ,
πβ π
Linearity of β ,β
ππ, ππ =
1 if π = π 0 otherwise Definition of Fourier coefficients
π Fourier transform π π = 1 1 π π = π¦π π¦π AND(π¦1, π¦2) 1 2 + 1 2 π¦1 + 1 2 π¦2 β 1 2 π¦1π¦2 MAJORITY(π¦1, π¦2, π¦3) 1 2 π¦1 + 1 2 π¦2 + 1 2 π¦3 β 1 2 π¦1π¦2π¦3
15
Proof: π, π = π π ππ
πβ π
, π π ππ
πβ π
= π π
π π
π π ππ, ππ = π π 2
π
16
By linearity of inner product By orthonormality of ππβs
Parseval Equality
Let π: β1, 1 π β β. Then π, π = π π 2
πβ π
By Fourier Expansion Theorem
Proof: π, π = E
πβ β1,1 π[π π 2]
= 1
17
Parseval Equality for Boolean Functions
Let π: β1, 1 π β β1, 1 . Then π, π = π π 2
πβ π
= 1
By definition of inner product Since π is Boolean
Vector product notation: π β π = (π¦1π§1, π¦2π§2, β¦ , π¦ππ§π) Proof: Indicator variable ππΆππ = 1 if BLR accepts 0 otherwise β ππΆππ =
1 2 + 1 2 π π π π π π .
Pr
π,πβ β1,1 π BLR π accepts =
E
π²,π³β β1,1 π ππΆππ = 1
2 + 1 2 E
π²,π³β β1,1 π π π π π π π
18
BLR Test (f, Ξ΅)
1.
Pick π and π independently and uniformly at random from β1,1 π. 2. Set π = π β π and query π on π, π, and π. Accept iff π π π π π π = 1. Pr
π²,π³β β1,1 π BLR π accepts = 1
2 + 1 2 π π 3
πβ[π]
Sum-Of-Cubes Lemma.
By linearity of expectation
So far: Pr
π²,π³β β1,1 π BLR π accepts = 1 2 + 1 2
E
π²,π³β β1,1 π π π π π π π
Next:
19
= π π π π π π E
π²,π³β β1,1 π[ππ(π)ππ(π)ππ(π) π,π,πβ[π]
] = E
π²,π³β β1,1 π
π π π π π π ππ(π)ππ(π)ππ(π)
π,π,πβ[π]
E
π²,π³β β1,1 π π π π π π π
= E
π²,π³β β1,1 π
π π ππ(π)
πβ[π]
π π ππ(π)
πβ[π]
π π ππ(π)
πβ[π]
By Fourier Expansion Theorem Distributing out the product of sums By linearity of expectation
Pr
π²,π³β β1,1 π BLR π accepts
20
a= E
π²,π³β β1,1 π
π¦π
πβπ
π§π π¦ππ§π
πβπ πβπ
a= E
π²,π³β β1,1 π
π¦π
πβπΞπ
π§π
πβπΞπ
a= E
π²β β1,1 π
π¦π
πβπΞπ
β E
π³β β1,1 π
π§π
πβπΞπ
a= E
π²β β1,1 π[π¦π] πβπΞπ
β E
π³β β1,1 π[π§π] πβπΞπ
a E
π²,π³β β1,1 π[ππ(π)ππ(π)ππ(π)]
= 1 when πΞπ = β and πΞπ = β β π = π = π 0 otherwise a= E
π²,π³β β1,1 π
π¦π
πβπ
π§π π¨π
πβπ πβπ
= 1 2 + 1 2
π π π π π π E
π²,π³β β1,1 π[ππ(π)ππ(π)ππ(π) π,π,πβ[π]
]
Since π¦π
2 = π§π 2 = 1
Since π² and π³ are independent Since π΄ = π² β π³ Since π² and π³β²s coordinates are independent
a= E
π¦πβ{β1,1}[π¦π] πβπΞπ
β E
π§πβ{β1,1}[π§π] πβπΞπ
E
π²,π³β β1,1 π[ππ(π)ππ(π)ππ(π)] is 1 if π = π = π and 0 otherwise.
Claim.
21
= 1 2 + 1 2 π π 3
πβ[π]
Pr
π²,π³β β1,1 π BLR π accepts = 1
2 + 1 2 π π 3
πβ[π]
Sum-Of-Cubes Lemma.
Pr
π²,π³β β1,1 π BLR π accepts
= 1 2 + 1 2
π π π π π π E
π²,π³β β1,1 π[ππ(π)ππ(π)ππ(π) π,π,πβ[π]
]
Proof: Suppose to the contrary that
πβ π π
π > 1 β 2π. That is, π π > 1 β 2π for some π β π .
π = π, ππ = 1 β 2 β (fraction of disagreements between π and ππ)
22
By Sum-Of-Cubes Lemma Since π π 2 β₯ 0 Parseval Equality
Correctness Theorem (restated)
If π is Ξ΅-far from linear then Pr BLR π accepts β€ 1 β π. = 1 2 + 1 2 π π 3
πβ[π]
β€ 1 2 + 1 2 β max
πβ π π
π β π π 2
πβ π
= 1 2 + 1 2 β max
πβ π π
π 1 β π < Pr
π²,π³β β1,1 π BLR π accepts
1 π time.
23