4
$\begingroup$

An NAF is a non-adjacent form of a positive integer $k$.

enter image description here

One of the five properties of NAFs is "The average density of non-zero digits among all NAFs of length $l$ is approximately $1/3$."

How to prove it?

Thanks.

$\endgroup$
3
  • $\begingroup$ If you don't know how to prove it, how do you know it's true? $\endgroup$ Commented Sep 13, 2020 at 0:41
  • $\begingroup$ It seems this is Theorem 3.29 in D. Hankerson, A. Menezes, S. Vanstone, Guide to Elliptic Curve Cryptography, Springer, New York (2004). Perhaps the authors give a proof. $\endgroup$ Commented Sep 13, 2020 at 0:47
  • $\begingroup$ OK, it seems you are quoting from that book – it would have been nice of you to cite your source. The Theorem is on page 98, but no proof is given there. $\endgroup$ Commented Sep 13, 2020 at 0:55

1 Answer 1

3
$\begingroup$

The number of NAFs of length $n$ and $k$ nonzero digits is equal to $2^{k-1}\binom{n-k}{k}$. Therefore the total number of NAFs of length $n$ is $$A_n=\sum_{k\geq 0} 2^{k-1}\binom{n-k}{k}$$ and the total number of nonzero digits that appear in the set of all NAFs of length $n$ is $$B_n=\sum_{k\geq 0} k\cdot2^{k-1}\binom{n-k}{k}.$$ Now, the density you seek is given by $\frac{B_n}{nA_n}$ and perhaps there is a slick way to get the approximation quickly, but a boring way is to proceed by determining this value exactly.

You can routinely check the recurrence relations satisfied by both $A_n$ and $B_n$, or their generating functions. We have $$\sum_{n\geq 0}A_{n+1}x^{n}=\frac{1}{1-x-2x^2}$$ $$\sum_{n\geq 0} B_{n+1}x^n=\frac{1-x}{(1-x-2x^2)^2}$$ from which you can deduce explicit formulas for each sequence. You'll find $$A_n=\frac{2^n-(-1)^n}{3} \, , \, B_n=\frac{n2^{n}}{9}+O(2^n)$$ which means that the average density of nonzero digits is $B_n/nA_n=\frac{1}{3}+O(1/n)$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .