betaFeedback

WorksMathematics

Sensitivity of Rotation Symmetric Boolean Functions via Binary Necklaces

Abstract

Rotation symmetric Boolean functions are important structured families in the theory of Boolean functions, where cyclic invariance permits compact algebraic descriptions while retaining nontrivial local behavior. We investigate their sensitivity through binary necklaces and monomial orbit sums. In the necklace quotient of the Boolean cube, ordinary adjacency does not record the number of coordinate flips: we give a directed flip-multiplicity formula involving stabilizers and distance-two near-periods, and derive exact local sensitivity formulas when the number of variables is an odd prime. For monomial rotation symmetric functions we determine sensitivity for all odd degrees and for quadratic orbit sums. For the consecutive-monomial family of every even degree d≥4d\ge4, we prove a run-cluster inequality and obtain the eventual exact formula s(Fd,n)=n−min⁡{r,d+2−r}s(F_{d,n})=n-\min\{r,d+2-r\}, where n≡r(modd+2)n\equiv r\pmod{d+2}, under the stated length hypothesis. The consecutive quartic case follows explicitly. We also evaluate sensitivity for cyclic run-threshold functions. Our results provide exact combinatorial and complexity-theoretic information about cyclic Boolean functions and clarify how cyclic symmetry governs local sensitivity.

Introduction

Boolean-function viewpoint and scope. Rotation symmetric Boolean functions form a central class of cyclically invariant functions studied in algebraic and combinatorial approaches to Boolean-function theory, including in cryptographic settings. This article considers an intrinsic local-complexity invariant of these functions: sensitivity. We derive exact sensitivity formulas from binary-necklace multiplicities, stabilizers, near-period structure, and cyclic run decompositions. These results contribute to the structural analysis of Boolean functions with cyclic symmetry, a topic at the intersection of discrete mathematics and Boolean-function theory.

Contributions and prior methods. The binary-necklace quotient and near-period phenomena were studied previously; our contribution is not the construction of that quotient. We give an explicit directed flip-count formula and identify the resulting local sensitivity corrections. Independently, our run-cluster argument treats a whole infinite family of even-degree consecutive monomial orbit sums.

2020 Mathematics Subject Classification. Primary 05E18; Secondary 94D10.

This separation between inherited combinatorial tools and our new exact sensitivity deductions is important for assessing the novelty of the paper.

