1
$\begingroup$

I've been reading papers on streaming algorithms and ran across the following question which I haven't been able to answer: Consider the Dyck language $Dyck(2)$ over the alphabet $A = \{(,),[,]\}$ and let $f_n:A^n\times A^n \to \{0,1\}: f_n(x,y) = 1 \text{ if } xy\in Dyck(2)$ and 0 otherwise. Suppose two parties Alice and Bob are given two n-bit strings $x,y.$ The communication complexity $C(f)$ of $Dyck(2)$ is defined as the minimum number of bits the two parties must exchange to compute $f_n(x,y).$

My question: what is known about $C(f)$? Can we prove any reasonable bounds?

$\endgroup$

1 Answer 1

1
$\begingroup$

TL;DR: $n \le C(f) \le n+1$.

We can easily prove that $C(f) \ge n$. Consider the set of $x \in \{(,[\}^n$. There are $2^n$ such $x$-values. Each matches a different set of $y$-values. So, you need to send at least $n$ bits to distinguish among these $x$-values.

Also, we trivially have $C(f) \le 2n$, as there are only $2^{2n}$ different values for $x$.

We can obtain a better upper bound on $C(f)$, as follows. Let the signature of $x$ be the shortest string $x'$ such that, for all $y$, $xy \in \text{Dyck}(2)$ iff $x'y \in \text{Dyck}(2)$. Then every signature $x$' is in $\{[,(\}^{\le n}$, i.e., it uses only ['s and ('s and has length at most $n$. Let $N$ count the number of strings in $\{[,(\}^{\le n}$, i.e.,

$$N = \sum_{i+j \le n} {i+j \choose i},$$

where the sum is over all $i,j \in \mathbb{N}$ such that $i+j \le n$. Here $i$ counts the number of ['s in $x'$, and $j$ counts the number of ('s in $x'$. Letting $k=i+j$, we can calculate

$$N = \sum_{k=0}^n \sum_{i=0}^k {k \choose i} = \sum_{k=0}^n 2^k = 2^{n+1}-1.$$

Now since every signature is one of these strings, there are at most $N$ different signatures. A valid strategy is for Alice to send the signature of $x$ to Bob (or Bob to send the signature of $y$ to Alice), and that contains everything needed to compute the answer. Since there are at most $N$ different signatures, we have $C(f) \le \lg N = \lg (2^{n+1}-1)$, so $C(f) \le n+1$.

$\endgroup$
4
  • $\begingroup$ Looks like you've already done all the work for the lower bound being $\lg (2^{n+1}-1)$, too. $\endgroup$ Commented Nov 23, 2023 at 11:30
  • $\begingroup$ @Kai, sorry for the imprecise wording. That's not a lower bound. There are strings in $\{[,(\}^{\le n}$ that are not a possible signature. e.g., for $n=3$, $[($ is not a possible signature, i.e., there is no string $x$ of length 3 whose signature is $[($. Consequently, $2^{n+1}-1$ is an upper bound on the number of different signatures but not a lower bound. $\endgroup$ Commented Nov 24, 2023 at 22:08
  • $\begingroup$ The wording is fine, my thinking wasn't. I interpret your signatures roughly as "what's on the stack of a PDA for Dyck$(2)$". We ought to exclude those signatures $x$ for which there's no matching $y\in A^n$. If I'm not mistaken, they are the $x$ with an odd $n - |x|$. Sadly, I'm not aware of a closed form for $\sum_{i+j\le n\\ n-i-j\bmod 2 = 0}{i+j\choose i}$. $\endgroup$ Commented Nov 26, 2023 at 12:08
  • $\begingroup$ oeis.org/A000975 $\endgroup$ Commented Nov 26, 2023 at 14:24

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.