Exact solutions of master equations for the analysis of gene transcription models