the hemi-icosahedron function $\mathrm{HI} : \{-1,1\}^6 \to \{-1,1\}$, defined as follows: $\mathrm{HI}(x)$ is $1$ if the number of $1$’s in $x$ is $1$, $2$, or $6$. $\mathrm{HI}(x)$ is $-1$ if the number of $-1$’s in $x$ is $1$, $2$, or $6$. Otherwise, $\mathrm{HI}(x)$ is $1$ if and only if one of the ten facets in the following diagram has all three of its vertices $1$:

the complete quadratic function $\mathrm{CQ}_n : {\mathbb F}_2^{n} \to \{-1,1\}$ defined by $\mathrm{CQ}_n(x) = \chi(\sum_{1 \leq i < j \leq n} x_ix_j)$. (Hint: determine $\mathrm{CQ}_n(x)$ as a function of the number of $1$’s in the input modulo $4$. You will want to distinguish whether $n$ is even or odd.)

Prove that any $f : \{-1,1\}^n \to \{-1,1\}$ has at most one Fourier coefficient with magnitude exceeding $1/2$. Is this also true for any $f : \{-1,1\}^n \to {\mathbb R}$ with $\|f\|_2 = 1$?

Use Parseval’s Theorem to prove uniqueness of the Fourier expansion.

Let $\boldsymbol{f} : \{-1,1\}^n \to \{-1,1\}$ be a random function (i.e., each $\boldsymbol{f}(x)$ is $\pm 1$ with probability $1/2$, independently for all $x \in \{-1,1\}^n$). Show that for each $S \subseteq [n]$, the random variable $\widehat{\boldsymbol{f}}(S)$ has mean $0$ and variance $2^{-n}$. (Hint: Parseval.)

The (boolean) dual of $f : \{-1,1\}^n \to \{-1,1\}$ is the function $f^\dagger$ defined by $f^\dagger(x) = -f(-x)$. The function $f$ is said to be odd if it equals its dual; equivalently, if $f(-x) = -f(x)$ for all $x$. The function $f$ is said to be even if $f(-x) = f(x)$ for all $x$. Given any function $f : \{-1,1\}^n \to {\mathbb R}$, its odd part is the function $f^\mathrm{odd} : \{-1,1\}^n \to {\mathbb R}$ defined by $f^\mathrm{odd}(x) = (f(x) – f(-x))/2$, and its even part is the function $f^\mathrm{even} : \{-1,1\}^n \to {\mathbb R}$ defined by $f^\mathrm{even}(x) = (f(x) + f(-x))/2$.

Express $\widehat{f^\dagger}(S)$ in terms of $\widehat{f}(S)$.

Verify that $f = f^\mathrm{odd} + f^\mathrm{even}$ and that $f$ is odd (respectively, even) if and only if $f = f^\mathrm{odd}$ (respectively, $f = f^\mathrm{even}$).

Show that this representation is unique. (Hint: if $q$ as in \eqref{eqn:zotzo-poly} has at least one nonzero coefficient, consider $q(a)$ where $a \in \{0,1\}^n$ is the indicator vector of a minimal $S$ with $c_S \neq 0$.)

Show that all coefficients $c_S$ in the representation \eqref{eqn:zotzo-poly} will be integers in the range $[-2^n, 2^n]$.

Let’s index the rows and columns of $H_{2^n}$ by the integers $\{0, 1, 2, \dots, 2^n-1\}$ rather than $[2^n]$. Further, let’s identify such an integer $i$ with its binary expansion $(i_0, i_1, \dots, i_{n-1}) \in {\mathbb F}_2^n$, where $i_0$ is the least significant bit and $i_{n-1}$ the most. E.g., if $n = 3$, we identify the index $i = 6$ with $(0, 1, 1)$. Now show that the $(\gamma, x)$ entry of $H_{2^n}$ is $(-1)^{\gamma \cdot x}$.

Show that if $f : {\mathbb F}_2^n \to {\mathbb R}$ is represented as a column vector in ${\mathbb R}^{2^n}$ (according to the indexing scheme from part (a)) then $2^{-n} H_{2^n} f = \widehat{f}$. Here we think of $\widehat{f}$ as also being a function ${\mathbb F}_2^n \to {\mathbb R}$, identifying subsets $S \subseteq \{0, 1, \dots, n-1\}$ with their indicator vectors.

