randVar() randRange(1, 29) randRange(A + 1, 30)

Solve for X:

X= B - A

A + X = B

Subtract A from both sides:

\qquad \begin{eqnarray} A + X &=& B \\ \\ A + X \red{- A} &=& B \red{- A} \end{eqnarray}

X + A = B

Subtract A from both sides:

\qquad \begin{eqnarray} X + A &=& B \\ \\ X + A \red{- A} &=& B \red{- A} \end{eqnarray}

B = A + X

Subtract A from both sides:

\qquad \begin{eqnarray} B &=& A + X \\ \\ B \red{- A} &=& A + X \red{- A} \end{eqnarray}

B = X + A

Subtract A from both sides:

\qquad \begin{eqnarray} B &=& X + A \\ \\ B \red{- A} &=& X + A \red{- A} \end{eqnarray}

Simplify.

\qquad X = B - A