 Hello everyone, this is Alice Gao. In the previous video, I gave you some high-level ideas about why we want to use the variable elimination algorithm. If we use this algorithm, we can compute a probability based on a Bayesian network more efficiently than if we were to use the joint distribution directly. In this video, let's talk about the details about the variable elimination algorithm. First of all, a bit of an introduction. Our goal with Bayesian networks is that we want to perform probabilistic inference. But unfortunately, performing probabilistic inference is challenging. It's a difficult problem. If we want to compute the posterior distribution of one or more query variables given some evidence, this problem is actually belongs to a complexity class called sharp NP. Even if we think about a simpler problem, if we want to estimate the posterior probability based on a Bayesian network within an absolute error, so we're not calculating it exactly, we're only estimating it given some error bound, this problem is already NP hard. So performing probabilistic inference is generally challenging and we cannot hope for a general efficient implementation to do this task. However, we have to do this task anyway. And there are two main approaches for probabilistic inference for Bayesian networks. Exact inference and approximate inference. The difference are exactly in the names. Either we calculate the probabilities exactly, or we do some approximation and allow us to make small mistakes, allow us to calculate the number within some error bound. In this course, I only have time to discuss exact inference, but you can refer to the textbook for algorithms on approximate inference. So in order to do exact inference to calculate the probabilities exactly, one naive approach is that we can take a look at the joint probability distribution or the Bayesian network, and then we can enumerate all of the worlds that are consistent with the evidence that we observe, right? All of the worlds where the values of the observed variables are same as what they should be. This is naive because it sounds like it's terribly inefficient. So we can do much better than this by making use of the variable elimination algorithm. We can do better with the variable elimination algorithm by taking advantage of two ideas. The first idea is that we are going to make use of the idea of dynamic programming. So when we're calculating probabilities, a lot of the results of intermediate calculations, we will use it multiple times. So in order to save time, we'll do those small intermediate calculations first, save the results, and then use the results later. So this avoids repeated calculations. And the second idea we're going to make use of is that we are using the Bayesian network, and the Bayesian network already explores conditional independence so that we need to specify fewer probabilities. So by making use of the Bayesian network and exploiting the conditional independence, we can do less work than directly using the joint distribution. Before we look at the details of the variable elimination algorithm, let me summarize it in one sentence. In the variable elimination algorithm, we will first define factors, then we will perform operations on these factors to get the results of the probabilistic inference that we want. I will first define what is a factor, and then after that I will discuss four different operations we can perform on factors. Restrict, sum out, multiply, and normalize. Let me conclude for this video. After watching this video, you should be able to do the following. Explain why we should not hope for a general efficient implementation of probabilistic inference for a Bayesian network. Explain why the variable elimination algorithm can be more efficient than the naive approach for exact inference. What ideas does the algorithm take advantage of to achieve the improved efficiency? Thank you very much for watching. I will see you in the next video. Bye for now.