In this video, we show how exact marginalization can be performed efficiently in tree-structured factor graphs by exploiting the tree-structure to interchange sums and products, resulting in a message-passing procedure called the Sum-Product algorithm.