Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Transfer matrix method. Here are some illustrating slides:
http://www.math.ucsd.edu/~gptesler/184a/slides/184a_ch10.3slides_14-handout.pdf
http://www.uwyo.edu/moorhouse/slides/transfer.pdf