Show how to compute $H_{2^n} f$ using just $n 2^n$ additions and subtractions (rather than $2^{2n}$ additions and subtractions as the usual matrix-vector multiplication algorithm would require). This computation is called the Fast Walsh–Hadamard Transform and is the method of choice for computing the Fourier expansion of a generic function $f : {\mathbb F}_2^n \to {\mathbb R}$ when $n$ is large.

Show that taking the Fourier transform is essentially an “involution”: $\widehat{\widehat{f}} = 2^{-n} f$ (using the notations from part (b)).

Suppose an algorithm is given query access to a linear function $f : {\mathbb F}_2^n \to {\mathbb F}_2$ and its task is to determine which linear function $f$ is. Show that querying $f$ on $n$ inputs is necessary and sufficient.

Give a $4$-query test for a function $f : {\mathbb F}_2^n \to {\mathbb F}_2$ with the following property: if the test accepts with probability $1-\epsilon$ then $f$ is $\epsilon$-close to being affine. All four query inputs should have the uniform distribution on ${\mathbb F}_2^n$ (but of course need not be independent).

Give an alternate $4$-query test for being affine in which three of the query inputs are uniformly distributed and the fourth is non-random. (Hint: show that $f$ is affine if and only if $f(x) + f(y) + f(0) = f(x+y)$ for all $x, y \in {\mathbb F}_2^n$.)

Show that $\widehat{f^{\pi}}(S) = \widehat{f}(\pi^{-1}(S))$ for all $S \subseteq [n]$.

For future reference, when we write $(\widehat{f}(S))_{|S|=k}$, we mean the sequence of degree-$k$ Fourier coefficients of $f$, listed in lexicographic order of the $k$-sets $S$.

Given complete truth tables of some $g$ and $h$ we might wish to determine whether they are isomorphic. One way to do this would be to define a canonical form $\text{can}(f) : \{-1,1\}^n \to \{-1,1\}$ for each $f : \{-1,1\}^n \to \{-1,1\}$, meaning that: (i) $\text{can}(f)$ is isomorphic to $f$; (ii) if $g$ is isomorphic to $h$ then $\text{can}(g) = \text{can}(h)$. Then we can determine whether $g$ is isomorphic to $h$ by checking whether $\text{can}(g) = \text{can}(h)$. Here is one possible way to define a canonical form for $f$:

Set $P_0 = S_n$.

For each $k = 1, 2, 3, \dots, n$,

Define $P_k$ to be the set of all $\pi \in P_{k-1}$ which make the sequence $(\widehat{f^\pi}(S))_{|S|=k}$ maximal in lexicographic order on ${\mathbb R}^{\binom{n}{k}}$.

Let $\text{can}(f) = f^{\pi}$ for (any) $\pi \in P_n$.

Show that this is well-defined, meaning that $\text{can}(f)$ is the same function for any choice of $\pi \in P_n$.

Show that $\text{can}(f)$ is indeed a canonical form; i.e., it satisfies (i) and (ii) above.

Show that if $\widehat{f}(\{1\}), \dots, \widehat{f}(\{n\})$ are distinct numbers then $\text{can}(f)$ can be computed in $\widetilde{O}(2^n)$ time.

We could more generally consider $g, h : \{-1,1\}^n \to \{-1,1\}$ to be isomorphic if $g(x) = h(\pm x_{\pi(1)}, \dots, \pm x_{\pi(n)})$ for some permutation $\pi$ on $[n]$ and some choice of signs. Extend the results of this exercise to handle this definition.

Thanks Tengyu! Please keep corrections like this coming — due to the way my TeX->blog workflow works, I have to fix all references to exercise numbers (and inter-chapter references) by hand. So it’s very error-prone and I need to catch the mistakes.

Hi, this is a remark about exercise 1.20 in the book, which I can’t find here.
I think the right statement is
$Var[f^2] = 2 \sum_{i\neq j}{\hat{f}(i)^2 \hat{f}(j)^2}$.
Take for example $f(x) = (x_1 +x_2)/2$,
then LHS is $1/4$ and RHS is $2 \cdot (1/16+1/16)$ which is OK.

Great catch — you are correct! This exercise actually makes an appearance (silently on the blog, explicitly in the final book) in the proof of the FKN Theorem in Chapter 9.1. Your fix actually improves the constant there from 6402 to 3202