Relation to the earlier arXiv version. This manuscript is an expanded and revised version of our preprint Sensitivity of Rotation Symmetric Boolean Functions via Binary Necklaces (arXiv:2610.17006, 2026; https://arxiv.org/abs/2610.17006). The earlier posting and the present submission are versions of the same research work, not separate papers. The present version develops the analysis further, in particular by including the uniform run-cluster treatment and the general even-degree consecutive-monomial sensitivity result, together with expanded proofs and exposition. The results already contained in the earlier version are retained as part of the present work.

Complexity-theoretic perspective. Sensitivity measures the number of one-bit queries at which an input is locally pivotal. Its exact value is generally difficult to extract even for Boolean functions with a large automorphism group: symmetry reduces the number of inequivalent inputs but does not preserve the multiplicity of coordinate flips between orbits. Rotation symmetry is a particularly tractable test case because the underlying action is transitive on coordinates without being the full symmetric group. Our objective is to compute this local complexity measure for explicit cyclically invariant families, rather than to deduce new general inequalities between complexity measures. In particular, the structural formulas below are exact, not merely asymptotic bounds.

For a Boolean function f:{0,1}n→{0,1}f:\{0,1\}^{n}\to\{0,1\} and an input xx, the sensitivity s(f,x)s(f,x) is the number of coordinates whose individual flip changes the value of ff, and

s(f)=max⁡x∈{0,1}ns(f,x).s(f)=\max_{x\in\{0,1\}^{n}}s(f,x).

We also write

sb(f)=max⁡{s(f,x):f(x)=b},b∈{0,1}.s_b(f)=\max\{s(f,x):f(x)=b\},\qquad b\in\{0,1\}.

Sensitivity is one of the basic local complexity measures of Boolean functions and has been extensively studied in relation to symmetry, transitivity, block sensitivity, and decision-tree complexity.

A Boolean function is rotation symmetric if it is invariant under the cyclic permutation of its coordinates. Writing

Rk(x0,x1,…,xn−1)=(x−k,x1−k,…,xn−1−k),R_k(x_0,x_1,\ldots,x_{n-1})=(x_{-k},x_{1-k},\ldots,x_{n-1-k}),

with indices in Zn\mathbb{Z}_n, this means

f(Rkx)=f(x)for every x∈{0,1}n and k∈Zn.f(R_kx)=f(x)\qquad\text{for every }x\in\{0,1\}^{n}\text{ and }k\in\mathbb{Z}_n.

The orbit

[x]={Rkx:k∈Zn}[x]=\{R_kx:k\in\mathbb{Z}_n\}

is a binary necklace. Thus a rotation symmetric Boolean function is equivalently a two-coloring of the set of binary necklaces of length nn. Rotation symmetric Boolean functions have a substantial literature, particularly in cryptography and in the study of transitive Boolean functions; see, for example, Stănică and Maitra [9]. Chakraborty [1] studied sensitivity for cyclically invariant Boolean functions and obtained asymptotic constructions and lower bounds.

The combinatorics of binary necklaces gives a natural way to record the effect of coordinate flips modulo rotation. Earlier work on necklace quotients and Gray codes studies their flip adjacency [6]; distance-two rotations have been classified by Makhynko [8]. Neither the necklace quotient nor this distance-two classification is claimed as new here. Our contribution to the previously studied necklace quotient is an explicit stabilizer/near-period formula for directed flip multiplicities and its applications to exact local sensitivity. This differs from the asymptotic sensitivity questions for cyclically invariant functions studied by Chakraborty [1].

Building on the established necklace quotient viewpoint, our first purpose is to develop an exact necklace-level description of sensitivity. The quotient of the Boolean cube by rotation is naturally a multigraph: if X=[x]X=[x] and YY are necklaces, the directed multiplicity

m(X,Y)=∣{i∈Zn:[x(i)]=Y}∣m(X,Y)=\left|\left\{i\in\mathbb{Z}_n:[x^{(i)}]=Y\right\}\right|

counts the one-coordinate flips of a representative of XX that land in YY. Such flip multiplicities in the necklace quotient are already present in the combinatorial literature; see Gregor et al. [6]. If fˉ\bar{f} denotes the induced Boolean function on necklaces, then the local sensitivity at XX is the weighted bichromatic degree

s(f,X)=∑fˉ(Y)≠fˉ(X)m(X,Y).s(f,X)=\sum_{\bar{f}(Y)\ne\bar{f}(X)}m(X,Y).

The main issue is therefore to determine the multiplicities m(X,Y)m(X,Y) structurally.

For x∈{0,1}nx\in\{0,1\}^{n}, let

Hx=Stab⁡(x)={Rk:Rkx=x},hx=∣Hx∣.H_x=\operatorname{Stab}(x)=\{R_k:R_kx=x\},\qquad h_x=|H_x|.

where Stab⁡(x)\operatorname{Stab}(x) denotes the subgroup of cyclic rotations that fix xx. Let

Dk(x)={j:xj≠(Rkx)j}.D_k(x)=\{j:x_j\ne(R_kx)_j\}.

For a coordinate ii, define

qi(x)=#{k:∣Dk(x)∣=2, i+k∈Dk(x)}.q_i(x)=\#\{k:|D_k(x)|=2,\ i+k\in D_k(x)\}.

Our first main formula is

m([x],[x(i)])=hx+qi(x)hx(i).m([x],[x^{(i)}])=\frac{h_x+q_i(x)}{h_{x^{(i)}}}.

It follows from an orbit–stabilizer double count and separates the multiplicity into exact rotational symmetry and distance-two near-periodicity. Rotations at Hamming distance two have recently been classified in detail by Makhynko [8]; we use that structure rather than claim it as new.

When n=pn=p is an odd prime, the formula simplifies substantially. Every nonconstant length-pp word has trivial rotational stabilizer, and the relevant distance-two necklaces are cyclic arithmetic intervals. We show that interior necklace multiplicities are 1 or 2 and obtain explicit local sensitivity formulas for every Hamming layer, including the exceptional weight-one and weight-(p−1)(p-1) layers. Moreover, the multiplicity correction is required only for an asymptotically negligible set of necklaces: using Makhynko’s enumeration, the exceptional proportion is

O(p32p).O\left(\frac{p^3}{2^p}\right).

Thus for asymptotically almost every prime-length necklace, local sensitivity is simply its ordinary bichromatic degree in the unweighted necklace quotient.

We also study monomial rotation symmetric functions across degrees. If the generating monomial has support AA, degree dd, and rotational stabilizer of order hh, then every coordinate occurs in exactly d/hd/h distinct orbit monomials. This yields a parity theorem at the all-one input and, in particular, the general conclusion

every odd-degree MRS function has s(f)=n.\text{every odd-degree MRS function has }s(f)=n.

Thus the genuinely nontrivial degree-by-degree problem begins with even degree. We solve degree two completely. If Qn,kQ_{n,k} is generated by x0xkx_0x_k and we are outside the short-orbit case nn even, k=n/2k=n/2, then with

g=gcd⁡(n,2k),L=n/g,g=\gcd(n,2k),\qquad L=n/g,

we prove

s(Qn,k)={n,L even,n−g,L odd.s(Q_{n,k})= \begin{cases} n, & L\text{ even},\\ n-g, & L\text{ odd}. \end{cases}

The proof reduces sensitivity to the maximum number of transitions on the cycles of the permutation j↦j+2kj\mapsto j+2k. In particular, for every odd prime pp, all quadratic MRS functions have sensitivity p−1p-1.

For every even degree d≥4d\ge4, we prove that the consecutive monomial family has sensitivity n−min⁡{r,d+2−r}n-\min\{r,d+2-r\} when n≡r(modd+2)n\equiv r\pmod{d+2} and nn is sufficiently large. The proof uses a universal charging inequality for clusters of short one-runs, with no restriction on the number of defects. We do not attempt to classify all quartic monomial rotation symmetric functions. Instead, we completely solve the natural consecutive quartic family generated by x0x1x2x3x_0x_1x_2x_3:

Rn=⨁ixixi+1xi+2xi+3.R_n=\bigoplus_i x_ix_{i+1}x_{i+2}x_{i+3}.

For n≥5n\ge5, writing n=6q+rn=6q+r, we prove

s(Rn)=n−min⁡{r,6−r}.s(R_n)=n-\min\{r,6-r\}.

The general even-degree theorem gives a direct proof of the formula. In particular, although the all-one input has zero sensitivity in this even-degree family, maximum sensitivity nn is attained whenever 6∣n6\mid n.

A further application concerns the cyclic run-threshold function Fn,r(x)F_{n,r}(x), which is 1 exactly when xx contains a cyclic run of at least rr ones. For 2≤r≤n2\le r\le n we prove

s1(Fn,r)=r,s0(Fn,r)=⌈2nr+1⌉.s_1(F_{n,r})=r,\qquad s_0(F_{n,r})=\left\lceil\frac{2n}{r+1}\right\rceil.

This exact two-parameter result complements prior sensitivity bounds for transitive Boolean functions [2]; we do not claim that the general transitive-function framework is new.

Novelty and relationship with related work. There are three distinctions worth making. First, the weighted necklace viewpoint is standard, whereas the stabilizer/near-period formula and its local-sensitivity consequences are the claims advanced here. Second, we apply Makhynko’s structural classification and enumeration of distance-two rotations [8]; those structural and enumerative results are credited to that work. Third, our companion preprint on block sensitivity and certificate complexity of rotation symmetric Boolean functions [7] treats different complexity measures. That companion work restates the odd-degree and quadratic sensitivity formulas for comparison with block sensitivity and certificate complexity, and cites the consecutive quartic sensitivity theorem proved here. The present work supplies the sensitivity proofs, while the companion focuses on the other two complexity measures. We include the sensitivity arguments in the present paper to keep its main results self-contained; no novelty claim rests on reproducing the same formulas in both manuscripts. The distinguishing contributions of the present paper are the weighted-necklace multiplicity framework, the odd-prime local sensitivity analysis, the universal even-degree consecutive-monomial theorem, the consecutive quartic corollary, and the exact run-threshold formulas. Conversely, general block sensitivity and certificate-complexity formulas are not claimed here.

Contribution map and limitations. The results have two independent components. The first is a formula for the weighted edges of the cyclic quotient of the hypercube, followed by prime-length local formulas; this is useful whenever the truth values of a rotation symmetric function are specified by necklaces. The second consists of exact maximum-sensitivity calculations for explicitly defined function families, with the even-degree consecutive-monomial result depending on a uniform combinatorial charging argument. The general weighted-quotient construction itself, previously known distance-two rotation classifications, and general sensitivity inequalities are not claimed as new. These exact calculations do not by themselves imply improved universal lower bounds for all transitive Boolean functions or new separations of sensitivity from other complexity measures.

The paper is organized as follows. Section 2 develops the necklace formulation of sensitivity, Section 3 studies rotations at Hamming distance two, and Section 4 proves the general multiplicity formula. Section 5 treats the prime-length near-period structure, while Section 6 derives the odd-prime sensitivity formulas and generic-simplicity consequences. Section 7 studies monomial rotation symmetric functions, including odd-degree and quadratic cases, a general consecutive even-degree theorem, and the consecutive quartic corollary. Section 8 establishes the exact cyclic run-threshold formula. Section 9 records computational verification, Section 10 presents further questions.

Preliminaries

Throughout, coordinates are indexed by Zn\mathbb{Z}_n, and all additions of coordinate indices are taken modulo nn. Identify coordinates with Zn\mathbb{Z}_n. Let RkR_k be rotation by kk. For x∈{0,1}nx \in\{0,1\}^n, let [x]={Rkx:k∈Zn}[x] = \{R_kx : k \in\mathbb{Z}_n\} and let Nn\mathcal{N}_n be the set of necklaces. Let x(i)x^{(i)} denote xx with coordinate ii flipped. Then

s(f,x)=∣{i:f(x)≠f(x(i))}∣,s(f)=max⁡xs(f,x).s(f,x) = \left|\{i : f(x) \ne f(x^{(i)})\}\right|,\qquad s(f) = \max_x s(f,x).

For rotation symmetric ff, write fˉ([x])=f(x)\bar{f}([x]) = f(x). Since rotation merely permutes the coordinate positions, s(f,Rkx)=s(f,x)s(f,R_kx) = s(f,x) for every k∈Znk \in\mathbb{Z}_n. Hence sensitivity is constant on each necklace. For a necklace X=[x]X = [x], we therefore define

s(f,X):=s(f,x),s(f,X) := s(f,x),

which is independent of the choice of representative x∈Xx \in X. For necklaces X=[x]X = [x] and YY, define

m(X,Y)=∣{i∈Zn:[x(i)]=Y}∣.m(X,Y) = \left|\{i \in\mathbb{Z}_n : [x^{(i)}] = Y\}\right|.

Lemma 2.1. The quantity m(X,Y)m(X,Y) is independent of the representative xx of XX.

Proof. If x′=Rkxx' = R_kx, then Rk(x(i))=(Rkx)(i+k)R_k(x^{(i)}) = (R_kx)^{(i+k)}, and i↦i+ki \mapsto i+k is a bijection.

Theorem 2.2 (Necklace sensitivity formula). For every necklace XX,

s(f,X)=∑fˉ(Y)≠fˉ(X)m(X,Y),s(f)=max⁡X∑fˉ(Y)≠fˉ(X)m(X,Y).s(f,X) = \sum_{\bar{f}(Y)\ne\bar{f}(X)} m(X,Y),\qquad s(f) = \max_X \sum_{\bar{f}(Y)\ne\bar{f}(X)} m(X,Y).

Proof. Partition the sensitive coordinates according to the necklace reached by their flip.

Periods and near-periods

For xx and k∈Znk \in\mathbb{Z}_n, define Dk(x)={r:xr≠(Rkx)r}D_k(x)=\{r:x_r\ne(R_kx)_r\}.

Theorem 3.1 (Flip-equivalence criterion). For i,j∈Zni,j\in\mathbb{Z}_n, [x(i)]=[x(j)][x^{(i)}]=[x^{(j)}] iff for some kk, either (i) Rkx=xR_kx=x and j=i+kj=i+k, or (ii) ∣Dk(x)∣=2|D_k(x)|=2 and Dk(x)={j,i+k}D_k(x)=\{j,i+k\}.

Proof. Suppose first that [x(i)]=[x(j)][x^{(i)}]=[x^{(j)}]. By the definition of a necklace, there is some k∈Znk\in\mathbb{Z}_n such that

Rk(x(i))=x(j).R_k(x^{(i)})=x^{(j)}.

Rotation carries the flip at coordinate ii to a flip at coordinate i+ki+k; that is,

Rk(x(i))=(Rkx)(i+k).R_k(x^{(i)})=(R_kx)^{(i+k)}.

Hence

(Rkx)(i+k)=x(j),(R_kx)^{(i+k)}=x^{(j)},

and, after flipping coordinate i+ki+k on both sides,

Rkx=(x(j))(i+k).R_kx=(x^{(j)})^{(i+k)}.

There are now two cases.

If j=i+kj=i+k, the two flips on the right occur at the same coordinate and therefore cancel. Thus

Rkx=x,R_kx=x,

so RkR_k stabilizes xx, and j=i+kj=i+k. This is alternative (i).

If j≠i+kj\ne i+k, then the two flips occur at distinct coordinates. Consequently (x(j))(i+k)(x^{(j)})^{(i+k)} differs from xx exactly at the two coordinates jj and i+ki+k. Therefore

Dk(x)={r:xr≠(Rkx)r}={j,i+k},D_k(x)=\{r:x_r\ne(R_kx)_r\}=\{j,i+k\},

so ∣Dk(x)∣=2|D_k(x)|=2. This is alternative (ii).

Conversely, suppose that alternative (i) holds. Then Rkx=xR_kx=x and j=i+kj=i+k, so

Rk(x(i))=(Rkx)(i+k)=x(j).R_k(x^{(i)})=(R_kx)^{(i+k)}=x^{(j)}.

Hence [x(i)]=[x(j)][x^{(i)}]=[x^{(j)}].

Finally, suppose that alternative (ii) holds. Since

Dk(x)={j,i+k},D_k(x)=\{j,i+k\},

the word RkxR_kx is obtained from xx by flipping exactly those two coordinates; equivalently,

Rkx=(x(j))(i+k).R_kx=(x^{(j)})^{(i+k)}.

Flipping coordinate i+ki+k gives

Rk(x(i))=(Rkx)(i+k)=x(j),R_k(x^{(i)})=(R_kx)^{(i+k)}=x^{(j)},

and again [x(i)]=[x(j)][x^{(i)}]=[x^{(j)}]. Thus the two stated alternatives are both necessary and sufficient. □

Call nonzero kk a 2-near-period if ∣Dk(x)∣=2|D_k(x)|=2.

Theorem 3.2 (Distance-two rotation structure; Makhynko [8]). Fix k≠0k \ne0, put d=gcd⁡(n,k)d = \gcd(n,k) and L=n/dL = n/d. The permutation r↦r+kr \mapsto r + k has dd cycles of length LL. Then ∣Dk(x)∣=2|D_k(x)| = 2 iff xx is constant on d−1d - 1 cycles and, on the remaining cycle, has one nonempty proper consecutive arc of ones and one of zeros; equivalently its cyclic pattern is 1a0L−a1^a0^{L-a}, 1≤a≤L−11 \le a \le L - 1.

Proof. This is the prescribed-shift one-active-cycle structure appearing in [8]; we include the argument for completeness.

The permutation r↦r+kr \mapsto r + k decomposes Zn\mathbb{Z}_n into d=gcd⁡(n,k)d = \gcd(n,k) disjoint cycles, each of length L=n/dL = n/d. Fix one such cycle and write it in cyclic order as

C=(r,r+k,r+2k,…,r+(L−1)k),C = (r, r + k, r + 2k, \ldots, r + (L - 1)k),

where all indices are taken modulo nn. By definition,

r+tk∈Dk(x)⟺xr+tk≠xr+(t−1)k,r + tk \in D_k(x) \Longleftrightarrow x_{r+tk} \ne x_{r+(t-1)k},

with tt interpreted modulo LL. Hence the number of elements of Dk(x)D_k(x) lying on CC is exactly the number of transitions between 0 and 1 in the cyclic binary word

xr,xr+k,xr+2k,…,xr+(L−1)k.x_r, x_{r+k}, x_{r+2k}, \ldots, x_{r+(L-1)k}.

With our convention (Rkx)r=xr−k(R_kx)_r = x_{r-k}, the disagreement at rr compares xrx_r with xr−kx_{r-k}. Along a kk-cycle this is a transition from the preceding entry, rather than the following one. Both conventions count the same transitions; we use the preceding-entry convention throughout.

A cyclic binary word has an even number of transitions. Indeed, whenever the value changes from 0 to 1, it must later change from 1 back to 0 before returning to the starting position. Thus a cycle contributes either 0 or at least 2 elements to Dk(x)D_k(x). Moreover, it contributes 0 precisely when xx is constant on that cycle.

Suppose now that ∣Dk(x)∣=2|D_k(x)| = 2. Since the cycles are disjoint and every cycle contributes an even nonnegative number of disagreements, exactly one cycle contributes 2, while each of the remaining d−1d - 1 cycles contributes 0. Therefore xx is constant on those d−1d - 1 cycles. On the unique active cycle there are exactly two transitions. Starting immediately after one of them, all the 1’s occur consecutively until the second transition, and all the remaining entries are 0’s. Since both transitions occur, both symbols appear. Consequently, after a cyclic choice of starting point, the pattern on this cycle is

1a0L−afor some 1≤a≤L−1.1^a0^{L-a} \qquad\text{for some } 1 \le a \le L - 1.

Equivalently, the 1’s form one nonempty proper consecutive arc of the cycle and the 0’s form the complementary arc.

Conversely, suppose that xx is constant on d−1d - 1 cycles and that on the remaining cycle its cyclic pattern is 1a0L−a1^a0^{L-a} with 1≤a≤L−11 \le a \le L - 1. Each constant cycle contributes no element to Dk(x)D_k(x), while the active cycle has exactly two transitions, one from 1 to 0 and one from 0 to 1. Hence that cycle contributes exactly two elements to Dk(x)D_k(x), and therefore ∣Dk(x)∣=2|D_k(x)| = 2. □

The multiplicity formula

Let

Hx=Stab⁡(x)={Rk:Rkx=x},hx=∣Hx∣,H_x = \operatorname{Stab}(x) = \{R_k : R_kx = x\}, \qquad h_x = |H_x|,

where Stab⁡(x)\operatorname{Stab}(x) denotes the subgroup of cyclic rotations that fix xx. Define

qi(x)=#{k:∣Dk(x)∣=2, i+k∈Dk(x)}.q_i(x) = \#\{k : |D_k(x)| = 2,\ i + k \in D_k(x)\}.

Theorem 4.1 (Multiplicity formula). If X=[x]X=[x] and Y=[x(i)]Y=[x^{(i)}], then

m(X,Y)=hx+qi(x)hx(i).m(X,Y)=\frac{h_x+q_i(x)}{h_{x^{(i)}}}.

Hence hx(i)∣hx+qi(x)h_{x^{(i)}}\mid h_x+q_i(x).

Proof. Set y=x(i)y=x^{(i)}, so that Y=[y]Y=[y], and consider

Pi={(Rk,j)∈⟨R1⟩×Zn:Rk(x(i))=x(j)}.\mathcal{P}_i=\{(R_k,j)\in\langle R_1\rangle\times\mathbb{Z}_n:R_k(x^{(i)})=x^{(j)}\}.

We count ∣Pi∣|\mathcal{P}_i| in two ways.

First fix jj. There exists a rotation RkR_k with Rk(x(i))=x(j)R_k(x^{(i)})=x^{(j)} if and only if [x(j)]=[x(i)]=Y[x^{(j)}]=[x^{(i)}]=Y. By the definition of m(X,Y)m(X,Y), there are exactly m(X,Y)m(X,Y) such coordinates jj. For each such jj, choose one rotation Rk0R_{k_0} satisfying Rk0y=x(j)R_{k_0}y=x^{(j)}. Then

Rky=x(j)⟺Rk0−1Rky=y.R_ky=x^{(j)}\quad\Longleftrightarrow\quad R_{k_0}^{-1}R_ky=y.

Thus the rotations carrying yy to x(j)x^{(j)} form a coset of Hy=Stab⁡(y)H_y=\operatorname{Stab}(y) and hence there are exactly hy=hx(i)h_y=h_{x^{(i)}} of them. Consequently,

∣Pi∣=m(X,Y)hx(i).|\mathcal{P}_i|=m(X,Y)h_{x^{(i)}}.

We now count by fixing the rotation RkR_k. Since rotation carries a flip at ii to a flip at i+ki+k,

Rk(x(i))=(Rkx)(i+k).R_k(x^{(i)})=(R_kx)^{(i+k)}.

Hence a coordinate jj with Rk(x(i))=x(j)R_k(x^{(i)})=x^{(j)} exists precisely when

(Rkx)(i+k)=x(j).(R_kx)^{(i+k)}=x^{(j)}.

If Rkx=xR_kx=x, then this equality holds with the unique choice j=i+kj=i+k. Therefore every stabilizing rotation contributes exactly one pair to Pi\mathcal{P}_i, for a total contribution of hxh_x.

Suppose next that Rkx≠xR_kx\ne x. The flip-equivalence criterion from Theorem 3.1 shows that the above equality can hold only when

∣Dk(x)∣=2andi+k∈Dk(x).|D_k(x)|=2\quad\text{and}\quad i+k\in D_k(x).

Indeed, if Dk(x)={i+k,j}D_k(x)=\{i+k,j\}, then flipping i+ki+k in RkxR_kx removes one of the two disagreements with xx, and flipping jj in xx removes the other, giving

(Rkx)(i+k)=x(j).(R_kx)^{(i+k)}=x^{(j)}.

Conversely, if (Rkx)(i+k)=x(j)(R_kx)^{(i+k)}=x^{(j)} and Rkx≠xR_kx\ne x, then RkxR_kx and xx can differ only at the two coordinates i+ki+k and jj; hence Dk(x)={i+k,j}D_k(x)=\{i+k,j\} and ∣Dk(x)∣=2|D_k(x)|=2. Thus the nonstabilizing rotations that contribute to Pi\mathcal{P}_i are exactly those counted by qi(x)q_i(x), and each contributes exactly one pair. Therefore

∣Pi∣=hx+qi(x).|\mathcal{P}_i|=h_x+q_i(x).

Equating the two counts gives

m(X,Y)hx(i)=hx+qi(x),m(X,Y)h_{x^{(i)}}=h_x+q_i(x),

and hence

m(X,Y)=hx+qi(x)hx(i).m(X,Y)=\frac{h_x+q_i(x)}{h_{x^{(i)}}}.

Since m(X,Y)m(X,Y) is an integer, it follows immediately that hx(i)∣hx+qi(x)h_{x^{(i)}}\mid h_x+q_i(x).

Proposition 4.2 (Balance identity). For adjacent necklaces XX and YY,

∣X∣m(X,Y)=∣Y∣m(Y,X).|X|m(X,Y) = |Y|m(Y,X).

Proof. Let E(X,Y)E(X,Y) be the set of edges of the nn-dimensional hypercube having one endpoint in the orbit XX and the other endpoint in the orbit YY. We count ∣E(X,Y)∣|E(X,Y)| in two ways.

First fix a word x∈Xx \in X. By definition, m(X,Y)m(X,Y) is the number of coordinates ii for which the one-coordinate flip x(i)x^{(i)} belongs to YY. This number is independent of the chosen representative of XX. Indeed, if x′=Rkxx' = R_kx, then rotation commutes with a coordinate flip in the sense that

(Rkx)(i+k)=Rk(x(i)),(R_kx)^{(i+k)} = R_k(x^{(i)}),

with indices taken modulo nn. Since YY is itself a rotation orbit, x(i)∈Yx^{(i)} \in Y if and only if (Rkx)(i+k)∈Y(R_kx)^{(i+k)} \in Y. Thus every vertex of XX is incident with exactly m(X,Y)m(X,Y) edges whose other endpoint lies in YY.

Consequently, counting the edges of E(X,Y)E(X,Y) from their endpoints in XX gives

∣E(X,Y)∣=∣X∣m(X,Y).|E(X,Y)| = |X|m(X,Y).

The same argument with the roles of XX and YY reversed shows that every vertex of YY is incident with exactly m(Y,X)m(Y,X) edges whose other endpoint lies in XX. Hence

∣E(X,Y)∣=∣Y∣m(Y,X).|E(X,Y)| = |Y|m(Y,X).

Equating the two expressions for the same set of hypercube edges yields

∣X∣m(X,Y)=∣Y∣m(Y,X),|X|m(X,Y) = |Y|m(Y,X),

as claimed.

Odd prime length

Throughout Sections 5 and 6, assume pp is an odd prime. (The case p=2p = 2 is immediate and may be checked separately.) Every nonconstant word of length pp is aperiodic. Makhynko’s prime-length classification shows that the distance-two necklaces are represented by cyclic arithmetic intervals [8]. We record the following elementary uniqueness lemma because it isolates the precise step property needed in the sensitivity arguments below.

Lemma 5.1 (Uniqueness of the step). Let I={0,1,…,w−1}⊆ZpI = \{0, 1, \ldots, w - 1\} \subseteq\mathbb{Z}_p, 2≤w≤p−22 \leq w \leq p - 2. If I={b,b+r,…,b+(w−1)r}I = \{b, b + r, \ldots, b + (w - 1)r\} with r≠0r \ne0, then r=±1(modp)r = \pm1 \pmod p.

Proof. Put

J:={b,b+r,…,b+(w−1)r}⊆Zp.J := \{b, b + r, \ldots, b + (w - 1)r\} \subseteq\mathbb{Z}_p.

By hypothesis, J=IJ = I, where I={0,1,…,w−1}I = \{0, 1, \ldots, w - 1\}. In the rr-arithmetic ordering of JJ, translation by rr sends

b,b+r,…,b+(w−2)rb, b + r, \ldots, b + (w - 2)r

to the next w−1w - 1 elements

b+r,b+2r,…,b+(w−1)r.b + r, b + 2r, \ldots, b + (w - 1)r.

The only additional point of J+rJ + r is b+wrb + wr, which does not lie in JJ: otherwise wr≡jr(modp)wr \equiv jr \pmod p for some 0≤j≤w−10 \leq j \leq w - 1, contradicting r≠0r \ne0 and w<pw < p. Hence

∣J∩(J+r)∣=w−1.|J \cap(J + r)| = w - 1.

Since J=IJ=I, this gives

∣I∩(I+r)∣=w−1.|I \cap(I+r)|=w-1.

We now use the special form I={0,1,…,w−1}I=\{0,1,\ldots,w-1\} to determine rr. Choose the integer representative 1≤r≤p−11\le r\le p-1.

First suppose 1≤r≤p−w1\le r\le p-w. Then the translate I+rI+r does not wrap around modulo pp, so

I+r={r,r+1,…,r+w−1}.I+r=\{r,r+1,\ldots,r+w-1\}.

If r≥wr\ge w, then I∩(I+r)=∅I\cap(I+r)=\varnothing, contradicting ∣I∩(I+r)∣=w−1|I\cap(I+r)|=w-1. Thus 1≤r<w1\le r<w, and in this case

∣I∩(I+r)∣=w−r.|I\cap(I+r)|=w-r.

Therefore w−r=w−1w-r=w-1, and hence r=1r=1.

It remains to consider p−w<r≤p−1p-w<r\le p-1. Set s=p−rs=p-r, so 1≤s<w1\le s<w and r≡−s(modp)r\equiv-s\pmod p. Thus I+r=I−sI+r=I-s in Zp\mathbb{Z}_p. The intersection may have two contributions: the unwrapped portion contributes w−sw-s elements, and the wrapped portion contributes max⁡{0,w+s−p}\max\{0,w+s-p\} elements. Thus

∣I∩(I+r)∣=∣I∩(I−s)∣=(w−s)+max⁡{0,w+s−p}.|I\cap(I+r)|=|I\cap(I-s)|=(w-s)+\max\{0,w+s-p\}.

If w+s≤pw+s\le p, the equality ∣I∩(I+r)∣=w−1|I\cap(I+r)|=w-1 yields w−s=w−1w-s=w-1, hence s=1s=1. If w+s>pw+s>p, the equality becomes 2w−p=w−12w-p=w-1, which forces w=p−1w=p-1, contrary to w≤p−2w\le p-2. Therefore only s=1s=1 is possible, giving r=p−1≡−1(modp)r=p-1\equiv-1\pmod p.

Consequently r≡±1(modp)r\equiv\pm1\pmod p, as claimed.

Corollary 5.2 (Prime arithmetic-interval uniqueness). If 2≤∣S∣=w≤p−22\le|S|=w\le p-2 and SS has arithmetic-progression representations with nonzero steps kk and ℓ\ell, then ℓ=±k\ell=\pm k.

Proof. Write the two representations as

S={a,a+k,…,a+(w−1)k}={b,b+ℓ,…,b+(w−1)ℓ}⊆Zp.S=\{a,a+k,\ldots,a+(w-1)k\}=\{b,b+\ell,\ldots,b+(w-1)\ell\}\subseteq\mathbb{Z}_p.

Since k≠0k\ne0 and pp is prime, kk is invertible modulo pp. Apply the invertible affine map

ϕ(z)=k−1(z−a).\phi(z)=k^{-1}(z-a).

The first representation is carried to the standard interval

I={0,1,…,w−1}.I=\{0,1,\ldots,w-1\}.

The second representation is carried to

I={c,c+r,…,c+(w−1)r},c=k−1(b−a),r=k−1ℓ.I=\{c,c+r,\ldots,c+(w-1)r\},\qquad c=k^{-1}(b-a),\quad r=k^{-1}\ell.

Thus the same set II is an arithmetic progression of length ww with nonzero step rr. By the preceding lemma, r≡±1(modp)r\equiv\pm1\pmod p. Therefore

k−1ℓ≡±1(modp),k^{-1}\ell\equiv\pm1\pmod p,

and multiplying by kk gives ℓ≡±k(modp)\ell\equiv\pm k\pmod p, as claimed.

Lemma 5.3 (Prime near-period lemma). If $2\le\operatorname{wt}(x)\le p-2$, then qi(x)≤1q_i(x)\le1 for every $i.

Proof. Let S=supp⁡(x)S=\operatorname{supp}(x) and put w=∣S∣=wt⁡(x)w=|S|=\operatorname{wt}(x). Recall that qi(x)q_i(x) counts the nonzero rotations RkR_k for which

∣Dk(x)∣=2andi+k∈Dk(x).|D_k(x)|=2 \qquad\text{and}\qquad i+k\in D_k(x).

Suppose first that a nonzero step kk contributes to qi(x)q_i(x). By the distance-two rotation structure, the support of xx is a cyclic arithmetic interval with step kk. Thus, for a suitable a∈Zpa\in\mathbb{Z}_p,

S={a,a+k,…,a+(w−1)k}.S=\{a,a+k,\ldots,a+(w-1)k\}.

Under translation by kk, all interior points of this progression remain in SS; the only membership changes occur at its two ends. Consequently

Dk(x)={a,a+wk}.D_k(x)=\{a,a+wk\}.

Since kk contributes to qi(x)q_i(x) precisely when i+k∈Dk(x)i+k\in D_k(x), we must have

i+k=aori+k=a+wk.i+k=a \qquad\text{or}\qquad i+k=a+wk.

Equivalently,

i∈{a−k,a+(w−1)k}.(1)i\in\{a-k,a+(w-1)k\}. \tag*{(1)}

Now suppose that a second nonzero step ℓ≠k\ell\ne k also contributes to qi(x)q_i(x). Then ℓ\ell is another step giving an arithmetic-progression representation of the same support SS. By Corollary 5.2 (prime arithmetic-interval uniqueness), ℓ=±k\ell=\pm k. Because ℓ≠k\ell\ne k, the only possibility is ℓ=−k\ell=-k.

To determine when −k-k can contribute, write the same progression in the reverse direction:

S={a+(w−1)k,a+(w−2)k,…,a}.S=\{a+(w-1)k,a+(w-2)k,\ldots,a\}.

For the step −k-k, the two disagreement positions are therefore

D−k(x)={a+(w−1)k,a−k}.D_{-k}(x)=\{a+(w-1)k,a-k\}.

The condition i−k∈D−k(x)i-k\in D_{-k}(x) is equivalent to

i∈{a+wk,a}.(2)i\in\{a+wk,a\}. \tag*{(2)}

It remains to observe that the two possible sets of indices in (5.1) and (5.2) are disjoint when 2≤w≤p−22\le w\le p-2. Indeed, an equality between an element of

{a−k,a+(w−1)k}\{a-k,a+(w-1)k\}

and an element of

{a,a+wk}\{a,a+wk\}

would, after cancelling aa and using k≠0k\ne0 in Zp\mathbb{Z}_p, force one of

−1≡0,−1≡w,w−1≡0,w−1≡w(modp).-1\equiv0,\qquad-1\equiv w,\qquad w-1\equiv0,\qquad w-1\equiv w\pmod{p}.

The first and last are impossible, while the middle two give respectively w=p−1w=p-1 and w=1w=1, both excluded by 2≤w≤p−22\le w\le p-2.

Hence no fixed coordinate ii can satisfy the contribution condition for both kk and −k-k. Since every other possible near-period step is ruled out by Corollary 5.2, at most one nonzero rotation contributes to qi(x)q_i(x). Therefore

qi(x)≤1,q_i(x)\le1,

as claimed.

Theorem 5.4 (Prime multiplicities). If 2≤wt⁡(x)≤p−22 \le\operatorname{wt}(x) \le p-2, then

m([x],[x(i)])=1+qi(x)∈{1,2}.m([x],[x^{(i)}]) = 1 + q_i(x) \in\{1,2\}.

From the constant necklace to the unique adjacent weight-one (respectively weight-(p−1)(p-1)) necklace, the directed multiplicity is pp.

Proof. Assume first that 2≤wt⁡(x)≤p−22 \le\operatorname{wt}(x) \le p-2. Since pp is prime and xx is nonconstant, the only rotation fixing xx is the identity; hence hx=1h_x=1. Moreover, flipping one coordinate changes the weight by one, so 1≤wt⁡(x(i))≤p−11 \le\operatorname{wt}(x^{(i)}) \le p-1. Thus x(i)x^{(i)} is also nonconstant, and therefore hx(i)=1h_{x^{(i)}}=1.

The multiplicity formula of Theorem 4.1 consequently reduces to

m([x],[x(i)])=hx+qi(x)hx(i)=1+qi(x).m([x],[x^{(i)}]) = \frac{h_x+q_i(x)}{h_{x^{(i)}}}=1+q_i(x).

By the prime near-period lemma, qi(x)≤1q_i(x) \le1 for every ii. Since qi(x)q_i(x) is a nonnegative integer, qi(x)∈{0,1}q_i(x) \in\{0,1\}, and hence

m([x],[x(i)])∈{1,2}.m([x],[x^{(i)}]) \in\{1,2\}.

In particular, multiplicity two occurs exactly when qi(x)=1q_i(x)=1, that is, when there is a nontrivial rotation RkR_k with ∣Dk(x)∣=2\lvert D_k(x)\rvert=2 and i+k∈Dk(x)i+k \in D_k(x).

It remains to consider the extreme layers. The constant word 0p0^p has a single necklace, while flipping any one of its pp coordinates produces a weight-one word. All weight-one words are rotations of one another, so all pp coordinate flips land in the unique weight-one necklace. Therefore the directed multiplicity from [0p][0^p] to that necklace is pp. The same argument, with zeros and ones interchanged, shows that the directed multiplicity from [1p][1^p] to the unique weight-(p−1)(p-1) necklace is also pp.

Sensitivity for odd prime length

For necklaces XX and YY, write Y∼XY \sim X if they are neighboring necklaces, meaning that there exist representatives x∈Xx \in X and y∈Yy \in Y with Hamming distance dH(x,y)=1d_H(x,y)=1; equivalently, Y=[x(i)]Y=[x^{(i)}] for some x∈Xx \in X and some coordinate i∈Zni \in\mathbb{Z}_n. For a necklace XX, let

Bf(X)=#{Y:Y∼X, fˉ(Y)≠fˉ(X)}B_f(X)=\#\{Y:Y\sim X,\ \bar{f}(Y)\ne\bar{f}(X)\}

be the number of bichromatic neighboring necklaces of $X. Recall from § 2 that s(f,X)=s(f,x)s(f,X)=s(f,x) for any representative x∈Xx \in X; this is well defined because sensitivity is constant on a necklace. For an interior necklace, let

Nf(X)=#{Y:Y∼X, fˉ(Y)≠fˉ(X), m(X,Y)=2}.N_f(X)=\#\{Y:Y\sim X,\ \bar{f}(Y)\ne\bar{f}(X),\ m(X,Y)=2\}.

Theorem 6.1 (Prime local sensitivity formula). If 2≤wt⁡(X)≤p−22 \le\operatorname{wt}(X) \le p-2, then

s(f,X)=Bf(X)+Nf(X).s(f,X)=B_f(X)+N_f(X).

Proof. Fix a representative x∈Xx \in X. By the necklace sensitivity formula from § 2,

s(f,X)=∑fˉ(Y)≠fˉ(X)m(X,Y).s(f,X)=\sum_{\bar{f}(Y)\ne\bar{f}(X)}m(X,Y).

Only neighboring necklaces Y∼XY \sim X can have m(X,Y)>0m(X,Y)>0, so the sum is over the bichromatic neighbors of XX. Because 2≤wt⁡(X)≤p−22 \le\operatorname{wt}(X) \le p-2, both XX and every necklace obtained from XX by one coordinate flip are nonconstant. The prime-length multiplicity result proved immediately above therefore gives

m(X,Y)∈{1,2}m(X,Y) \in\{1,2\}

for every neighbor YY of XX.

Now separate the bichromatic neighbors according to their multiplicity. Each bichromatic neighbor contributes at least one to the sensitivity sum, and the number of such neighbors is exactly Bf(X)B_f(X). A bichromatic neighbor with multiplicity two contributes one further unit. By definition, the number of these doubled bichromatic neighbors is Nf(X)N_f(X). Consequently,

s(f,X)=∑Y∼Xfˉ(Y)≠fˉ(X)m(X,Y)=∑Y∼Xfˉ(Y)≠fˉ(X)(1+#{Y:Y∼X, fˉ(Y)≠fˉ(X), m(X,Y)=2})=Bf(X)+Nf(X).\begin{aligned} s(f,X) &= \sum_{\substack{Y\sim X\\ \bar f(Y)\ne\bar f(X)}} m(X,Y)\\ &= \sum_{\substack{Y\sim X\\ \bar f(Y)\ne\bar f(X)}}\left(1+\#\{Y:Y\sim X,\ \bar f(Y)\ne\bar f(X),\ m(X,Y)=2\}\right)\\ &= B_f(X)+N_f(X). \end{aligned}

This proves the formula.

Suppose S=supp⁡(x)S=\operatorname{supp}(x) is a cyclic arithmetic interval

S={a,a+k,…,a+(w−1)k},2≤w≤p−2.S=\{a,a+k,\ldots,a+(w-1)k\},\qquad2\le w\le p-2.

The two possible doubled neighboring necklaces are

Y+=[x(a−k)]=[x(a+wk)],Y^+=[x^{(a-k)}]=[x^{(a+wk)}],
Y−=[x(a)]=[x(a+(w−1)k)].Y^-=[x^{(a)}]=[x^{(a+(w-1)k)}].

For necklaces X,YX,Y, put δf(X,Y)=1\delta_f(X,Y)=1 if fˉ(X)≠fˉ(Y)\bar f(X)\ne\bar f(Y) and 00 otherwise.

Corollary 6.2 (Explicit prime formula). Let 2≤wt⁡(X)≤p−22\le\operatorname{wt}(X)\le p-2. If supp⁡(x)\operatorname{supp}(x) is not a cyclic arithmetic interval, then

s(f,X)=Bf(X).s(f,X)=B_f(X).

If supp⁡(x)\operatorname{supp}(x) is a cyclic arithmetic interval as above, then

s(f,X)=Bf(X)+δf(X,Y−)+δf(X,Y+).s(f,X)=B_f(X)+\delta_f(X,Y^-)+\delta_f(X,Y^+).

In particular,

0≤s(f,X)−Bf(X)≤2.0\le s(f,X)-B_f(X)\le2.

Proof. By Theorem 6.1,

s(f,X)=Bf(X)+Nf(X),s(f,X)=B_f(X)+N_f(X),

so it remains only to identify the neighboring necklaces that can have multiplicity two.

Suppose first that supp⁡(x)\operatorname{supp}(x) is not a cyclic arithmetic interval. If some neighbor Y=[x(i)]Y=[x^{(i)}] had m(X,Y)=2m(X,Y)=2, then the prime multiplicity formula would give qi(x)=1q_i(x)=1. Thus xx would admit a nontrivial rotation at Hamming distance two. By the distance-two structure from § 3, its support would then have to be a cyclic arithmetic interval, a contradiction. Hence every neighboring necklace has multiplicity one, so Nf(X)=0N_f(X)=0 and

s(f,X)=Bf(X).s(f,X)=B_f(X).

Now suppose

supp⁡(x)={a,a+k,…,a+(w−1)k},2≤w≤p−2.\operatorname{supp}(x)=\{a,a+k,\ldots,a+(w-1)k\},\qquad2\le w\le p-2.

For the rotation with step kk, the two endpoints of the resulting distance-two disagreement give the flip-equivalence

[x(a−k)]=[x(a+wk)]=Y+.[x^{(a-k)}]=[x^{(a+wk)}]=Y^{+}.

Similarly, using the reverse step −k-k gives

[x(a)]=[x(a+(w−1)k)]=Y−.[x^{(a)}]=[x^{(a+(w-1)k)}]=Y^{-}.

Thus Y+Y^{+} and Y−Y^{-} are precisely the two possible doubled neighboring necklaces. The prime arithmetic-interval uniqueness result shows that any other nontrivial distance-two rotation has step ±k\pm k, so no third doubled neighbor can occur. Consequently the doubled bichromatic neighbors are exactly those among Y−Y^{-} and Y+Y^{+} for which the value of fˉ\bar{f} differs from fˉ(X)\bar{f}(X). Therefore

Nf(X)=δf(X,Y−)+δf(X,Y+),N_f(X)=\delta_f(X,Y^{-})+\delta_f(X,Y^{+}),

and substitution into Theorem 6.1 yields

s(f,X)=Bf(X)+δf(X,Y−)+δf(X,Y+).s(f,X)=B_f(X)+\delta_f(X,Y^{-})+\delta_f(X,Y^{+}).

Since each δf\delta_f is either 0 or 1, the final bound

0≤s(f,X)−Bf(X)≤20\le s(f,X)-B_f(X)\le2

follows immediately.

For 0≤r≤p0\le r\le p, let XrX_r denote a necklace of Hamming weight rr when the necklace is unique; in particular, X0=[0p]X_0=[0^p], X1X_1 is the unique weight-one necklace, Xp−1X_{p-1} is the unique weight-(p−1)(p-1) necklace, and Xp=[1p]X_p=[1^p].

Proposition 6.3 (The four boundary layers). For an odd prime pp,

s(f,X0)=pδf(X0,X1),s(f,Xp)=pδf(Xp,Xp−1).s(f,X_0)=p\delta_f(X_0,X_1),\qquad s(f,X_p)=p\delta_f(X_p,X_{p-1}).

Moreover,

s(f,X1)=δf(X1,X0)+2∑Y∼X1wt⁡(Y)=2δf(X1,Y).s(f,X_1)=\delta_f(X_1,X_0)+2\sum_{\substack{Y\sim X_1\\ \operatorname{wt}(Y)=2}}\delta_f(X_1,Y).

and

s(f,Xp−1)=δf(Xp−1,Xp)+2∑Y∼Xp−1wt⁡(Y)=p−2δf(Xp−1,Y).s(f,X_{p-1})=\delta_f(X_{p-1},X_p)+2\sum_{\substack{Y\sim X_{p-1}\\ \operatorname{wt}(Y)=p-2}}\delta_f(X_{p-1},Y).

In each of the two sums there are exactly (p−1)/2(p-1)/2 distinct neighboring necklaces.

Proof. The constant-word formulas are immediate. For X1X_1, choose the representative whose unique 1 is at coordinate 0. Flipping coordinate 0 gives X0X_0, with multiplicity 1. Flipping a zero coordinate d≠0d \ne0 gives the weight-two support {0,d}\{0,d\}. Two such supports {0,d}\{0,d\} and {0,e}\{0,e\} are rotation-equivalent if and only if e≡de \equiv d or e≡−d(modp)e \equiv-d \pmod{p}. Since pp is odd, the p−1p-1 nonzero residues therefore split into (p−1)/2(p-1)/2 pairs {d,−d}\{d,-d\}, and every resulting weight-two neighboring necklace has multiplicity 2. This proves the formula for X1X_1. The formula for Xp−1X_{p-1} follows either by the same argument or by complementing all bits.

Example (p=5p=5). Let X0=[00000]X_0=[00000], X1=[10000]X_1=[10000], and let Y1=[11000]Y_1=[11000], Y2=[10100]Y_2=[10100] denote the two weight-two necklaces. The five flips from X0X_0 all lead to X1X_1, so m(X0,X1)=5m(X_0,X_1)=5. From X1X_1, one flip leads to X0X_0, while the other four flips split into two flips to each of Y1,Y2Y_1,Y_2; thus m(X1,Y1)=m(X1,Y2)=2m(X_1,Y_1)=m(X_1,Y_2)=2. For example, define the rotation symmetric Boolean function that is 1 exactly on X1X_1. Its local sensitivity at X1X_1 is 1+2+2=51+2+2=5, while its local sensitivity at either YiY_i is 2. This illustrates why ordinary unweighted necklace adjacency does not determine sensitivity.

Theorem 6.4 (Complete odd-prime sensitivity formula). Let pp be an odd prime and let ff be rotation symmetric on pp variables. The local sensitivity at every necklace is given as follows:

  • (i) at weights 0 and pp, by the first two formulas in the boundary-layer proposition;

  • (ii) at weights 1 and p−1p-1, by the two displayed boundary-layer formulas;

  • (iii) at weights 2,…,p−22,\ldots,p-2, by Theorem 6.1 and Corollary 6.2.

Consequently, s(f)s(f) is the maximum of these explicitly determined local quantities over the necklaces of length pp.

Two consequences of the necklace sensitivity formula

The complete prime-length formula gives a simple characterization of when maximum sensitivity occurs.

Corollary 6.5 (A criterion for submaximal sensitivity). Let n≥1n \ge1 and let ff be rotation symmetric on nn variables. Then

s(f)<ns(f) < n

if and only if every binary necklace XX of length nn has at least one neighboring necklace YY with

fˉ(X)=fˉ(Y).\bar{f}(X) = \bar{f}(Y).

In particular, s(f)<ns(f)<n implies that the constant necklace and the unique weight-one necklace have the same value, and likewise at the upper end of the Hamming layers.

Proof. For every necklace X=[x]X=[x],

∑Ym(X,Y)=n,\sum_Y m(X,Y)=n,

because the multiplicities partition the nn one-coordinate flips of xx. Hence the weighted bichromatic degree equals nn exactly when every neighboring necklace is bichromatic. Taking the maximum over XX proves the equivalence. The final assertion follows by applying the criterion to the constant necklaces.

The correction from ordinary necklace degree to weighted degree is confined to a very small exceptional family. Let D2(p)D_2(p) denote the number of length-pp necklaces admitting a nontrivial rotation at Hamming distance two. The classification of the exceptional supports is due to Makhynko [8]. For completeness, the enumeration follows directly from the arithmetic-progression description: at each weight 2≤w≤p−22 \leq w \leq p - 2, the supporting necklaces are represented by the nonzero steps k∈Zp∗k \in\mathbb{Z}_p^*, with kk and −k-k describing the same necklace and with no other identifications. There are therefore (p−1)/2(p-1)/2 necklaces at each of the p−3p-3 interior weights. The weight-one and weight-(p−1)(p-1) necklaces contribute two further cases. Hence

D2(p)=2+(p−3)p−12=p2−4p+72.D_2(p) = 2 + (p - 3)\frac{p - 1}{2} = \frac{p^2 - 4p + 7}{2}.

This calculation uses the structural classification of the cited work; it is not a new classification. Notice that the two constant necklaces are not included in D2(p)D_2(p): every nontrivial rotation fixes a constant word, so its nontrivial rotational Hamming distance is 0, not 2. Thus subtracting the two constant necklaces in addition to D2(p)D_2(p) does not double count.

The total number of binary necklaces of prime length pp is

N(p)=2p+2p−2p.N(p) = \frac{2^p + 2p - 2}{p}.

Corollary 6.6 (Generic simplicity at prime length). Let pp be an odd prime. Apart from the two constant necklaces and the D2(p)D_2(p) necklaces admitting a nontrivial rotation at Hamming distance two, every necklace XX satisfies

s(f,X)=Bf(X)s(f, X) = B_f(X)

for every rotation symmetric Boolean function ff. Consequently at least

2p+2p−2p−p2−4p+72−2\frac{2^p + 2p - 2}{p} - \frac{p^2 - 4p + 7}{2} - 2

necklaces have this property. In particular, the proportion of necklaces for which a multiplicity correction can be required is

O(p32p),O\left(\frac{p^3}{2^p}\right),

and therefore tends to zero as p→∞p \to\infty through the odd primes.

Proof. For a nonconstant necklace XX with no nontrivial rotation at Hamming distance two, the flip-equivalence criterion and triviality of the stabilizer imply that the pp one-bit flips of a representative lie in pp distinct necklaces. Thus every outgoing multiplicity is one and the weighted bichromatic degree equals the ordinary bichromatic necklace degree:

s(f,X)=Bf(X).s(f, X) = B_f(X).

Removing the two constant necklaces and the D2(p)D_2(p) distance-two necklaces gives the displayed lower bound. Finally,

N(p)∼2ppandD2(p)=Θ(p2).N(p) \sim\frac{2^p}{p} \qquad\text{and}\qquad D_2(p) = \Theta(p^2).

Indeed, D2(p)D_2(p) grows quadratically (not linearly), so dividing its O(p2)O(p^2) count by N(p)≍2p/pN(p) \asymp2^p/p gives an exceptional proportion of O(p3/2p)O(p^3/2^p). ∎

Remark. The preceding corollary separates the exact and generic aspects of the theory. Multiplicity corrections are essential for a complete formula, but for prime length they are supported on an asymptotically negligible family of necklaces.

Sensitivity of monomial rotation symmetric functions

For a Boolean function f:{0,1}n→{0,1}f:\{0,1\}^{n}\to\{0,1\} and a coordinate j∈Znj\in\mathbb{Z}_{n}, write

∂jf(x):=f(x)⊕f(x(j)),\partial_j f(x):=f(x)\oplus f\left(x^{(j)}\right),

where x(j)x^{(j)} denotes the vector obtained by flipping coordinate jj. This is the Boolean partial derivative (a finite difference over F2\mathbb{F}_2), not the ordinary calculus derivative. Thus ∂jf(x)=1\partial_j f(x)=1 exactly when ff is sensitive to coordinate jj at xx. We use ∂j\partial_j below to distinguish Boolean derivatives from the disagreement sets Dk(x)D_k(x) defined earlier.

Monomial rotation symmetric Boolean functions form one of the most studied subclasses of rotation symmetric functions. Let

A⊆Zn,∣A∣=d,A\subseteq\mathbb{Z}_n,\qquad|A|=d,

and let

mA(x)=∏a∈Axa.m_A(x)=\prod_{a\in A}x_a.

Write

O(A)={A+t:t∈Zn}\mathcal{O}(A)=\{A+t:t\in\mathbb{Z}_n\}

for the set of distinct translates of AA, and put

τ=∣O(A)∣.\tau=|\mathcal{O}(A)|.

The monomial rotation symmetric Boolean function generated by AA is

MA(x)=⨁B∈O(A)∏j∈Bxj.M_A(x)=\bigoplus_{B\in\mathcal{O}(A)}\prod_{j\in B}x_j.

Thus short monomial orbits are automatically counted without duplication.

Proposition 7.1 (Incidence formula). Every coordinate of Zn\mathbb{Z}_n belongs to exactly

λ=τdn\lambda=\frac{\tau d}{n}

distinct monomials occurring in MAM_A.

Proof. There are τ\tau distinct monomials and each contains dd coordinates, so the total number of coordinate–monomial incidences is τd\tau d. Cyclic rotation acts transitively on the coordinate set and preserves the family O(A)\mathcal{O}(A); hence every coordinate belongs to the same number λ\lambda of orbit monomials. Therefore

nλ=τd,n\lambda=\tau d,

which proves the formula.

Let

HA={u∈Zn:A+u=A}H_A=\{u\in\mathbb{Z}_n:A+u=A\}

be the rotational stabilizer of the support AA, and put h=∣HA∣h=|H_A|. By orbit–stabilizer,

τ=nh.\tau=\frac{n}{h}.

Moreover, HAH_A acts freely on Zn\mathbb{Z}_n, so each HAH_A-orbit has size hh. Since AA is HAH_A-invariant, it is a union of such orbits; hence

h∣d.h\mid d.

Consequently the incidence number can also be written as

λ=dh.\lambda=\frac{d}{h}.

Theorem 7.2 (Parity theorem for MRS functions). Let MAM_A be generated by a degree-dd monomial whose rotational stabilizer has order hh. Then

s(MA,1n)={n,d/h is odd,0,d/h is even.s(M_A,1^n)= \begin{cases} n, & d/h\text{ is odd},\\ 0, & d/h\text{ is even}. \end{cases}

In particular, if d/hd/h is odd, then

s(MA)=n.s(M_A)=n.

Proof. At the all-one input every monomial in MAM_A has value 1. Flipping a fixed coordinate jj changes precisely the orbit monomials containing jj. By the incidence formula, their number is

λ=dh.\lambda=\frac{d}{h}.

Therefore

∂jMA(1n)=dh(mod2)\partial_jM_A(1^n)=\frac{d}{h}\pmod{2}

for every coordinate jj. If d/hd/h is odd, all nn coordinates are sensitive at 1n1^n; if d/hd/h is even, none is sensitive there.

Corollary 7.3 (Odd-degree MRS functions). Every monomial rotation symmetric Boolean function of odd degree dd satisfies

s(MA)=n.s(M_A)=n.

Proof. Since h∣dh\mid d, oddness of dd implies that both hh and d/hd/h are odd. The parity theorem applies.

Thus all odd degrees have maximum possible sensitivity, including short-orbit monomial functions. The first nontrivial degree is therefore degree two, which we now determine completely. Quadratic rotation symmetric Boolean functions have also been studied from the viewpoints of Hamming weight, balancedness, affine equivalence, and weight recurrences; see, for example, [3, 4, 5].

For

1≤k≤⌊n2⌋,1\le k\le\left\lfloor\frac{n}{2}\right\rfloor,

let Qn,kQ_{n,k} be the rotation symmetric Boolean function generated by the monomial x0xkx_0x_k, with each distinct rotated monomial included exactly once. Thus, except in the short-orbit case nn even and k=n/2k=n/2,

Qn,k(x)=⨁i∈Znxixi+k.Q_{n,k}(x)=\bigoplus_{i\in\mathbb{Z}_n}x_ix_{i+k}.

Theorem 7.4 (Sensitivity of quadratic MRS functions). Let 1≤k≤⌊n/2⌋1 \le k \le\lfloor n/2 \rfloor.

(i) If nn is even and k=n/2k = n/2, then

s(Qn,k)=n.s(Q_{n,k}) = n.

(ii) Otherwise, put

g=gcd⁡(n,2k),L=ng.g = \gcd(n,2k), \qquad L = \frac{n}{g}.

Then

s(Qn,k)={n,L is even,n−g,L is odd.s(Q_{n,k}) = \begin{cases} n, & L\text{ is even},\\ n-g, & L\text{ is odd}. \end{cases}

Proof. First suppose that nn is even and k=n/2k = n/2. The orbit of the generating monomial has size n/2n/2, and

Qn,n/2(x)=⨁i=0n/2−1xixi+n/2.Q_{n,n/2}(x) = \bigoplus_{i=0}^{n/2-1} x_i x_{i+n/2}.

Each coordinate occurs in exactly one monomial. Hence

∂jQn,n/2(x)=xj+n/2,\partial_j Q_{n,n/2}(x) = x_{j+n/2},

where indices are taken modulo nn. At x=1nx = 1^n every coordinate is sensitive, so s(Qn,n/2)=ns(Q_{n,n/2}) = n.

Now assume that we are not in the short-orbit case. Each coordinate xjx_j occurs in exactly two distinct rotated monomials, namely

xj−kxjandxjxj+k.x_{j-k}x_j \qquad\text{and} \qquad x_jx_{j+k}.

Therefore the Boolean derivative in coordinate jj is

∂jQn,k(x)=Qn,k(x)⊕Qn,k(x(j))=xj−k⊕xj+k.\partial_j Q_{n,k}(x) = Q_{n,k}(x) \oplus Q_{n,k}(x^{(j)}) = x_{j-k} \oplus x_{j+k}.

Consequently

s(Qn,k,x)=#{j∈Zn:xj−k≠xj+k}=#{j∈Zn:xj≠xj+2k}.s(Q_{n,k},x) = \#\{j \in\mathbb{Z}_n : x_{j-k} \ne x_{j+k}\} = \#\{j \in\mathbb{Z}_n : x_j \ne x_{j+2k}\}.

Consider the permutation

T:j⟼j+2k(modn).T:j \longmapsto j+2k \pmod n.

It has

g=gcd⁡(n,2k)g = \gcd(n,2k)

cycles, each of length

L=n/g.L = n/g.

On each cycle, the contribution to the last display is exactly the number of transitions in a cyclic binary sequence of length LL. If LL is even, an alternating assignment attains LL transitions. If LL is odd, a cyclic binary sequence has an even number of transitions and therefore at most L−1L-1; this value is attained by an alternating assignment with one repeated bit at the closing edge. The cycles are disjoint and may be assigned independently. Thus

s(Qn,k)={gL=n,L even,g(L−1)=n−g,L odd,s(Q_{n,k}) = \begin{cases} gL = n, & L\text{ even},\\ g(L-1) = n-g, & L\text{ odd}, \end{cases}

as claimed.

Corollary 7.5 (Odd prime length). Let pp be an odd prime. For every

1≤k≤p−12,1 \le k \le\frac{p-1}{2},

the quadratic monomial rotation symmetric Boolean function Qp,kQ_{p,k} satisfies

s(Qp,k)=p−1.s(Q_{p,k}) = p - 1.

Thus all quadratic MRS functions of odd prime length have the same sensitivity, independent of the spacing of the generating monomial.

Proof. Since pp is an odd prime and 1≤k≤(p−1)/21 \le k \le(p-1)/2, we have gcd⁡(p,k)=1\gcd(p,k)=1 and gcd⁡(p,2)=1\gcd(p,2)=1. Therefore

gcd⁡(p,2k)=1.\gcd(p,2k)=1.

In the notation of the preceding theorem, g=gcd⁡(n,2k)g=\gcd(n,2k). Here n=pn=p, so g=gcd⁡(p,2k)=1g=\gcd(p,2k)=1. Also L=pL=p is odd. The theorem therefore gives s(Qp,k)=p−1s(Q_{p,k})=p-1.

Consecutive monomials of arbitrary even degree

We now determine the maximum sensitivity of consecutive monomial orbit sums of every fixed even degree, apart from finitely many short lengths. The argument is combinatorial: it charges insensitive coordinates to maximal clusters of short runs. In particular, it does not require a classification by the number of insensitive coordinates. For even d≥4d \ge4 and n≥2d−1n \ge2d-1, define

Fd,n(x)=⨁i∈Zn∏j=0d−1xi+j,cd(n)=n−s(Fd,n).F_{d,n}(x)=\bigoplus_{i\in\mathbb{Z}_n}\prod_{j=0}^{d-1}x_{i+j},\qquad c_d(n)=n-s(F_{d,n}).

All indices are modulo nn; the lower bound on nn ensures that the monomials occurring in the derivative calculation are distinct. For a residue class modulo mm, put dist⁡(n,mZ)=min⁡a∈Z∣n−am∣\operatorname{dist}(n,m\mathbb{Z})=\min_{a\in\mathbb{Z}}|n-am|.

Theorem 7.6 (Universal cluster inequality). Let d≥4d \ge4 be even, n≥2d−1n \ge2d-1, and m=d+2m=d+2. For every binary word xx of length nn,

n−s(Fd,n,x)≥dist⁡(n,mZ).n-s(F_{d,n},x)\ge\operatorname{dist}(n,m\mathbb{Z}).

Proof. Put K=n−s(Fd,n,x)K=n-s(F_{d,n},x) and m=d+2m=d+2. We will show that K≥∣n−qm∣K\ge|n-qm| for a suitable integer qq whenever K<m/2K<m/2. This is enough: dist⁡(n,mZ)≤m/2\operatorname{dist}(n,m\mathbb{Z})\le m/2, so if K≥m/2K\ge m/2 the asserted inequality is automatic. Hence assume throughout that K<m/2K<m/2.

Step 1: Divide the word into long runs and short runs. The constant words have K=n≥m/2K=n\ge m/2: all derivatives vanish at 0n0^n, and at 1n1^n each derivative is the sum of the even number dd of monomials. We may therefore write the nonconstant word cyclically as

x=1L10g1⋯1Lk0gk,Li,gi≥1.x=1^{L_1}0^{g_1}\cdots1^{L_k}0^{g_k},\qquad L_i,g_i\ge1.

A one-run is long if Li≥dL_i\ge d and short otherwise. Every one in a short run is insensitive: flipping it cannot destroy an all-one monomial of length dd. In particular, a short run of length d−1d-1 would give K≥d−1≥m/2K\ge d-1\ge m/2, contrary to our assumption. Thus each short run has length at most d−2d-2.

Step 2: Establish the three local charges. We count insensitive coordinates, whose total number is KK. (i) A long one-run of length LL contributes at least L−dL-d insensitive ones. Indeed, put M=L−d+1M=L-d+1 and number its positions j=0,…,L−1j=0,\ldots,L-1. The number of all-one length-dd monomials containing position jj is

a(j)=min⁡{j+1,L−j,M,d}.a(j)=\min\{j+1,L-j,M,d\}.

Indeed, a length-dd block starting at position tt lies in this run and contains jj precisely when

max⁡{0,j−d+1}≤t≤min⁡{j,L−d}.\max\{0,j-d+1\}\le t\le\min\{j,L-d\}.

Thus the number of possible starting positions is

a(j)=min⁡{j,L−d}−max⁡{0,j−d+1}+1,a(j)=\min\{j,L-d\}-\max\{0,j-d+1\}+1,

which simplifies to the displayed formula. The position is sensitive exactly when a(j)a(j) is odd, since the Boolean derivative adds these monomials modulo 2. To count the odd entries, observe that the list a(0),…,a(L−1)a(0),\ldots,a(L-1) rises by one to h=min⁡{M,d}h=\min\{M,d\}, has a constant plateau of height hh, and then decreases symmetrically. Each value 1,…,h−11,\ldots,h-1 occurs twice, while hh occurs L−2(h−1)L-2(h-1) times. If M≥dM\ge d, then h=dh=d is even, so only the two rising and falling portions contribute: the number of odd entries is 2(d/2)=d2(d/2)=d. If M<dM<d is even, the number is 2(M/2)=M2(M/2)=M. If M<dM<d is odd, there are M−1M-1 odd entries off the plateau and d−M+1d-M+1 on it, for a total of dd. In every case, at most dd positions in the run are sensitive, so at least L−dL-d are insensitive.

(ii) A zero-gap of length gg between two long runs contributes exactly ∣g−2∣|g-2| insensitive zeros. Indeed, if g=1g=1, flipping the unique zero joins two runs of at least dd ones and creates exactly dd new all-one length-dd monomials, one for each possible position of the flipped coordinate within such a monomial. Since dd is even, their contributions cancel modulo 2, so this zero is insensitive. If g≥2g\ge2, flipping the first zero creates exactly one all-one length-dd monomial, using the preceding d−1d-1 ones; similarly, flipping the last zero creates exactly one such monomial using the following d−1d-1 ones. An interior zero creates none, since another zero remains on each side. Hence precisely the two boundary zeros are sensitive and the remaining g−2g-2 are insensitive.

(iii) A zero-gap of length gg next to a short run contributes at least g−1g-1 insensitive zeros. For g=1g=1 the assertion is simply the trivial lower bound zero. For g≥2g\ge2, an interior zero cannot be sensitive, because flipping it leaves a zero on either side. Of the two boundary zeros, the one next to the short one-run cannot be sensitive: creating a length-dd all-one block there would require at least d−1d-1 ones immediately beyond the flipped zero, whereas the short run has fewer than d−1d-1 ones. Thus at most the boundary zero next to the other run can be sensitive, leaving at least g−1g-1 insensitive zeros.

There is a useful strengthening of (iii): a gap between two short runs consists entirely of insensitive zeros. This is clear for g≥2g\ge2. For g=1g=1, a sensitive separating zero would require the two adjacent short-run lengths a,ba,b to satisfy a+b+1≥da+b+1\ge d. But every one in either short run is insensitive, so these two runs alone contribute at least a+b≥d−1≥m/2a+b\ge d-1\ge m/2 insensitive coordinates, contradicting K<m/2K<m/2. Consequently, when K<m/2K<m/2, every zero in a gap between two short one-runs is insensitive.

Step 3: Compress each cluster into one unit. At least one one-run is long; otherwise Step 1 makes all ones insensitive and Step 2 makes all gaps insensitive, giving K=nK=n. Let q≥1q\ge1 count the long one-runs. Between consecutive long runs there is exactly one of two types of units:

  • a single zero-gap of length gg with no short run in it;

  • a cluster consisting of h≥1h\ge1 short one-runs of lengths t1,…,tht_1,\ldots,t_h, together with all h+1h+1 intervening and boundary zero-gaps of lengths g0,…,ghg_0,\ldots,g_h.

There are exactly qq such units around the cycle, even when q=1q=1: for q=1q=1, the single unit runs cyclically from the unique long run back to itself. Every zero and every short one-run belongs to exactly one unit, and no unit contains a coordinate of a long one-run. A gap unit has length gg and, by (ii), has ∣g−2∣|g-2| insensitive coordinates. A cluster unit has length

T=∑j=1htj+∑j=0hgj.T=\sum_{j=1}^{h}t_j+\sum_{j=0}^{h}g_j.

All tjt_j ones and all internal-gap zeros are insensitive; by (iii), at most one zero in each of the two boundary gaps can be sensitive. Thus the cluster has at least T−2T-2 insensitive coordinates. Here T≥2T\ge2 because the cluster contains at least one one and its two nonempty boundary gaps, so T−2≥0T-2\ge0. This explains the reference value 2: every unit is compared with the two-zero gap in the regular pattern 1d001^d00. In other words, every unit has insensitive cost at least its length minus 2; for a plain gap the stronger bound ∣g−2∣|g-2| holds. Because the units partition all positions outside the long runs, none of these counts overlaps with another.

Step 4: Compare actual lengths with the regular block 1d001^d00. Define

A=∑long runs(L−d),A=\sum_{\text{long runs}}(L-d),
B=∑gap units(g−2),B=\sum_{\text{gap units}}(g-2),
C=∑cluster units(T−2).C=\sum_{\text{cluster units}}(T-2).

Here A,C≥0A,C\ge0. Step 2 and Step 3 show, by counting disjoint insensitive coordinates, that

K≥A+∑gap units∣g−2∣+C≥A+∣B∣+C≥∣A+B+C∣.(3)K\ge A+\sum_{\text{gap units}}|g-2|+C\ge A+|B|+C\ge|A+B+C|. \tag*{(3)}

To understand the last expression, start with qq regular blocks 1d001^d00 of total length q(d+2)q(d+2). The qq long runs have AA extra ones in total. Each of the qq units replaces a two-zero gap and changes the length by g−2g-2 (gap unit) or T−2T-2 (cluster unit). Therefore, simply by adding the lengths of these disjoint pieces,

n=q(d+2)+A+B+C.n=q(d+2)+A+B+C.

Substituting this identity into (*) yields

K≥∣n−q(d+2)∣≥dist⁡(n,(d+2)Z),K\ge|n-q(d+2)|\ge\operatorname{dist}(n,(d+2)\mathbb{Z}),

which proves the theorem.

Theorem 7.7. (Exact sensitivity under explicit construction conditions). Let d≥4d\ge4 be even, m=d+2m=d+2, n≥2d−1n\ge2d-1, and write n=qm+rn=qm+r with 0≤r<m0\le r<m. Assume

{q≥1,0≤r≤m/2,q+1≥m−r,m/2<r<m.\begin{cases} q\ge1, & 0\le r\le m/2,\\ q+1\ge m-r, & m/2<r<m. \end{cases}

Then

s(Fd,n)=n−min⁡{r,m−r}.s(F_{d,n})=n-\min\{r,m-r\}.

Proof. The upper bound follows from Theorem 7.6. For the matching lower bound, we use the run and gap sensitivity counts established in the proof of that theorem: each one in a length-dd one-run is sensitive; a zero-gap of length g=1g=1 contributes one insensitive coordinate, while a zero-gap of length g≥2g \ge2 contributes exactly g−2g-2 insensitive coordinates when it lies between two length-dd one-runs. Consider cyclic words whose one-runs all have length exactly dd. If 0≤r≤m/20 \le r \le m/2, take qq one-runs separated by zero-gaps of lengths 2+r,2,…,22+r,2,\ldots,2. Every one is sensitive and exactly the rr internal zeros of the long gap are insensitive, so the deficit is rr. If m/2<r<mm/2 < r < m, write t=m−rt=m-r, so n=(q+1)m−tn=(q+1)m-t. Take q+1q+1 one-runs of length dd, with exactly tt of their separating gaps of length one and all others of length two. Since q+1≥tq+1 \ge t by the stated hypothesis, the construction exists. Exactly the tt zeros in the one-zero gaps are insensitive. Both constructions attain the upper bound.

Remark. The stated construction conditions sharpen the convenient uniform sufficient bound n≥m(m/2+1)n \ge m(m/2+1). They are not asserted to be necessary. Small lengths can behave differently: s(F6,13)=8s(F_{6,13})=8, whereas extrapolating the eventual formula to n=13n=13 would give 1010. The word x=0000000111111x=0000000111111 has sensitivity 88. An exhaustive upper-bound check evaluates all 213=81922^{13}=8192 binary inputs using the cyclic degree-six function (each coordinate occurs in exactly six of its monomials); a short independent Python verifier accompanies the source package. No computational certificate is required for the universal cluster inequality.

Remark (quadratic consistency). The numerical formula n−dist⁡(n,(d+2)Z)n-\operatorname{dist}(n,(d+2)\mathbb{Z}), formally specialized to d=2d=2, is consistent with the consecutive quadratic case of the quadratic formula earlier in this section (outside short monomial orbits). The cluster proof above is stated for d≥4d \ge4 because it invokes d−1≥(d+2)/2d-1 \ge(d+2)/2.

The consecutive quartic family

The universal theorem gives a conceptual proof of the quartic result, without a separate finite-state argument. The general quartic problem for supports {0,a,b,c}⊆Zn\{0,a,b,c\} \subseteq\mathbb{Z}_n is not addressed here. For n≥5n \ge5, let

Rn(x)=⨁i∈Znxixi+1xi+2xi+3.R_n(x)=\bigoplus_{i\in\mathbb{Z}_n}x_i x_{i+1}x_{i+2}x_{i+3}.

Corollary 7.8 (Consecutive quartic sensitivity). For n≥5n \ge5, write n=6q+rn=6q+r with 0≤r≤50 \le r \le5. Then

s(Rn)=n−min⁡{r,6−r}.s(R_n)=n-\min\{r,6-r\}.

For the short-orbit case n=4n=4, we use the convention of summing each distinct rotated monomial once: this gives the product x0x1x2x3x_0x_1x_2x_3, with sensitivity 44. By contrast, the literal four-term XOR of cyclic shifts is the zero function when n=4n=4, because the same monomial occurs four times.

Proof. Theorem 7.6 with d=4d=4 gives the upper bound for n≥7n \ge7. For n≥12n \ge12, the explicit constructions in the proof of Theorem 7.7 satisfy its stated conditions and attain the upper bound. The remaining lengths 5≤n≤115 \le n \le11 are handled by explicit witnesses and the universal upper bound (when n≥7n \ge7). The following cyclic words have sensitivity equal to the claimed value:

nnxxs(Rn,x)s(R_n,x)
5011114
60011116
700011116
8000011116
90000011116
1001111011118
110011110111110

Table 1.

For n=5n=5 the matching upper bound follows by checking the 252^5 inputs; equivalently, the coordinate derivative formula gives the same finite check. For n=6n=6, the required upper bound is s(R6)≤6s(R_6) \le6, since sensitivity never exceeds the number of variables and the formula predicts s(R6)=6s(R_6)=6. For 7≤n≤117 \le n \le11 the universal upper bound applies. Thus the claimed equality holds for every n≥5n \ge5.

Exact sensitivity of cyclic run-threshold functions

We next apply the sensitivity viewpoint to a standard cyclically invariant construction. Related sensitivity questions for transitive Boolean functions are studied by Chaubal and Gál [2]. Here we determine the sensitivity of the following cyclic run-threshold function exactly for arbitrary parameters.

For 2≤r≤n2 \le r \le n, define

Fn,r(x)=1⟺x contains a cyclic run of at least r consecutive ones.F_{n,r}(x)=1 \Longleftrightarrow x\text{ contains a cyclic run of at least }r\text{ consecutive ones}.

This function is rotation symmetric. Write sb(Fn,r)s_b(F_{n,r}) for the maximum local sensitivity over inputs on which Fn,r=bF_{n,r}=b.

Lemma 8.1 (Cyclic block optimization). Let m,q≥1m,q \ge1. Among all cyclic sequences of nonnegative integers

a1,…,ama_1,\ldots,a_m

satisfying

ai+ai+1≥q(i(modm)),a_i+a_{i+1}\ge q \qquad(i\pmod m),

the minimum of ∑iai\sum_i a_i is

⌈mq2⌉.\left\lceil\frac{mq}{2}\right\rceil.

Proof. Summing the mm inequalities gives

2∑i=1mai≥mq,2\sum_{i=1}^{m}a_i\ge mq,

hence the displayed lower bound. It remains to attain it. If mm is even, alternate ⌊q/2⌋\lfloor q/2\rfloor and ⌈q/2⌉\lceil q/2\rceil. If mm is odd and qq is even, take every ai=q/2a_i=q/2. Finally, if both mm and qq are odd, write q=2h+1q=2h+1 and take (m−1)/2(m-1)/2 entries equal to hh and (m+1)/2(m+1)/2 entries equal to h+1h+1, arranged cyclically so that no two entries equal to hh are adjacent. Every adjacent sum is then at least qq, and the total is ⌈mq/2⌉\lceil mq/2\rceil.

Theorem 8.2 (Exact run-threshold sensitivity). For 2≤r≤n2 \le r \le n,

s1(Fn,r)=r,s0(Fn,r)=⌊2nr+1⌋.s_1(F_{n,r}) = r,\qquad s_0(F_{n,r}) = \left\lfloor\frac{2n}{r+1} \right\rfloor.

Consequently,

s(Fn,r)=max⁡{r,⌊2nr+1⌋}.s(F_{n,r}) = \max\left\{r,\left\lfloor\frac{2n}{r+1} \right\rfloor\right\}.

Proof. First consider a 1-input. A sensitive coordinate must be a 1 whose deletion destroys every cyclic run of length at least rr. Hence all sensitive coordinates lie in a single maximal run of ones. If that run has length L≥rL \ge r, deleting a position is sensitive only when the remaining portions on both sides have lengths at most r−1r-1. The number of such positions is at most rr. Equality is attained by a word having exactly one run of rr ones and all other coordinates zero. Thus s1(Fn,r)=rs_1(F_{n,r}) = r.

Now let xx be a 0-input and suppose that it has mm sensitive zero coordinates. For each such zero, let aia_i and bib_i be the lengths of the adjacent runs of ones on its two sides. Flipping that zero creates a run of length ai+1+bia_i + 1 + b_i, so sensitivity implies

ai+bi≥r−1.a_i + b_i \ge r - 1.

Summing over the mm sensitive zeros, and observing that every 1-coordinate can be counted at most twice, gives

m(r−1)≤2wt⁡(x).m(r-1) \le2\operatorname{wt}(x).

Since xx contains at least these mm zero coordinates,

wt⁡(x)≤n−m.\operatorname{wt}(x) \le n-m.

Therefore

m(r+1)≤2n,m(r+1) \le2n,

and hence

s0(Fn,r)≤⌊2nr+1⌋.s_0(F_{n,r}) \le\left\lfloor\frac{2n}{r+1} \right\rfloor.

For the reverse inequality, put

m=⌊2nr+1⌋,q=r−1.m = \left\lfloor\frac{2n}{r+1} \right\rfloor,\qquad q = r-1.

If m=1m=1, then necessarily r=nr=n; the word 1n−101^{n-1}0 is a 0-input whose unique zero is sensitive, so the desired lower bound holds. Assume now that m≥2m \ge2. By the cyclic block optimization lemma, choose nonnegative integers a1,…,ama_1,\ldots,a_m with

ai+ai+1≥r−1a_i+a_{i+1} \ge r-1

and

∑iai=⌊m(r−1)2⌋.\sum_i a_i = \left\lfloor\frac{m(r-1)}{2} \right\rfloor.

The initial cyclic word

1a10 1a20⋯1am01^{a_1}0\,1^{a_2}0\cdots1^{a_m}0

has length

m+⌈m(r−1)2⌉=⌈m(r+1)2⌉≤n.m+\left\lceil\frac{m(r-1)}{2}\right\rceil=\left\lceil\frac{m(r+1)}{2}\right\rceil\le n.

The ceiling brackets in both displayed expressions are essential when m(r−1)m(r-1) is odd. Since m=⌊2n/(r+1)⌋m=\lfloor2n/(r+1)\rfloor, we have m(r+1)≤2nm(r+1)\le2n; hence ⌈m(r+1)/2⌉≤n\lceil m(r+1)/2\rceil\le n because nn is an integer. We enlarge the one-blocks, rather than the zero gaps, until their total length is exactly n−mn-m. This is possible while keeping every ai≤r−1a_i\le r-1. Indeed, the preceding inequality gives

⌈m(r−1)2⌉≤n−m.\left\lceil\frac{m(r-1)}{2}\right\rceil\le n-m.

For the upper capacity, write

2n=m(r+1)+t,0≤t≤r.2n=m(r+1)+t,\qquad0\le t\le r.

Since m≥2m\ge2,

2(m(r−1)−(n−m))=m(r−1)−t≥2(r−1)−r=r−2≥0.2\bigl(m(r-1)-(n-m)\bigr)=m(r-1)-t\ge2(r-1)-r=r-2\ge0.

Hence

n−m≤m(r−1).n-m\le m(r-1).

Starting from the minimizing sequence, increase entries one unit at a time, never beyond r−1r-1, until their sum is n−mn-m. The inequalities ai+ai+1≥r−1a_i+a_{i+1}\ge r-1 are preserved. The resulting length-nn cyclic word

1a10 1a20⋯1am01^{a_1}0\,1^{a_2}0\cdots1^{a_m}0

has no run of rr ones, because every ai≤r−1a_i\le r-1, and hence is a 0-input. Flipping any displayed zero joins its two adjacent one-blocks into a run of length

ai+1+ai+1≥r,a_i+1+a_{i+1}\ge r,

so all mm displayed zeros are sensitive. Therefore

s0(Fn,r)≥m.s_0(F_{n,r})\ge m.

The upper and lower bounds agree.

Corollary 8.3. For (n,r)=(11,4)(n,r)=(11,4),

s(F11,4)=4.s(F_{11,4})=4.

Thus the cyclic run-threshold construction gives an explicit 11-variable rotation symmetric Boolean function of sensitivity 4.

Remark. The construction is an elementary cyclically invariant function, and the contribution here is the exact two-parameter formula above. Related asymptotic sensitivity questions for transitive functions appear in Chaubal and Gál [2]. In particular, choosing rr near the balance point r(r+1)≈2nr(r+1)\approx2n yields sensitivity of order n\sqrt{n} within this run-threshold family. This is not a lowest-known-sensitivity construction: Chakraborty [1] constructed cyclically invariant Boolean functions with sensitivity Θ(n1/3)\Theta(n^{1/3}).

Computational checks and reproducibility

The proofs of the principal results, including Theorem 7.6, do not rely on numerical certificates. The following finite checks are supplemental and can be reproduced independently.

For necklace multiplicities, enumerate each binary word x∈{0,1}nx \in\{0,1\}^{n} for 4≤n≤124 \le n \le12 and select one canonical representative (e.g., the lexicographically least cyclic rotation) per necklace XX. For each representative and each flip position ii, compute Y=[x(i)]Y=[x^{(i)}]. Count the coordinates jj for which [x(j)]=Y[x^{(j)}]=Y and compare with (hx+qi(x))/hx(i)(h_x+q_i(x))/h_{x^{(i)}}, where stabilizers and Dk(x)D_k(x) are computed directly from all nn rotations. This entails ∑n=412nN(n)=8,488\sum_{n=4}^{12}nN(n)=8,488 necklace/position tests. No numerical table is required by the proof.

The sensitivity of a Boolean function on nn variables is reproduced by examining every binary word xx and counting the coordinates ii for which f(x)≠f(x(i))f(x)\ne f(x^{(i)}). This gives a complete check of the exceptional quartic case n=5n=5 by evaluating its 252^5 words. The same method may independently test the exceptional value s(F6,13)=8s(F_{6,13})=8 and the quadratic and cyclic run-threshold formulas at any desired finite parameter ranges. The accompanying Python file implements the n=13n=13, d=6d=6 exhaustive check and reports a maximizing word. For a run-threshold function, evaluate whether a cyclic word has any run of rr consecutive ones. These optional tests are not part of the logical proof of the general theorems; the original exploratory scripts are not submitted as proof certificates; the supplied exceptional-case verifier is likewise supplementary.

Further questions

The necklace quotient graph and its flip-adjacency structure were studied previously [6], and the distance-two rotational structure used above overlaps the recent classification of Makhynko [8]. Our contribution is the explicit stabilizer/near-period expression for directed flip multiplicities and its sensitivity applications, not the existence of the quotient graph. Chakraborty’s work [1] addresses asymptotic sensitivity constructions and lower bounds for cyclically invariant functions. Chaubal and Gál [2] studied sensitivity bounds for transitive functions; our run-threshold result gives an exact formula for this particular cyclic Boolean family. To the best of our knowledge, the stabilizer/near-period multiplicity identity

m([x],[x(i)])=hx+qi(x)hx(i)m([x],[x^{(i)}])=\frac{h_x+q_i(x)}{h_{x^{(i)}}}

and the resulting complete odd-prime local sensitivity formulas have not previously been stated in this form.

The formulas suggest several further directions. In particular, the general quartic MRS problem remains open: determine the sensitivity of functions generated by

x0xaxbxcx_0x_ax_bx_c

for arbitrary 0<a<b<c<n0<a<b<c<n, including possible dependence on the arithmetic structure of the difference set of {0,a,b,c}\{0,a,b,c\} and on short rotational orbits. The general even-degree theorem treats consecutive supports of all even sizes, but not arbitrary nonconsecutive quartic supports.

Other directions include analogous closed forms for composite nn, structural characterizations of low-sensitivity rotation symmetric functions from weighted necklace boundaries, and comparisons with known asymptotic results for transitive and cyclically invariant Boolean functions.

Declarations

Not applicable.

Not applicable.

Availability of data and materials

No datasets were generated or analyzed in this study. The computational checks described in the manuscript can be reproduced from the procedures provided therein.

Competing interests

The authors declare that they have no competing interests.

Funding

Not applicable.

Authors’ contributions

Yuan Li and Jing Zhang contributed equally to the research, mathematical proofs, verification, and preparation of the manuscript. Both authors reviewed and approved the manuscript.

Acknowledgements

Not applicable.

Authors’ information (optional)

Not applicable.

Declaration of Generative AI Use

During the preparation of this manuscript, the authors used ChatGPT (OpenAI) to assist with language editing, literature exploration, computational verification, and the organization and presentation of mathematical arguments. The authors independently checked the mathematical statements, proofs, computational claims, references, and conclusions and take full responsibility for the content of the manuscript.

References

  1. [1]S. Chakraborty, On the sensitivity of cyclically-invariant Boolean functions, Discrete Mathematics & Theoretical Computer Science 13(4) (2011), 51–60. https://doi.org/10.46298/dmtcs.552.
  2. [2]A. Chaubal and A. Gál, Tight bounds on sensitivity and block sensitivity of some classes of transitive functions, Theoretical Computer Science 946 (2023), 113687. https://doi.org/10.1016/j.tcs.2022.12.037.
  3. [3]T. W. Cusick, Weight recursions for any rotation symmetric Boolean functions, IEEE Transactions on Information Theory 64 (2018), 2962–2968.arxiv.org/abs/1701.06648
  4. [4]T. W. Cusick and E. Cheon, Affine equivalence for cubic rotation symmetric Boolean functions with n = pq variables, Discrete Mathematics 327 (2014), 51–61. https://doi.org/10.1016/j.disc.2014.03.017.
  5. [5]T. W. Cusick and P. Stănică, Fast evaluation, weights and nonlinearity of rotation-symmetric functions, Discrete Mathematics 258 (2002), 289–301. https://doi.org/10.1016/S0012-365X(02)00354-0.
  6. [6]P. Gregor, S. Jäger, T. Mütze, J. Sawada, and K. Wille, Gray codes and symmetric chains, Journal of Combinatorial Theory, Series B 153 (2022), 31–60. https://doi.org/10.1016/j.jctb.2021.10.008.
  7. [7]Y. Li and J. Zhang, Block sensitivity and certificate complexity of rotation symmetric Boolean functions, arXiv:2610.17100 (2026). https://arxiv.org/abs/2610.17100.
  8. [8]M. Makhynko, Binary necklaces with minimum nontrivial rotational Hamming distance 2, arXiv:2606.08991 (2026). https://arxiv.org/abs/2606.08991.
  9. [9]P. Stănică and S. Maitra, Rotation symmetric Boolean functions—count and cryptographic properties, Discrete Applied Mathematics 156 (2008), 1567–1580. https://doi.org/10.1016/j.dam.2007.04.029.

Paper details

vlnc:W_k92jgr77
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC0-1.0
Usage

views · 7

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

ChatGPT (OpenAI)

View statement
Looking for related papers…
Contents