Open balls in sequence space Define open balls in a metric space: $B_r(a)=\{x∈X:d(x,a)<r\}$
Let $X = \prod _1 ^\infty \{0,1\}$ be the space of all sequences of 0's and 1's. Let $X$ have the metric: for $x\not = y$ let $k(x,y)$ be the first index where $x$ and $y$ differ. Then set set $d(x,y) = 2^{-{k(x,y)}}$ if $x\not = y$ (and $d(x,x) = 0$). Let $x,y \in X$ and let $r > 0$.
(a) Prove that if $d(x,y) \geq r$ then $B_r(x) \cap B_r(y) = \emptyset$
(b) Prove that if $d(x,y) < r$ then $B_r(x) = B_r(y)$. 
For starters, I'm having trouble understanding how the metric space is defined. Is $k(x,y)$ an integer? 
For part (a) it's obvious that if $d(x,y) \geq r$ the definition of open balls is violated so neither $B_r(x)$ or $B_r(y)$ would have any elements. Right? But how would I write that as a proper proof?
For part (b) I don't see why  $d(x,y) < r$ necessarily implies $B_r(x) = B_r(y)$, so an explanation would be helpful. I would guess that a contradiction would be the best way to prove part b, but if there's a more intuitive way please let me know. Would the ultrametric inequality be useful here?
Thanks
Fixed some typos
 A: First, yes, $k(x,y)$ is allways in integer, note that $x$ and $y%$ are sequences $x = (x_n)$ and $y=(y_n)$ of zeros and ones, we define 
$$ k(x,y) := \min\{n \in \mathbb N \mid x_n \ne y_n \} $$
So for example 
\begin{align*}
  k(000\ldots, 100\ldots) &= 1\\
  k(000\ldots, 010\ldots) &= 2
\end{align*}
Now for (a) and (b): I do not quite understand what you write for (a), you say that if $d(x,y) \ge r$ we have $y \not\in B_r(x)$, but why there cannot be any elements $a \in X$ with $d(a,x)< r$ and $d(a,y) < r$? 
To answer (a) and (b) it is helpful to note that $d$ is a so called ultrametric, that is, we have the (stronger than usual) triangle inequality 
$$ d(x,z) \le \max\bigl\{d(x,y), d(y,z)\bigr\} $$
To prove that, note that if $x=z$ there is nothing to prove, otherwise let $n = k(x,z)$. As $x_n \ne z_n$ we cannot have both $x_n = y_n$ and $y_n = z_n$ so either $n \le k(x,y)$ or $n \le k(y,z)$. So 
$$ 2^{-n} = d(x,z) \ge \max\{2^{-k(y,z)}, 2^{-k(x,z)}\} $$
Now for (a): Suppose $a \in B_r(x) \cap B_r(y)$. Then 
$$ d(x,y) \le \max\{d(x,a), d(y,a)\} < r. $$
Contradiction. 
For (b): Let $a \in B_r(x)$, then 
$$ d(a,y) \le \max\{d(x,y), d(x,a)\} < r, $$
so $a \in B_r(y)$. By symmetry, we are done.
