Pattern Analysis: Algebraic Thinking