The diffusion equation, which describes how particles spread from high to low concentration, can be derived from random walk models where particles move left, right, or stay in place with specific probabilities; by analyzing how probability distributions change over time and space, we find that the time derivative of concentration equals the second spatial derivative, meaning regions with higher curvature change more rapidly, causing concentrations to smooth out over time.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Diffusion - How Random Walks Lead to the Diffusion Equation
Added:petted one drop of dye to each glass of water here cold this is a little warmer than room temperature a bit warmer than room temperature this water is quite warm you can see the dye spreading out it's moving from a place of high concentration where the drop started to a place of lower concentration in the clear water formerly clear clearly temperature has some effect on how quickly the dye spreads out this process of dye spreading out from a place of high concentration to low concentration is called diffusion we've just seen an example of diffusion diffusion of food coloring in water of different temperatures and a question we might ask is how can we model that behavior with an equation we have a famous equation called the diffusion equation which looks like this it says that the first time derivative of some quantity P is proportional to the second spatial derivative of that quantity meaning the more curved this function is in space the more rapidly it changes in time so this function is going to increase in places where it's curved up decrease in places where it's curved down we'll see more about what that means shortly the question is how do random walks lead to the diffusion equation that we've just seen let's take a random walk if I roll ahead I'll step right if I roll a tail I'll step left and I'll take a walk of many steps so let's imagine we know the probability of a particle being located at some location X at time T and we know that probability throughout space we're going to keep track of it here I know the probability of being to the left at that same time T and let's call that location X minus DX so each of these boxes will be located a distance DX from each other here's the probability of being located at X plus DX etc all the way to probability of being located at zero at time T or being located at the full size of my system l at time T now we'd like to know how that probability changes in the future so we can tabulate the probabilities for a future time T plus DT one time step you can think of this in the future and what I'd really like to know is how do I get from the probability of being at X at time T to being at X at time T plus delta-t so how can I move into the future with this probability well at any given time depending on which direction I step there's a probability I step left let's call that probability K times DT and there's a probability I step right let's call that probability K times DT so I have equal probability of stepping left or right what is this K well I might have a certain preference for stepping versus staying in place so the third thing that could happen is I stay at the same location for one time step DT and this probability of stepping is proportional to DT physically that means the more time goes by the more likely I am to step further so if I add up the probabilities of stepping left stepping right and stepping Center since those are the only three possibilities these have to add up to one so if I have K DT plus K DT that's 2 K DT so this probability must be 1 minus 2 K DT so I have 2 K DTS a negative 2 k DTS and 1 these three add up to 1 this is going to be the same in our model at every location in space so I have the same three probabilities on the right here and of course the probability of studying located at location X is 1 minus 2 K DT since we're interested in the probability of getting to this location what we really want to know is only the probability of getting here and since this X is arbitrary we can make this equation apply to every location in space so let's get rid of things we don't care about and focus just on the location that matters well how do I end up at location X the only way I could end up at location X since I only go one step at a time is being located to the left or right of X or already being there those are the only three ways I can end up at X I hope you agree so these probabilities depend on the past probabilities I could say the probability of being located at X depends on the probability of being located to the left of x times the probability of stepping from the left to the location of interest X or the probability of already being there times the probability of staying there the third and only other possibility is the probability of being located to the right times the probability of stepping to the left to end up at this location so the probability of being at X at that future time T plus DT is the probability of coming there from the left which is the probability of already being at the left at that previous time times the probability of stepping plus the probability of already being there but staying plus the probability of being to the right but stepping to the left so we have three contributing probabilities to ending up at this location we'd like to see if we can separate this into some more meaningful derivative terms so let's split out this term P of X and T into two parts I'll split out these two factors here like so so I've taken the 1 times P of X T and the minus 2 K DT P of X and T so notice I've got time T here all of these are at time T and I have the center location here I have a combination involving the left point the right point and 2 times the middle point what can we do further to separate this out well I can move this P of X and T to the other side of the equation and group two terms that both relates to X but at different times and what I'm thinking when I do that is I want to see if I can get the time derivative to appear here so let's see if I can get an expression for the definition of the time derivative so I have moving this equation to the other side of the moving this term to the other side of the equation I've P of X and T plus DT minus P of X and T so I have a difference in time that's starting to look good I notice I have a DT over here that I'd really like to tuck under there and make this look like a derivative a change in P over a change in T so I know that's gonna be my next move let's take a look at how that works we move our DT down here so now I have a very nice expression that looks very much like the derivative of P with respect to T and over here I see that all my changes are in space not in time what you might recall is what we're looking for let's split this to P of X and T into two parts so I'm just subtracting that same P of X and T twice I can group each of those with one of these purple and green terms representing the change on the right and the change on the left let's see how that looks I have a nice right point here the right point minus the center point so that represents the slope of this P function in going from the red to the purple point the center to the right and here I have a difference between the red and the green but I notice I'd like to subtract this point going from Center to left so let's see if we can rearrange that I can regroup regroup these terms so I have P of x plus DX minus P of X and then I have subtracted from that P of X minus P of X minus DX so I'm taking a slope on the right with respect to X minus the slope on the left with respect to X now what do you call I know the slope is the first derivative so what's the change in slope well that's just the second derivative so here we have an expression that looks like the second derivative with respect to X of P the only thing missing is the denominator so I need a divided by DX squared so acknowledging that that's missing I'm saying all these terms in parentheses are the second derivative with respect to X so what's missing is a delta x squared in the denominator so I'm going to write it in the numerator to acknowledge if this were the derivative I'd need this term here and this is just going to be whatever my grid spacing is so if my grid spacing is 1 this term will be 1 if it's a hundreth in my code units then this term here would be a hundredth so a diffusion equation equates the time derivative here of P to the second spatial derivative what does that mean well that's summarized in a verse from Isaiah which says every Valley shall be exalted and every mountain and Hill shall be made low and the crooked shall be made straight and the rough places plain you didn't know Isaiah knew about diffusion another translation that's maybe even more closely related is fill in the valleys and level the mountains and Hills straighten the curves and smooth out the rough places let's see what that means in terms of this equation the equation says that the more curve to this function is so the second derivative the faster the equation will change faster the function P will change so if this is concave down here this is the place where its most concave down it'll also be the place where it's most quickly decreasing and here where the function is concave up positive curvature is going to lead to positive time derivative so this term is going to move so this is going to move the function up here and up here where it's also concave up so over time this function is going to become less extremely curved it's going to become more and more flat evening out the variation and that's what diffusion means so if this function represents the concentration of die if I drop food coloring right here it's going to spread out leading to a function that's closer to the average value of the function everywhere so what if we have an example with a valley well then I similarly know at this point that's concave down is going to decrease most rapidly concave up is going to increase locally here increase locally here here similarly this is concave down it's going to decrease concave up it's going to increase and so this function is going to become more and more smooth over time having less variation and that is how these random walks of the particles making up that solution lead to this equation describing it in a continuous way that we can build into a code and describe this behavior
Related Videos

