How do I divide the columns of a matrix by the sum of its elements?
You can use Normalize
with its second argument for this purpose:
(mat = Normalize[#, Total] & /@ Transpose@L // Transpose) // MatrixForm
Instead, if you were normalizing the rows by the sum of their elements, you could simply leave out the transposes and do
mat = Normalize[#, Total] & /@ L
or even
mat = #/Tr@#& /@ L
For your specific problem (transition matrix), you can use the new Markov process related functions in version 9 to get the transition matrix:
With[{m = DiscreteMarkovProcess[, L]},
mat = MarkovProcessProperties[m, "TransitionMatrix"]
] // MatrixForm
If you need to do this with all columns, then:
Transpose[#/Total[#] & /@ Transpose[L]]
Why transpose when you don't have to?
#/Total[L] & /@ L
(Just resurrecting this for a bit of "code golf.")