## Learning symmetric $k$-juntas in time ${n}^{o\left(k\right)}$

### April 2005

Abstract
We give an algorithm for learning symmetric $k$  -juntas (boolean functions of $n$  boolean variables which depend only on an unknown set of $k$  of these variables) in the PAC model under the uniform distribution, which runs in time ${n}^{O\left(k/logk\right)}$  . Our bound is obtained by proving the following result: Every symmetric boolean function on $k$  variables, except for the parity and the constant functions, has a non-zero Fourier coefficient of order at least 1 and at most $O\left(k/logk\right)$  . This improves the previously best known bound of $3k/31$  [?, and provides the first ${n}^{o\left(k\right)}$  time algorithm for learning symmetric juntas.

1 Introduction

We consider a fundamental problem in computational learning theory: learning in the presence of irrelevant information. One formalization of the problem is as follows: We want to learn an unknown boolean function of $n$  variables, which depends only on $k\ll n$  variables (typically $k$  is $O\left(logn\right)$  ). We call such a function a $k$  -junta. We are provided with a set of labelled examples $〈x,f\left(x\right)〉$  , where the $x$  's are picked uniformly and independently at random from the domain $\left\{0,1{\right\}}^{n}$  (this is the PAC model with uniform distribution). We wish to identify the $k$  relevant variables and the truth table of the function.
The problem was first posed by Blum [? and Blum and Langley [?, and it is considered [?, ? to be one of the most important open problems in the theory of uniform distribution learning. It has connections with learning DNF formulas and decision trees of super-constant size, see [?, ?, ?, ?, ? for details. The general case is believed to be hard and has even been used to propose a cryptosystem [?. A trivial algorithm runs in time roughly ${n}^{k}$  by doing an exhaustive search over all possible sets of relevant variables. Two important classes of juntas are learnable in polynomial time: parity and monotone functions. Learning parity functions can be reduced to solving a system of linear equations over ${\mathbb{F}}_{2}$  [?. Monotone functions have non-zero singleton Fourier coefficients (e.g., see [?).
For the general case, the first significant breakthrough was given in [? learning with confidence $1-\delta$  in time ${n}^{0.7k}poly\left({2}^{k},n,log1/\delta \right)$  . Note that we allow the running time to be polynomial in ${2}^{k}$  , since this is the size of the truth-table which is output. In the typical setting of $k=O\left(logn\right)$  , this becomes polynomial in $n$  .
In this paper we consider the class of symmetric $k$  -juntas, functions which are symmetric on their relevant variables. The only non-trivial algorithm known for this case is the standard Fourier based algorithm, described in Section  2 . The analysis of the running time of this algorithm reduces to the following question:
• What is the smallest $t$  such that every symmetric boolean function on $k$  variables, which is not a constant or a parity function, has a non-zero Fourier coefficient of order at least $1$  and at most $t$  ?
A bound of ${t}_{0}$  implies a running time of roughly ${n}^{{t}_{0}}$  . A bound of $\frac{2k}{3}$  was provided in [?. This was improved to $\frac{3k}{31}$  in [?. Here we show a bound of $O\left(k/logk\right)$  (Theorem  3.3 ), giving the first algorithm for learning symmetric $k$  -juntas in time ${n}^{o\left(k\right)}$  .
Techniques Our techniques involve a mix of number theory, combinatorics and probability. We start by reducing our problem to finding 0/1 solutions to a system of Diophantine equations involving binomial coefficients, as in [?. We then take a departure from [? by further reducing this to the problem of showing that a certain integer-valued polynomial $P$  is constant over the set $\left\{0,1,...,k\right\}$  . We manage to prove this in two steps: First, we show that $P$  is constant over the union of two small intervals $\left\{0,...,t\right\}\cup \left\{k-t,...,k\right\}$  . This is obtained by looking at $P$  modulo carefully chosen prime numbers. To choose these prime numbers we use the Siegel-Walfisz theorem on the density of primes in arithmetic progressions with modulus of moderate growth. In the second step, we extend the constant nature of $P$  to the whole interval $\left\{0,...,k\right\}$  by repeated applications of Lucas' Theorem. One additional interesting aspect of our proof is the use of an equivalence between a) the vanishing of Fourier coefficients and b) the equality of moments of certain random variables under the uniform measure on the hypercube and under the measure defined by the function itself. This equivalence helps us eliminate a lot of case analysis.

2 Preliminaries

Symmetric Juntas Given a boolean function $f$  on $n$  variables ${x}_{1},...,{x}_{n}$  , we will say that ${x}_{i}$  is a relevant variable for $f$  if there exist $x,y\in \left\{0,1{\right\}}^{n}$  which differ only in the $i$  -th coordinate and $f\left(x\right)\ne f\left(y\right)$  . Variables that are not relevant are called irrelevant. We will call $f$  a $k$  -junta if $f$  has at most $k$  relevant variables.
We consider the class of symmetric juntas. A boolean function $f:\left\{0,1{\right\}}^{k}\to \left\{0,1\right\}$  on $k$  variables is a symmetric function if for any permutation $\pi \in {S}_{k}$  , $f\left({x}_{1},...,{x}_{k}\right)=f\left(\pi \left({x}_{1}\right),...,\pi \left({x}_{k}\right)\right)$  .
Hence the value of $f$  at $\left({x}_{1},...,{x}_{k}\right)$  depends only on the weight of $\left({x}_{1},...,{x}_{k}\right)$  , which is the number of variables that are set to $1$  . A symmetric $k$  -junta is a function on $n$  variables which is symmetric on the $k$  variables it depends on.
We will describe a symmetric boolean function on $k$  variables by a $\left(k+1\right)$  -bit string ${f}_{0}{f}_{1}...{f}_{k}$  , where ${f}_{i}$  is the value of $f$  on an input of weight $i$  . The following four special symmetric functions on $k$  variables will appear often: the two constant functions $0$  and $1,$  the parity function $\oplus ,$  and its complement $\overline{\oplus }$  .
Learning in the PAC model We consider the PAC learning model [?, in which we wish to learn a Concept Class $\mathcal{C}={\cup }_{n}{\mathcal{C}}_{n},$  where each ${\mathcal{C}}_{n}$  is a collection of boolean functions from $\left\{0,1{\right\}}^{n}\to \left\{0,1\right\}$  . In our case, ${\mathcal{C}}_{n}$  is the class of symmetric $k$  -juntas on $n$  variables. Let $\epsilon$  be an accuracy parameter and $\delta$  a confidence parameter.
A learning algorithm $\mathcal{A}$  for $\mathcal{C}$  has access to an oracle for $f\in {\mathcal{C}}_{n}$  . A query to the oracle outputs a labeled example $〈x,f\left(x\right)〉,$  where $x$  is drawn from $\left\{0,1{\right\}}^{n}$  according to some probability distribution $\mathcal{D}$  . $\mathcal{A}$  is said to be a learning algorithm for the class $\mathcal{C}$  under the distribution $\mathcal{D}$  if for all $f\in \mathcal{C}$  , it outputs, with probability at least $1-\delta$  , a hypothesis $h$  such that $P{r}_{x}\left[h\left(x\right)=f\left(x\right)\right]\ge 1-\epsilon$  . We will be concerned only with the uniform distribution and we will obtain an algorithm with accuracy parameter $\epsilon =0$  , i.e., we identify the exact function $f$  .
Fourier Transform We will consider functions of the form: $f:\left\{0,1{\right\}}^{n}\to \mathbb{R}$  . An orthonormal basis for the functions defined on the Boolean cube can be given by the characters of the group ${Z}_{2}^{n}$  . In particular, for every $S\subseteq \left\{1,...,n\right\}$  , define the following function:
${\chi }_{S}\left(x\right)=\left(-1{\right)}^{{\sum }_{i\in S}{x}_{i}}.$  Any real-valued function on the Boolean cube can be expressed as a linear combination of the functions ${\chi }_{S}$  . Given $f$  , we have that $f\left(x\right)={\sum }_{S}\stackrel{^}{f}\left(S\right){\chi }_{S}\left(x\right)$  , where $\stackrel{^}{f}\left(S\right)$  is the Fourier coefficient of $f$  at $S$  and is equal to the inner product of $f$  with ${\chi }_{S}$  :
$\stackrel{^}{f}\left(S\right)=\frac{1}{{2}^{n}}{\sum }_{x\in \left\{0,1{\right\}}^{n}}f\left(x\right){\chi }_{S}\left(x\right).$  Fourier-based Learning Let $f$  be a $k$  -junta. It is known that we can exactly calculate the Fourier coefficients of $f$  in the uniform distribution PAC model, with confidence $1-\delta$  in time $poly\left({2}^{k},n,log\frac{1}{\delta }\right)$  , using standard Chernoff-Hoeffding bounds (see [?, ?). Observe further, that if ${x}_{i}$  is an irrelevant variable for a $k$  -junta $f$  , then for any $S\subseteq \left\{{x}_{1},...,{x}_{n}\right\}$  containing ${x}_{i}$  , $\stackrel{^}{f}\left(S\right)=0$  . Hence if $\stackrel{^}{f}\left(S\right)\ne 0$  , for some $S$  , then $S$  contains only relevant variables.
This suggests the following algorithm: Starting with $l=1$  , compute the Fourier coefficients of all subsets of $\left\{{x}_{1},...,{x}_{n}\right\}$  of size $l$  . Collect the union of all relevant variables that correspond to subsets with non-zero Fourier coefficients. Stop as soon as you collect all $k$  relevant variables.
Since the function is symmetric, for any two sets $S,T$  of relevant variables such that $|S|=|T|$  , we have $\stackrel{^}{f}\left(S\right)=\stackrel{^}{f}\left(T\right)$  . Hence the first time that we will identify some relevant variables in the algorithm, we will actually be able to identify all the relevant variables. Once we find the relevant variables, finding the truth-table of the function can be done in time $poly\left({2}^{k},log\frac{1}{\delta }\right)$  .
The above algorithm would take time roughly ${n}^{k}$  for $f\in \left\{0,1,\oplus ,\overline{\oplus }\right\}$  . However, these particular functions are well known to be learnable in time $poly\left(n,log\frac{1}{\delta }\right)$  . Hence the following is true:
Fact 2.1. If every symmetric function $f\notin \left\{0,1,\oplus ,\overline{\oplus }\right\}$  has a non-zero Fourier coefficient of order between 1 and $t$  , then we can learn symmetric $k$  -juntas in time ${n}^{t}poly\left({2}^{k},n,log\frac{1}{\delta }\right)$  .

3 Main Section

3.1 An Equivalent Formulation

We state an equivalent condition for the existence of a non-zero Fourier coefficient of a boolean function $f$  , as proved in [?. Let $f:\left\{0,1{\right\}}^{k}\to \left\{0,1\right\}$  be a boolean function. For a vector $\mathbf{x}=\left({x}_{1},\dots ,{x}_{k}\right),$  and a set $S\subseteq \left[k\right]$  , let ${\mathbf{x}}_{S}$  be the projection of $\mathbf{x}$  on the indices of $S$  . Let $\sigma \in \left\{0,1{\right\}}^{|S|}.$  Define the following probabilities:
${p}_{S,\sigma }\left(f\right):=Pr\left[f\left(\mathbf{x}\right)=1|{\mathbf{x}}_{S}=\sigma \right]$  Unless mentioned, all probabilities are over the uniform distribution on $\left\{0,1{\right\}}^{k}$  . For $t\ge 1$  , call a boolean function $f$  on $k$  variables $t$  -null, if for all sets $S\subseteq \left[k\right],$  with $|S|=t,$  and for all $\sigma \in \left\{0,1{\right\}}^{t},$  the probabilities ${p}_{S,\sigma }\left(f\right)$  are all equal to each other. The following lemma reveals the connection with the Fourier coefficients of $f$  .
Lemma 3.1. [? Let $f$  be a boolean function on $k$  variables. Then $f$  is $t$  -null for some $1\le t\le k,$  if and only if, for all $\varnothing \ne S\subseteq \left[k\right]$  with cardinality at most $t$  , $\stackrel{^}{f}\left(S\right)=0.$
It is clear that if $s\le t$  and $f$  is $t$  -null then it is also $s$  -null.
When we consider the case of symmetric functions, ${p}_{S,\sigma }\left(f\right)$  just depends on $t:=|S|$  and the weight $w$  of $\sigma$  . We denote this by ${p}_{t,w}\left(f\right).$  It is clear that:
 $\begin{array}{c}{p}_{t,w}\left(f\right)=\frac{1}{{2}^{k-t}}{\sum }_{i=0}^{k}{f}_{i}\left(\genfrac{}{}{0}{}{k-t}{i-w}\right)\end{array}$ (1)
where $\left(\genfrac{}{}{0}{}{l}{m}\right)$  is $0$  if $m<0$  or $m>l$  , and $\left(\genfrac{}{}{0}{}{0}{0}\right)$  is $1$  . It follows that $f$  is $t$  -null if for $0\le w\le t$  , ${p}_{t,w}\left(f\right)$  are all equal. It is easy to see that the constant boolean functions $\left\{0,1\right\}$  are $t$  -null for all $t$  with $1\le t\le k$  . The parity functions $\left\{\oplus ,\overline{\oplus }\right\}$  are also $t$  -null for all $t$  satisfying $1\le t  . From Lemma  3.1 and Equation  1 we get:
Corollary 3.2. All symmetric boolean functions $f\notin \left\{0,1,\oplus ,\overline{\oplus }\right\}$  have a non-zero Fourier coefficient of order at most ${t}_{0}$  (and at least $1$  ) iff $\left\{0,1,\oplus ,\overline{\oplus }\right\}$  are the only solutions to
 $\begin{array}{c}{\sum }_{i=0}^{k-{t}_{0}}{f}_{i}\left(\genfrac{}{}{0}{}{k-{t}_{0}}{i}\right)={\sum }_{i=1}^{k-{t}_{0}+1}{f}_{i}\left(\genfrac{}{}{0}{}{k-{t}_{0}}{i-1}\right)=\cdots ={\sum }_{i={t}_{0}}^{k}{f}_{i}\left(\genfrac{}{}{0}{}{k-{t}_{0}}{i-{t}_{0}}\right)\end{array}$ (2)
In the next section, we show that this is true for ${t}_{0}\le Ck/logk$  for large enough $k$  .

3.2 A bound of $O\left(k/logk\right)$  .

The following is our main theorem.
Theorem 3.3. There is an absolute constant $C>0$  such that for large $k$  , every symmetric boolean function $f$  on $k$  bits with $f\notin \left\{0,1,\oplus ,\overline{\oplus }\right\}$  has a non-zero Fourier coefficient of order at most $Ck/logk$  and at least $1$  .
The rest of this section is devoted to proving Theorem  3.3 . Suppose $f$  is a boolean function on $G={\mathbb{Z}}_{2}^{k}$  , such that all its Fourier coefficients of order up to $k-N$  are $0$  . Then the values ${f}_{j}$  of $f$  satisfy  2 with ${t}_{0}=k-N$  , which, changing parameters, can be rewritten as:
 $\begin{array}{c}{\sum }_{j}\left(\genfrac{}{}{0}{}{N}{j}\right){f}_{\nu +j}={c}_{N},\text{for all}\nu =0,\dots ,k-N\text{}.\end{array}$ (3)
We want to show that if $k-N\ge Ck/logk$  , for some appropriately large constant $C>0$  , then ${f}_{j}$  is either constant or alternates between $0$  and $1$  . We prove this for all $k$  sufficiently large.
Define ${X}_{j}={f}_{j+1}-{f}_{j}$  , for $j=0,\dots ,k-1$  , and observe that the sequence ${X}_{j}$  satisfies the homogeneous version of  3 :
 $\begin{array}{c}{\sum }_{j}\left(\genfrac{}{}{0}{}{N}{j}\right){X}_{\nu +j}=0,\text{for all}\nu =0,\dots ,k-N-1\text{}.\end{array}$ (4)
Remark. In  4 the number $N$  can be replaced by any other integer ${N}_{1}$  in the interval $\left[N,k\right]$  . This follows since all the non-constant Fourier coefficients up to order $k-N$  are $0$  .
From  4 the sequence ${X}_{j}$  may be defined for all $j\in \mathbb{Z}$  and ${X}_{j}\in \mathbb{Z}$  for all $j$  . From the theory of recurrence relations we know then that the sequence ${X}_{j}$  may be written as a linear combination of the following sequences:
$\left(-1{\right)}^{j},\left(-1{\right)}^{j}j,\left(-1{\right)}^{j}{j}^{2},\dots ,\left(-1{\right)}^{j}{j}^{N-1}.$  The reason for this is that $-1$  is the only root of the characteristic polynomial of the recurrence, $\phi \left(z\right)={\sum }_{j}\left(\genfrac{}{}{0}{}{N}{j}\right){z}^{j}=\left(1+z{\right)}^{N}$  . Therefore there is a polynomial $P\left(x\right)$  , of degree at most $N-1$  , such that ${X}_{j}=\left(-1{\right)}^{j}P\left(j\right),\text{for all}j\in \mathbb{Z}\text{}.$  Clearly $P\left(x\right)$  takes integer values on integers and in particular $P\left(j\right)\in \left\{-1,0,1\right\}$  for $j=0,\dots ,k-1$  . From the well known characterization of integer-valued polynomials it follows that we may write
 $\begin{array}{c}P\left(x\right)={\sum }_{j=0}^{N-1}{a}_{j}\left(\genfrac{}{}{0}{}{x}{j}\right),\text{with}{a}_{j}\in \mathbb{Z}\text{}.\end{array}$ (5)
If $p\ge N$  is a prime, and since all the factors that appear in denominators in  5 are strictly less than $p$  (hence invertible mod $p$  ), it follows that the sequence $P\left(j\right)modp$  , $j\in \mathbb{Z}$  , may be viewed as a polynomial with coefficients in ${\mathbb{Z}}_{p}$  and therefore is a $p$  -periodic sequence mod $p$  , i.e.
 $\begin{array}{c}P\left(j+p\right)=P\left(j\right)modp,\text{for all}j\in \mathbb{Z}\text{and}p\ge N\text{}.\end{array}$ (6)
If, in addition, $0\le j  , when all $P$  -values that appear in  6 are in $\left\{-1,0,1\right\}$  , it follows that we have the non-modular equality
 $\begin{array}{c}P\left(j+p\right)=P\left(j\right),\left(N\le p\le j+p (7)
We want to show that $f\in \left\{0,1,\oplus ,\overline{\oplus }\right\}$  . Since ${X}_{j}={f}_{j+1}-{f}_{j}$  it is enough to show that either ${X}_{j}$  is identically $0$  or that ${X}_{j}=\left(-1{\right)}^{j}$  or ${X}_{j}=\left(-1{\right)}^{j+1}$  . This is equivalent to showing that $P$  is a constant polynomial, constantly equal to $-1,0$  or $1$  .
Notation. 1. In what follows we repeatedly use the letter $C$  to denote a positive constant which depends on no parameter (unless we say otherwise). As is customary, this constant $C$  need not be the same in all its occurences.
2. We define $\epsilon$  by the relation $k-N=\epsilon k$  and assume $\epsilon \ge C/logk$  , with $C$  a large enough positive constant.
We shall need various primes in intervals from now on. The version of the prime number theorem that we will be using is the Siegel-Walfisz theorem (see [?,Theorem2). Define the logarithmic integral $Lix={\int }_{2}^{x}\frac{dt}{logt}\sim \frac{x}{logx},\left(x\to \infty \right).$  The Euler function $\phi \left(q\right)$  denotes the number of moduli mod $q$  which are coprime to $q$  .
Theorem A (Siegel-Walfisz) Let $\pi \left(x;M,a\right)$  be the number of primes $\le x$  which are equal to $amodM$  and assume that $\left(M,a\right)=1$  . Then if $M\le \left(logx{\right)}^{A}$  , $A$  a constant, we have
 $\begin{array}{c}\pi \left(x;M,a\right)=\frac{Lix}{\phi \left(M\right)}+O\left(xexp\left(-c\sqrt{logx}\right),\text{(as}x\to \infty \text{)}.\end{array}$ (8)
where $c$  depends on $A$  only (the constant in the $O\left(\cdot \right)$  term is absolute).
For $\pi \left(x\right)$  , the number of primes up to $x$  without any restriction, the prime number theorem says $\pi \left(x\right)=Li\left(x\right)+O\left(xexp\left(-c\sqrt{logx}\right)$  , for some constant $c$  .
These theorems guarantee that, for $x\to \infty$  , the interval $\left[x,x+\Delta \right]$  has the “expected” number of primes whenever $\Delta \ge Cx/\left(logx{\right)}^{A}$  , whatever the constant $A$  , even if we impose the condition that these primes are equal to $amodM$  , as long as $M\le \left(logx{\right)}^{B}$  , for any constant $B$  .
We use the above theorems along with the $p$  -periodicity of $P$  to deduce that $P$  is in fact $2$  -periodic on the union of $2$  small sub-intervals of $\left[0,k-1\right]$  .
Lemma 3.4. The polynomial $P$  satisfies the 2-periodicity condition $P\left(j\right)=P\left(j+2\right),$  whenever $j,j+2\in \mathcal{A}=\left[0,k-N\right]\cup \left[N,k-1\right]$  .
• Proof. Assume $q  are two primes in $\left[N,N+h\right]$  , where $h=\left(k-N\right)/3=\frac{\epsilon }{3}k$  . (The length of the interval $\left[N,N+h\right]$  is large enough for the prime number theorem to guarantee the existence of many primes in it.) From  7 it follows that the finite sequences $P\left(0\right),\dots ,P\left(k-q\right)\text{and}P\left(q\right),\dots ,P\left(k\right)$  are identical. Applying  7 again with $r$  we get that the finite sequences $P\left(0\right),\dots ,P\left(k-r\right)\text{and}P\left(r\right),\dots ,P\left(k\right)$  are identical. It follows that  $\begin{array}{c}P\left(j+r-q\right)=P\left(j\right),\text{if}N+h\le j\le N+2h\text{and}r>q\text{primes in}\left[N,N+h\right]\text{}.\end{array}$ (9)
We now assume that the difference $M=r-q$  is the smallest difference between two primes in $\left[N,N+h\right]$  . By the prime number theorem $M\le Clogk$  . Hence, we can apply Theorem  A . Since $\phi \left(M\right)\le M\le Clogk$  in that case Theorem  A guarantees that the number of primes equal to $amodM$  in $\left[N,N+h\right]$  is at least $C\frac{h}{{log}^{2}k}\sim C\frac{k}{{log}^{3}k},$  whenever $\left(M,a\right)=1$  . All that matters here is that this number is positive.
Let $t\in \left[N,N+h\right]$  be the smallest prime which is equal to $-1modM$  . By Theorem  A , applied to $M$  and $-1$  , its existence is guaranteed and furthermore that $t\sim N$  . The same theorem guarantees that we can find a prime $s\in \left(t,N+h\right]$  such that $s=1modM$  . Then $s-t=2modM$  or $s-t=\ell M+2$  , for some nonnegative integer $\ell$  . Therefore, for $N+h\le j\le N+2h$  we have  $\begin{array}{ccc}P\left(j\right)& =& P\left(j+s-t\right)\text{(applyingdiff-periodicity9 for the primes}s,t\text{)}\end{array}$
 $\begin{array}{ccc}& =& P\left(j+\ell M+2\right)\end{array}$
 $\begin{array}{ccc}& =& P\left(j+\left(\ell -1\right)M+2\right)\text{(applyingdiff-periodicity9 for the primes}r,q\text{)}\end{array}$
 $\begin{array}{ccc}& & \cdot \cdot \cdot \end{array}$
 $\begin{array}{ccc}& =& P\left(j+2\right).\end{array}$
This $2$  -periodicity  $\begin{array}{c}P\left(j\right)=P\left(j+2\right)\end{array}$ (10)
is transferred to all $j,j+2\in \mathcal{A}$  by using  7 repeatedly for appropriate primes $p$  .
Notice that in the sequence ${X}_{j}$  , if one erases the $0$  's then one sees an alternation of $-1$  and $1$  (this follows from the fact that ${f}_{j}\in \left\{0,1\right\}$  ). This property greatly reduces the number of allowed patterns in ${X}_{j}$  and in fact it implies that $P$  is constant in $\mathcal{A}$  .
Lemma 3.5. The polynomial $P$  is constant in $\mathcal{A}$  (defined in Lemma  3.4 ).
• Proof. From Lemma  3.4 the values of $P$  in $\left[N,k-1\right]$  must be a $2$  -periodic sequence. The only essentially different non-constant $2$  -periodic patterns for the values of $P$  in $\left[N,k-1\right]$  are $010101\dots$  and $\left(-1\right)1\left(-1\right)1\dots$  and they both violate the property that ${X}_{j}=\left(-1{\right)}^{j}P\left(j\right)$  must satisfy, namely that if one erases the $0$  's then one must see an alternation of $1$  and $-1$  . Therefore $P$  is constant in each of the two intervals of $\mathcal{A}$  . From the $p$  -periodicity  7 it follows that the constant is the same in both intervals.
We now extend the set on which $P$  is constant to a superset of $\mathcal{A}$  that contains a small interval around $k/2$  . We will make use of the following theorem which follows from Lucas' Theorem [?,Ch.3.
Theorem 3.6. If $r$  is a prime which does not divide $n$  then $\left(\genfrac{}{}{0}{}{mr}{n}\right)=0modr$  . Also, if $0\le m  then $\left(\genfrac{}{}{0}{}{mr}{lr}\right)=\left(\genfrac{}{}{0}{}{m}{l}\right)modr$  .
Lemma 3.7. Let $a=\left(1/2-\epsilon /2\right)k$  and $b=\left(1/2+\epsilon /2\right)k$  . Then $P\left(l\right)=P\left(0\right)$  for $a\le l\le b$  .
• Proof. We shall apply Theorem  3.6 with $m=2$  and with a prime $r$  such that $2r-N$  takes the minimal possible nonnegative value. It follows from the prime number theorem that $2r-N=o\left(\epsilon k\right)$  .
And it follows from the remark after  4 that ${\sum }_{j}\left(-1{\right)}^{j}\left(\genfrac{}{}{0}{}{2r}{j}\right)P\left(j+\nu \right)=0,\left(\nu \in \mathbb{Z}\right).$  Taking residues mod $r$  and using Theorem  3.6 for $m=2$  we obtain $P\left(\nu \right)-2P\left(\nu +r\right)+P\left(\nu +2r\right)=0modr,\left(\nu \in \mathbb{Z}\right).$  By our particular choice of $r$  we have $P\left(\nu \right)=P\left(\nu +2r\right)=P\left(0\right)$  whenever $\nu \in \left[0,k-N-o\left(\epsilon k\right)\right]$  .
It follows that $P\left(\nu +r\right)=P\left(0\right)$  . Applying this for all $\nu \in \left[0,k-N-o\left(\epsilon k\right)\right]$  we get $P\left(l\right)=P\left(0\right)$  for all $l$  in the interval $\left(a+o\left(\epsilon k\right),b-o\left(\epsilon k\right)\right)$  . To get rid of the $o\left(\epsilon k\right)$  terms in the interval above, just choose a slightly larger $r$  and apply again for all $\nu \in \left[0,k-N-o\left(\epsilon k\right)\right]$  .
So far we have proved $P\left(l\right)=P\left(0\right)$  on the set ${\mathcal{A}}_{2}=\left[0,k-N\right]\cup \left[a,b\right]\cup \left[N,k-1\right],$  which consists of three equispaced intervals of roughly equal size $\epsilon k$  . We consider $2$  cases for $P$  .
The first is when $P$  is $0$  on ${\mathcal{A}}_{2}$  and the second is when $P$  is $1$  or $-1$  .
In the case that $P$  is $0$  on ${\mathcal{A}}_{2}$  , we shall need the following theorem, which already gives a lot of significant information about the function $f$  . It should be thought of as analogous to the fact that the moments of a (vector) random variable can be read off the Fourier Transform of its distribution (the characteristic function) by looking at derivatives at $0$  .
Theorem 3.8. Suppose $f:G={\mathbb{Z}}_{2}^{k}={\left\{0,1\right\}}^{k}\to \mathbb{R}$  is nonnegative (and not identically $0$  ) and has all its Fourier coefficients of order at most $r$  (and at least 1) equal to $0$  . Let $\mu$  denote the uniform probability measure on the cube $G$  and $\nu$  denote the probability measure on $G$  defined by $\nu \left(A\right)={\sum }_{x\in A}f\left(x\right)/{\sum }_{x\in G}f\left(x\right),\text{(}A\subseteq G\text{)}.$  Let also ${X}_{1},\dots ,{X}_{k}$  denote the coordinate functions on $G$  , which we view as random variables. Then for all ${i}_{1}<{i}_{2}<\cdots <{i}_{s}$  , $0\le s\le r$  , we have ${\mathbf{E}}_{\nu }\left({X}_{{i}_{1}}\cdots {X}_{{i}_{s}}\right)={\mathbf{E}}_{\mu }\left({X}_{{i}_{1}}\cdots {X}_{{i}_{s}}\right).$
• Proof. Let $F={\sum }_{x\in G}f\left(x\right)$  . We assume for simplicity that ${i}_{1}=1,\dots ,{i}_{s}=s$  . Then, writing $x=\left({x}_{1},{x}_{2},\dots ,{x}_{k}\right)$  and $\left[s\right]=\left\{1,\dots ,s\right\}$  , we have  $\begin{array}{ccc}{\mathbf{E}}_{\nu }\left({X}_{1}\cdots {X}_{s}\right)& =& \frac{1}{F}{\sum }_{x\in G}f\left(x\right){x}_{1}\cdots {x}_{s}\end{array}$
 $\begin{array}{ccc}& =& \frac{1}{F}{\sum }_{x\in G}f\left(x\right)\frac{1+\left(-1{\right)}^{{x}_{1}+1}}{2}\cdots \frac{1+\left(-1{\right)}^{{x}_{s}+1}}{2}\end{array}$
 $\begin{array}{ccc}& =& \frac{1}{{2}^{s}F}{\sum }_{x\in G}f\left(x\right){\sum }_{S\subseteq \left[s\right]}\left(-1{\right)}^{|S|+{\sum }_{i\in S}{x}_{i}}\end{array}$
 $\begin{array}{ccc}& =& \frac{|G|}{{2}^{s}F}{\sum }_{S\subseteq \left[s\right]}\left(-1{\right)}^{|S|}\frac{1}{|G|}{\sum }_{x\in G}f\left(x\right)\left(-1{\right)}^{{\sum }_{i\in S}{x}_{i}}\end{array}$
 $\begin{array}{ccc}& =& \frac{|G|}{{2}^{s}F}{\sum }_{S\subseteq \left[s\right]}\left(-1{\right)}^{|S|}\stackrel{^}{f}\left(S\right)\end{array}$
 $\begin{array}{ccc}& =& \frac{|G|}{{2}^{s}F}\stackrel{^}{f}\left(0\right)\text{(by the vanishing of}\stackrel{^}{f}\text{)}\end{array}$
 $\begin{array}{ccc}& =& {2}^{-s}\end{array}$
 $\begin{array}{ccc}& =& {\mathbf{E}}_{\mu }\left({X}_{1}\cdots {X}_{s}\right)\end{array}$
Remarks. 1. For functions $f:\left\{0,1{\right\}}^{k}\to \left\{0,1\right\}$  , the above theorem follows directly from the definition of $t$  -nullity in Section  3.1 . However, as we shall see in the proof of Lemma  3.10 we need to apply this theorem for functions whose range is not $\left\{0,1\right\}$  .
2. If the nonnegative function $f$  is symmetric then the identity of moments up to order $r$  with those of the uniform distribution ( $r$  -wise independence) and the vanishing of the non-constant Fourier coefficiens of weight up to $r$  are equivalent. This can be proved by induction on $r$  . We do not use this here.
Corollary 3.9. Under the assumptions and definitions of Theorem  3.8 the random variable $S={X}_{1}+\cdots +{X}_{k}$  has the same power moments under the probability measures $\mu$  and $\nu$  , up to order $r$  .
• Proof. The power ${S}^{s}$  , $s\le r$  , can be written as a sum of terms of the type ${X}_{{i}_{1}}\cdots {X}_{{i}_{t}}$  , for $t\le s$  .
One uses the fact that ${X}_{j}^{2}={X}_{j}$  .
Lemma 3.10. If $P$  is $0$  on ${\mathcal{A}}_{2}$  , then $f\in \left\{0,1\right\}$  .
• Proof. Suppose the polynomial $P$  is constantly equal to $0$  on the set ${\mathcal{A}}_{2}$  and that $f\notin \left\{0,1\right\}$  . The sequence ${f}_{j}$  is constant in each of the three intervals of ${\mathcal{A}}_{2}$  . By possibly considering $1-f$  (whose Fourier coefficients vanish exactly where those of $f$  do), we may assume that ${f}_{j}=0$  on the middle interval $\left(a,b\right)$  . Define the nonnegative function $g:G\to \mathbb{R}$  by $g\left({x}_{1},\dots ,{x}_{k}\right)=f\left({x}_{1},\dots ,{x}_{k}\right)+f\left(1-{x}_{1},\dots ,1-{x}_{k}\right),$  and observe that the Fourier coefficients of $g$  of weight at most $k-N$  vanish. Let $\tau$  be the distribution of the random variable $S={X}_{1}+\cdots +{X}_{k}$  under the measure induced by $g$  on $G$  (each vertex $x\in G$  has probability proportional to $g\left(x\right)$  ). Note that this is a well defined probability distribution since we assumed that $f$  and $1-f$  are not the $0$  function. Clearly $\tau$  is symmetric about $k/2$  and has no mass in $\left(a,b\right)$  , since both $f\left({x}_{1},\dots ,{x}_{k}\right)$  and $f\left(1-{x}_{1},\dots ,1-{x}_{k}\right)$  are $0$  when ${x}_{1}+\cdots +{x}_{k}\in \left(a,b\right)$  . The $s$  -th moment with respect to the measure $\tau$  of the variable $S$  in Corollary  3.9 is the expression $M\left(\tau ,s\right)=\frac{1}{F}{\sum }_{j}{g}_{j}\left(\genfrac{}{}{0}{}{k}{j}\right){j}^{s},$  where again $F={\sum }_{j}{g}_{j}\left(\genfrac{}{}{0}{}{k}{j}\right)$  . By Corollary  3.9 this must equal the $s$  -th moment with respect to the binomial measure $\mu$  , which is the quantity $M\left(\mu ,s\right)={2}^{-k}{\sum }_{j}\left(\genfrac{}{}{0}{}{k}{j}\right){j}^{s}.$  But the variance of $S$  under $\mu$  is $M\left(\mu ,2\right)-M\left(\mu ,1{\right)}^{2}=k,$  since under $\mu$  the random variables ${X}_{1},\dots ,{X}_{k}$  are independent, while the variance of $S$  under $\tau$  is $M\left(\tau ,2\right)-M\left(\tau ,1{\right)}^{2}\ge C{\epsilon }^{2}{k}^{2},$  as half the mass of $\tau$  sits to the left of $\frac{1-\epsilon }{2}k$  and half to the right of $\frac{1+\epsilon }{2}k$  . These orders of magnitude are different whenever $\epsilon \ge C/\sqrt{k}$  , which is true in our case as $\epsilon \ge C/logk$  . This contradiction proves that $P$  cannot equal $0$  on ${\mathcal{A}}_{2}$  .
Extending ${\mathcal{A}}_{2}$  to $\left[0,k-1\right]$  .
The rest of the proof goes as follows. By Lemma  3.10 , we may assume that $P\left(l\right)=1$  or $-1$  for $l\in {\mathcal{A}}_{2}$  . Without loss of generality, assume $P$  is $1$  on ${\mathcal{A}}_{2}$  . We apply Theorem  3.6 for $m=4,8,16,\dots$  successively and each time we choose a prime $r$  such that $mr-N$  is minimized. Theorem  3.6 gives for all $\nu \in \mathbb{Z}$
 $\begin{array}{c}P\left(\nu \right)-mP\left(\nu +r\right)+\left(\genfrac{}{}{0}{}{m}{2}\right)P\left(\nu +2r\right)-\cdots +P\left(\nu +mr\right)=0modr.\end{array}$ (11)
When $\nu \in \left[0,k-N\right]$  the numbers $\nu +lr$  for even $l$  in  11 are in the set ${\mathcal{A}}_{m/2}$  and therefore the corresponding $P$  values are all $1$  , by induction on $m$  . In order to deduce that  11 holds as an identity of integers (not residue classes) it is enough to guarantee that the sum of the absolute values of all terms is less than $r$  . This amounts to the inequality ${2}^{m}  . Given that $mr\sim k$  this is true if we can guarantee that
 $\begin{array}{c}m\le {c}_{1}logk,\end{array}$ (12)
for some small enough constant ${c}_{1}$  . Therefore, as long as $m$  satisfies the bound  12 , we have that, for $\nu \in \left[0,k-N\right]$  ,
 $\begin{array}{c}P\left(\nu \right)-mP\left(\nu +r\right)+\left(\genfrac{}{}{0}{}{m}{2}\right)P\left(\nu +2r\right)-\cdots +P\left(\nu +mr\right)=0.\end{array}$ (13)
Since the total weights of the positive and negative terms in  13 are the same, it follows that the $P\left(\nu +lr\right)$  terms corresponding to odd $l$  are also $1$  .
Each time we perform this operation we deduce that $P$  is $1$  on a collection of intervals ${\mathcal{A}}_{m}$  which consists of ${\mathcal{A}}_{m/2}$  and one interval of length $\epsilon k$  in the middle of the gap between any two succesive intervals of ${\mathcal{A}}_{m/2}$  . So ${\mathcal{A}}_{m}$  has $m+1$  disjoint equispaced intervals of length $\epsilon k$  . We apply this operation until we have $\epsilon m\sim 1$  , which implies that we have covered the whole interval $\left[0,k-1\right]$  with our set ${\mathcal{A}}_{m}$  . We need to make sure that  12 still holds then. Since $\epsilon m\sim 1$  this is achieved by setting $\epsilon =C/logk$  , for a large enough constant $C$  . At the end of this process, there could still be some very small possibly uncovered intervals of size $o\left(\epsilon k\right)$  . However since we have already shown that $P\left(l\right)=1$  on a set of $k-o\left(\epsilon k\right)$  entries, we can use the fact that $P$  has degree at most $N-1$  to obtain that $P\left(l\right)=1$  on the whole interval $\left[0,k-1\right]$  .
This concludes the proof of the Theorem  3.3 , which implies:
Corollary 3.11. The class of symmetric $k$  -juntas can be learned exactly under the uniform distribution with confidence $1-\delta$  in time ${n}^{O\left(k/logk\right)}\cdot poly\left({2}^{k},n,log\left(1/\delta \right)\right)$  .

4 Discussion

The main open question is to obtain tight upper and lower bounds on the running time of the Fourier-based algorithm for symmetric juntas. It may even be that for large $k$  , every symmetric function has a non-zero Fourier coefficient of constant order.
It should also be noted that in the case of balanced symmetric functions, i.e., symmetric functions with $Pr\left[f\left(x\right)=1\right]=1/2$  , a bound of $O\left({k}^{0.548}\right)$  follows from [? (see [?). Hence to improve our result, one may focus on finding new techniques for unbalanced functions.