Separating Words with Small Grammars

We study the following problem: given two words w and x, with jwj; jxj n, what is the size of the smallest context-free grammar G which generates exactly one of fw; xg? If jwj 6 = jxj, then we prove there exists a G separating w from x of size O(log log n), and this bound is best possible. If jwj = jxj, then we get an upper bound on the size of G of O(log n), and a lower bound of (logn loglog n).