The main thing that you're trying to do is create Hamiltonians whose ground states have a correspondence to basis vectors $|x\rangle$. So, the point of an operator
$$
R=\frac12(1-Z)=\left(\begin{array}{cc} 0 & 0 \\ 0 & 1 \end{array}\right)
$$
is that it has two eigenvectors $|0\rangle$ and $|1\rangle$, so $R$ has a ground state $|0\rangle$ and $-R$ has a ground state $|1\rangle$. The 0 and 1 are the things you're trying to directly correspond to binary variables.

You might ask why one bothers to include the $I$ term as that only shifts the eigenvalues, it doesn't change the eigenvectors. Usually it's just for convenience. People often like to have the ground state to have 0 energy (in which case, you'd use $\frac12(I+Z)$ instead of $-R$ to get the $|1\rangle$ state as a ground state).

So, let's say I want to create a ground state corresponding to the binary string $x=01$. I can use a Hamiltonian $H=R_1-R_2$. (This is obviously diagonal, so the computational basis states are all eigenstates). In general, for any $x\in\{0,1\}^n$, I can use
$$
H=\sum_{i=1}^n(-1)^{x_i}R_i
$$
to make the ground state $|x\rangle$. (There are several other ways that we could construct a Hamiltonian with the correct ground state, but this is a particularly simple one.)

This is then the starting point of developing some logic. Let's say we don't know what basis state we want to be the ground state, but we want it to satisfy $x_1=x_2$. You could do something like $\frac12(I-Z_1Z_2)$. You find a ground state (with energy 0), perhaps $|11\rangle$, and that tells you $x=11$ is a solution to $x_1=x_2$.

If we take this a little further, you could ask if there's a satisfying formula $x_1=x_2$, $x_2=x_3$ and $x_3\neq x_1$ (OK, obviously not, but with more complex formulae, it's not so obvious).
You'd set up a Hamiltonian
$$
H=\frac12(I-Z_1Z_2)+\frac12(I-Z_2Z_3)+\frac12(I+Z_1Z_3),
$$
and ask if it has a 0 energy eigenvalue. If not, there are no solutions to the given conditions. If so, the corresponding basis vector gives you a satisfying $x$.

Could you post the QAOA tutorial you are following? Would make it easier to explain if we know how they are discussing things. – Dripto Debroy – 2020-06-09T03:14:34.710

This answer might be interesting https://quantumcomputing.stackexchange.com/a/11665/9459

– Davit Khachatryan – 2020-06-09T07:09:12.167Just edited and added the tutorial. (=> https://qiskit.org/textbook/ch-applications/qaoa.html)

– César Leonardo Clemente López – 2020-06-09T22:18:25.370