In the video lecture, we talk about a hospital with 400 heart attack patients of whom 72 die within 30 days and 328 are still alive. Let's plot the likelihood function for this example. The likelihood is a function of the mortality rate data. We could use either a binomial likelihood or a Bernoulli likelihood. They are the same other than a constant term in the front, the combinatoric term for the binomial that does not depend on theta. So we'll get the same answer either way, and it's easier to use the Bernoulli likelihood. We can plot this in Excel. We'll need to create a column of theta values and a column of likelihood values. For the theta values, we'll want it to go from 0.01, up to 0.99, in increments of 0.01. We can create this column, by using the Fill command. Edit > Fill > Series. We want to put the series in a column. We'll grow linearly, have a step value of 0.01, and go all the way up to the value of 0.99. So now, Excel has filled it in, from 0.01 up to 0.99. For the likelihood, we'll create a function. So we start with the equal sign to create a function. And cis theta to the y times 1 minus theta to the n minus y. The value of theta we're going to plug in is the value in the adjacent column. We take this to the y power, in this case y is 72. We'll multiply this by 1 minus theta. To the n minus y, where n is 400 and y is 72. We have this formula now defined for the first row. What we can do is we can copy this formula and then paste it in to all the remaining cells. Excel has now filled in the likelihood values for us and recomputed them for each of the possible theta values. In order to make a plot of this, we'll use a chart. So I'll highlight the column with the likelihood values. Go to Charts, choose a line chart, and do a basic line chart. If you look carefully, you'll be able to see that the likelihood function is maximized at 0.18 or 72 over 400. This is the maximum likelihood estimate. You could also do the same with the log likelihood. This formula is going to be y times the log of theta plus n minus y times the log of 1 minus theta. So we can enter this as a formula in Excel that equals y is 72 times the log of theta value from this row. Plus. N minus y times the log of 1 minus the theta value. Again, we can copy that into the remaining cells. Paste. We highlight this column and create a line chart for the log likelihood. It's a little bit harder to see, but the log likelihood is also maximized at 0.18.