Definition:Bounded variation and if f is monotonic on [a,b] then f is Bounded variation on [a,b]
wingsofmathematicsbytanush2507
4K views•2019-09-05

Prof Chris Holmes | Bayesian fitting and evaluation of complex models arising in...
uclfacultyofpopulationheal9290
564 views•2019-07-03

Patrick Landreman: A Crash Course in Applied Linear Algebra | PyData New York 2019
PyDataTV
9K views•2019-11-30

Approximating the Standard Deviation from Data of a Histogram
donnasmith8529
15K views•2019-09-26

HSC Maths Standard 2 | "At Least One" Probability Rule
ATARNotesHSC
697 views•2019-05-20

Spectral Sequences Live! 17: The Grothendieck spectral sequence
k-theory8604
395 views•2025-11-10

Structural Equation Modeling for Beginners
QuantFish
1K views•2025-09-30

Exploring Practical Applications of Linear and NonLinear Models In Business Research Dr.Jeelan Basha
MallikarjunaDKaggal
258 views•2025-05-26
Trending

YouTube Disabled Our Comments Again (Are Any Humans Left at YouTube?)
SpecialBooksbySpecialKids
39K views•2026-07-21

One Must Imagine Sisyphus Happy
vlogbrothers
61K views•2026-07-21

The Downfall of OnePlus!
techwiser
65K views•2026-07-21

The REAL History Behind The Odyssey Will BLOW Your Mind! It's NOT a Myth!
metatronyt
20K views•2026-07-21