Posts

Showing posts with the label already

Lecture 5 Part 2 Forward Automatic Differentiation via Dual Numbers (old)

PROFESSOR: So you've already seen a little bit of the story of forward mode and reverse mode from Stephen last week. One version of the story is that you're multiplying derivatives, or Jacobian matrices, or something like that. And, of course, you've heard Stephen say that matrix multiplication is associative, and so you can go left to right or right to left, but it matters what order you go in terms of the complexity of the computation. That one order might be an n cubed computation, and another order might be an n squared computation. And so you saw an example of that. And in some fundamental sense, that describes the entire story of forward and reverse mode. But in a way, I feel like it hides more than it reveals. And the story is-- in some sense, the entire story can be reduced to that. But I feel like that's not enough to fully understand. And so I put together this example that I used in my class last semester. And I'm just going to pull it all o...

L3.1 Remarks on a 'good basis'

PROFESSOR: We have already begun with the degenerate perturbation theory. And we obtained the first result-- perhaps the most important result-- already. It came rather quick. And let me review what we had. So we were talking about the Hamiltonian H0 that had degeneracies. And we were now interested to see what the perturbation does to those degenerate states. What does it do to its energies? What does it do to the states themselves? So we called that degenerate subspace the space V capital N. And the rest of the state space of the theory was V hat. For those states in the degenerate space, we use a label n for being an n-th state or having energy En. They all have the same energy, unperturbed energy, En0. These are the states. And with k running from 1 to n-- these are a basis of linearly independent states that span the degenerate subspace. So that's our degenerate subspace. And then, the rest of the space is the space V hat. And it's spanned by states that we c...

L07.2 Conditional PMFs

We have already introduced the concept of the conditional PMF of a random variable, X, given an event A. We will now consider the case where we condition on the value of another random variable Y. That is, we let A be the event that some other random variable, Y, takes on a specific value, little y. In this case, we're talking about a conditional probability of the form shown here. The conditional probability-- that X takes on a specific value, given that the random variable Y takes on another specific value. And we use this notation to indicate those conditional probabilities. As usual, the subscripts indicate the situation that we're dealing with. That is, we're dealing with the distribution of the random variable X and we're conditioning on values of the other random variable, Y. Using the definition now of conditional probabilities this can be written as the probability that both events happen divided by the probability of the conditioning event. We ca...

3. Multiplication and Inverse Matrices

I've been multiplying matrices already, but certainly time for me to discuss the rules for matrix multiplication. And the interesting part is the many ways you can do it, and they all give the same answer. And they're all important. So matrix multiplication, and then, come inverses. So we mentioned the inverse of a matrix. That's a big deal. Lots to do about inverses and how to find them. Okay, so I'll begin with how to multiply two matrices. First way, okay, so suppose I have a matrix A multiplying a matrix B and -- giving me a result -- well, I could call it C. A times B. Okay. So, let me just review the rule for this entry. That's the entry in row i and column j. So that's the i j entry. Right there is C i j. We always write the row number and then the column number. So I might -- I might -- maybe I take it C 3 4, just to make it specific. So instead of i j, let me use numbers. C 3 4. So where does that come from, the three four entry? It comes ...

1.3.4 Working with Data - Video 2 Getting Started in R

You should have already downloaded and installed R on your computer. If you have not downloaded and installed R yet, please follow the instructions on the course website before continuing with this lecture. Once you've installed R, go ahead and start it. You should see the R console like we see here. This is where we'll type commands and perform data analysis. In this course, we'll mostly be working in the R console, but sometimes you'll also want to use what are known as "script files." We'll see an example of how to use a script file at the end of this lecture. In your R console, you'll always type commands after the arrow, or "greater than" sign. Let's start with some basic calculations. So with your cursor at the arrow, let's type 8, and then the star symbol for "times," the number 6, and hit Enter. You should see the result 48, or 8 times 6. In this way, R can be used as a basic calculator. We can perform ...