How Many Ways to Color This Grid: Teaching Combinatorics Using R
The Problem
You have a 2x2 grid of squares, and you need to paint each square one of four colors: red, blue, green, or yellow. The restriction is that no two adjacent squares (sharing a side) can have the same color. How many valid ways you ca...