Chinese Remainder Theorem and linear congruences I have found the following congruences:


*

*$x \equiv 2\mod 5$

*$x \equiv 12\mod27$

*$x \equiv 2\mod4$


How can I solve for x using the Chinese Remainder Theorem? Please include justifications for the steps you take.
How can I find $x$?

I will assume that you are partly familiar with the machinery of CRT. 
We want to first find $a, b,c$ such that $a(27)(4)\equiv 1\pmod{5}$, and $b(5)(4)\equiv 1\pmod{27}$, and $c(5)(27)\equiv 1\pmod{7}$. Then a solution of our system of congruences is 
$$x=2(a)(27)(4)+12(b)(5)(4)+2(c)(5)(27).$$
It may be that the $x$ we obtain is kind of large, and we may want to replace it by something congruent to it modulo $(5)(27)(4)=540$ that is, say, in the interval $[0,539]$.
Let's find suitable $a$, $b$, and $c$. In general for this work, and with large moduli, we would use the Extended Euclidean Algorithm. Let's not bother, since we are concentrating on CRT. 
For $a$, work modulo $5$.  Since $27$ is congruent to $2$, we want $8a\equiv 1\pmod{5}$, or equivalently $3a\equiv 1\pmod{5}$. So we can take $a=2$. Or maybe $a=-3$. Doesn't matter.
For $b$, we want $20b\equiv 1\pmod{27}$. Slightly unpleasant, but note that $(20)(4)\equiv -1\pmod{27}$, so we can take $b=-4$.
For $c$, the modulus is tiny. We want $c(5)(27)\equiv 1\pmod{4}$. But $5$ is congruent to $1$, and $27$ is congruent to $3$, so we can take $c=3$.
Remark: But we can take a bit of a shortcut. Note that we wanted $x\equiv 2\pmod{5}$ and $x\equiv 2\pmod{4}$. This is the case iff $x\equiv 2\pmod{20}$. So we want to solve the system of congruences $x\equiv 2\pmod{20}$, $x\equiv 12\pmod{27}$. This is a two congruence CRT problem. We find $a$ and $b$ such that $a(27)\equiv 1\pmod{20}$ and $b(20)\equiv 1\pmod{27}$. Then we can take 
$$x=2(a)(27)+12(b)(20).$$
For $a$, it is clear that $3$ will do. For $b$, $-4$ works. This gives answer 
$2(3)(27)+12(-4)(20)$. For something in the range $[0.539]$, add $(2)(540)$. We get $x=282$. So the general solution is $x\equiv 282\pmod{540}$. 
