[Tex/LaTex] tikz – drawing a timeline with intervals

tikz-pgf

I would like to obtain a tikz picture that looks like the following.
Can you help me to complete my code to achieve that result?

enter image description here

\documentclass[11pt]{article}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}

\begin{document}

   \begin{tikzpicture}[x=50]
       \draw (-0.2,0) -- (1.2,0);      
       \draw (0, 0) node[below=7pt] {$a_1$};
       \draw[] (0,-0.1) -- (0,0.1);
       \draw (1, 0) node[below=7pt] {$a_2$};       
       \draw[] (1,-0.1) -- (1,0.1);
   \end{tikzpicture}

\end{document}

EDIT

I like @Qrrbrbirlbel's proposal, but I would like to make the "[" and ")" symbols a little bit larger. Any idea?

Best Answer

You can adjust the size to what you prefer (update removes a superfluous line, left-over from initial code).

\documentclass[border=6pt,tikz]{standalone}
\usepackage[T1]{fontenc}    % better to have fontenc *before* inputenc
\usepackage[utf8]{inputenc}

\usepackage[english]{babel}


\usepackage{tikz}

\begin{document}
  \begin{tikzpicture}
       \draw (-0.2,0) -- (1.2,0); 
       \draw [thick] (0.1,-.25) -- (0,-.25) -- (0,.25) -- (0.1,.25);     
       \draw (0,-.25) node [anchor=north] {$a_1$};
       \draw (1,-.25) node [anchor=north] {$a_2$};       
       \draw [thick] (0.7,-.25) .. controls (1.05,-0.2) and (1.05,0.2)
                                .. (0.7,.25);
   \end{tikzpicture}
\end{document}

tikz exercise