Short extract from a warmly recommended O'Reilly book entitled "BLAST":
http://fenyolab.org/presentations/Introduction_Biostatistics_Bioinformatics_2014/pdf/6_1.pdf