Computing information about a Lie algebra from cartan matrix
Let's consider the Cartan matrix : $$ \begin{pmatrix} 2 & -2 \\ -1 & 2 \end{pmatrix} $$
I am asked to find the number of roots and then to compute character of the adjoint representation.
I know that from this answer : How to determine the number of roots and the dimension of a Lie algebra using Cartan matrix that we can find the result about the dimension from the classifications of Cartan matrices. But in class we didn't do this (and we wont) so I'm wondering how do you do this by hand ?
This is not homework but a past exam (maybe that year they did more things on the classification of Cartan matrices but I don't think so).
Before calculating this by hand, I suggest that you should recognize this as the Cartan matrix of the simple Lie algebra of type $B_2$. It has two simple roots $\alpha_1$ and $\alpha_2$, and the set of positive roots is $\Phi^+=\{\alpha_1,2\alpha_1+\alpha_2,\alpha_1+\alpha_2,\alpha_2\}$, and $\Phi=\Phi^+\sqcup(-\Phi^+)$. From this, the character of the adjoint representation is just $$\sum_{\alpha\in\Phi}e^\alpha$$ which you can write out if you'd like.
Now, let's say you don't know the fact above by heart (but you should). The first thing to notice is that the size of the Cartan matrix tells you how many simple roots you are dealing with. Since the matrix is $2\times 2$, you get two simple roots as above.
The next thing to look at is the entries in the Cartan matrix. These are going to tell you how to make new roots from roots you've already found. The procedure is as follows:
(1) For $i\neq j$, set $r_{ij}=-a_{ij}$. Then $\alpha_j,\alpha_j+\alpha_i,\ldots,\alpha_j+r_{ij}\alpha_i\in\Phi^+$ (called the $\alpha_i$ root string through $\alpha_j$).
(2) Suppose $\beta=\lambda_1\alpha_1+\lambda_2\alpha_2\in\Phi^+$ has been constructed, and for some $i\in\{1,2\}$, $\beta$ has not occured in an $\alpha_i$-root string of a previously constructed root. Set $r_i=-(\lambda_1a_{i1}+\lambda_2a_{i2})$. If $r_i>0$, then $\beta,\beta+\alpha_i,\ldots,\beta+r_i\alpha_i\in\Phi^+$.
(3) If the Cartan matrix is positive definite, this process will terminate.
The entry $a_{12}=-2$, which tells me that the length of the $\alpha_1$ root string through $\alpha_2$ is 2. Therefore, I read that $\alpha_2$, $\alpha_1+\alpha_2$, and $2\alpha_1+\alpha_2$ are positive roots. The entry $a_{21}=-1$ tells me that the $\alpha_2$ root string through $\alpha_1$ has length 1, so this produces positive roots $\alpha_1$ and $\alpha_1+\alpha_2$.
Since $\alpha_1+\alpha_2$ was obtained from an $\alpha_1$ root string through $\alpha_2$ (and vice versa), it will not produce any new roots from this procedure. Therefore, all that is left to check is the $\alpha_2$ root string through $2\alpha_1+\alpha_2$, which will have length $-(2a_{21}+a_{22})=-(-2+2)=0$. So I get no new roots.
Since the rank of the roots system is 2, we are done: $\Phi^+$ is as above. In higher rank, the analysis gets more complicated, which is why it is nice to have a classification. There are also nice ways of reading $\Phi^+$ off of the corresponding Dynkin diagram (at least in classical type), but you're not really going to understand that until you are comfortable with the classification.
Incidentally, for a concrete description of the roots system in question, take $\epsilon_1$ and $\epsilon_2$ to be the coordinate basis for $\mathbb{R}^2$. Then $\alpha_1=\epsilon_1$ and $\alpha_2=\epsilon_2-\epsilon_1$. When you graph the root system you will see that the corresponding Weyl group is the symmetry group of a square.
As an exercise, you may try to perform the above analysis with the matrices $$\begin{pmatrix}2&-1\\-1&2\end{pmatrix}\;\;\;\mbox{and}\;\;\;\begin{pmatrix}2&-3\\-1&2\end{pmatrix}$$ As a hint, the first matrix will yield 3 positive roots, while the second will give you 6 positive roots.
I cannot add much to David's answer except for a comment - the first thing to notice is that the given Cartan matrix has size $2$, which means that we are looking for a root system in $\mathbb{R}^2$, i.e., for a simple Lie algebra of rank $2$. So we can start with two linear independent vectors $\alpha$ and $\beta$ in $\mathbb{R}^2$, and try to obtain the given Cartan numbers $\langle \alpha,\beta^{\vee}\rangle =-1$, $\langle \beta,\alpha^{\vee}\rangle =-2$ and $\langle \alpha,\alpha^{\vee}\rangle =\langle \beta,\beta^{\vee}\rangle =2$. A short computation with the scalar product gives a solution: $$ \alpha=\begin{pmatrix}-1 \cr 1 \end{pmatrix},\; \beta=\begin{pmatrix} 1 \cr 0 \end{pmatrix}. $$ Then, using the root system axioms we immediately obtain $$ \Phi=\{\pm \alpha, \pm\beta, \pm (\alpha+\beta), \pm (\alpha+2\beta)\}. $$ We have $8$ roots, and, as David already said, this root system is known as $B_2$.