Analyzing the number of solutions to linear equations