Posts

Showing posts with the label seen

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...

L25.11 Birth-Death Processes - Part II

So we have just seen that a clever trick based on the frequency interpretation of the transitions between successive states, like here, allows us to write a simple set of equations which can be solved recursively, given here, giving pi i plus 1 as a function of pi of i. More specifically, we have pi i plus 1 equals pi of i times p of i. Divide by q of i plus 1. And this is true for i equal 0 up to m. And to start the recursion, we need to find pi of 0. And this can be done using this normalization condition-- which leads to pi of 0 times 1 plus p0 over q1 plus et cetera equals 1. Let's illustrate the details of this procedure on a special case. Let's assume that all the p's are the same and all the q's are the same. So this is a special case in which we are interested. So at each point in time, if we are somewhere in the middle, you have probability p of moving up, and probability q of moving down. Define rho to be the ratio of p over q. Rho can be interpr...

L10.9 Mixed Bayes Rule

We have seen two versions of the Bayes rule-- one involving two discrete random variables, and another that involves two continuous random variables. But there are many situations in real life when one has to deal simultaneously with discrete and continuous random variables. For example, you may want to recover a discrete digital signal that was sent to you, but the signal has been corrupted by continuous noise so that your observation is a continuous random variable. So suppose that we have a discrete random variable K, and another continuous random variable, Y. In order to get a variant of the Bayes rule that applies to this situation, we will proceed as in the more standard cases. We will use the multiplication rule twice to get two alternative expressions for the probability of two events happening. We will equate those expressions, and from these, derive a version of the Bayes rule. So we will look at the probability that the discrete random variable takes on a certa...

L08.7 Cumulative Distribution Functions

We have seen that several properties, such as, for example, linearity of expectations, are common for discrete and continuous random variables. For this reason, it would be nice to have a way of talking about the distribution of all kinds of random variables without having to keep making a distinction between the different types-- discrete or continuous. This leads us to describe the distribution of a random variable in a new way, in terms of a so-called cumulative distribution function or CDF for short. A CDF is defined as follows. The CDF is a function of a single argument, which we denote by little x in this case. And it gives us the probability that the random variable takes a value less than or equal to this particular little x. We will always use uppercase Fs to indicate CDFs. And we will always have some subscripts that indicate which random variable we're talking about. The beauty of the CDF is that it just involves a probability-- a concept that is well defin...

L01.9 Countable Additivity

We have seen so far an example of a probability law on a discrete and finite sample space as well as an example with an infinite and continuous sample space. Let us now look at an example involving a discrete but infinite sample space. We carry out an experiment whose outcome is an arbitrary positive integer. As an example of such an experiment, suppose that we keep tossing a coin and the outcome is the number of tosses until we observe heads for the first time. The first heads might appear in the first toss or the second or the third, and so on. So in this example, any positive integer is possible. And so our sample space is infinite. Let us not specify a probability law. A probability law should determine the probability of every event, of every subset of the sample space. That is, the probability of every set of positive integers. But instead I will just tell you the probability of events that contain a single element. I'm going to tell you that there is probabilit...

2.7.3 Representing Partial Orders As Subset Relations Video

PROFESSOR: So we've seen that partial orders are a set of axioms that capture the positive path relation or the arbitrary path relation in directed acyclic graphs, or DAGs. But there's still another way to understand these axioms that gives a kind of representation theorem for the kind of mathematical objects that are partial orders and that every partial order looks like. So let's look at that example. I'm interested in the proper subset relation. A is a proper subset of B, which, you remember, means that B has everything in it that A has and something extra. So in particular, since B has something extra, B is not a subset of A, certainly not a proper subset of A. So let's look at an example of that. Here are seven sets, and the arrows indicate the proper subset relation. Or more precisely, the positive path relation in this graph represents the proper subset relation where edges are understood to be pointing upwards. So I've left out the arrowhea...

2.11.1 Stable Matching Video

We've seen graphs involving boys and girls and connections between them in the context of our sexual demographics calculation and study. A similar problem comes up in terms of what I call stable matching, which is again the issue of matching up boys and girls in a special way according to some constraints. It turns out to have a lot of applications which we'll discuss toward the end. Let's just look at what the problem is. The setup is that there's some number of boys, in this case 5, 1 through 5, and an equal number of girls labeled A through E. And each of the boys has a ranking of the girls. Different rankings, because different boys have different preferences. And likewise, the girls have rankings of the boys. Different girls have different preferences. So here, girl A likes boy 3 best and boy 5 second best, and boy 1 likes girls C best and girl D least. So the problem, basically, is that we want to get all the boys married to all the girls. We want to...

13.2 Differential Analysis of a Massive Rope

We've seen previously that if a rope is under tension and we approximate the rope is massless that the tension is then uniform everywhere along the rope, even if the rope is accelerated. However, if the rope has nonzero mass, then its tension will vary along its length. We can see that by looking at this example. Imagine we have a massive rope of length l suspended from a ceiling. Now, it's easy to see that, at the top of the rope, a little element of rope right at the top has to support the entire weight of the entire rope. So if I were to examine just a little piece at the top here, the weight of the entire rope would be acting downwards. And for the rope to remain stationary, there has to be a tension upward. I'll call this t-top, because this is at the top of the rope. And so we see immediately from that that at the top of the rope, the tension is just equal to mg, where m is the mass of the entire rope. Similarly, if we asked what the tension is at the bo...

1.7.1 Relations Video

PROFESSOR: We've seen a lot of functions in introductory calculus-- trig functions, rational functions, exponentials, logs and so on. I don't know whether your calculus course has included a general discussion of functions. The old fashioned ones didn't, and we will go into that now in this segment. And we're going to be interpreting functions as a special case of binary relations. So let's just say what a binary relation is. A binary relation is a mathematical object that associates elements of one set called the domain with elements of another set called the codomain. And I'm going to give you a bunch of examples of binary relations in a short moment, but let's just talk about what they're for and what their role is. So they may be familiar to you as computer scientists if you've worked with any relational databases like SQL or MySQL. MySQL. And we'll see an example that indicates where the original ideas behind those relational d...