Expected Value and Variance of Continuous Random Variables (Calculus)
Skills:
ML Maths Basics90%
Key Takeaways
This video covers the calculation of expected value and variance for continuous random variables using calculus, with a focus on probability density functions and integrals.
Full Transcript
so in this video we'll be looking at the expected value and variance for continuous random variables so we're going to use the basis um if you haven't watched the discrete random variables video i suggest you watch that because we've been using that uh that math and applying calculus with it so let's get started so first off they're going to give you a probability density function so let's just give a example one so let's say f of x which is our probability density function is gonna be x over eight and let's draw a small graph for us to look at just the positive section so this just goes off like this so that's x over 8 but it's going to be limited because a probability density function the area under it bounded has to add up to 1. that's the definition of probability density function so uh let's say it starts at zero and ends at some value t and then the all the area under it has to add up to one so what what is that t value so if we just integrate this we find that the t value equals four so here it is and indeed without any calculus we can even we can just tell that um from zero to four this is one because it's a triangle right right triangle so base times height over two so four times and what is f of 4 one half so 4 times 1 half is 2 divided by 2 is 1 so it works out so this is our probability density function right here now the expected value remember in the discrete ones it was the sum of each of those x i's times the probability of x i from i goes to 0 to i goes to you know whatever value it's the same idea here but since there's infinitely many values to choose from now not there's uh there's not just zero one two three four there's zero there's point one point two and all the values in between you know there's all the values we have to use calculus because we have to get infinitely small so but the idea is the same we want to multiply each of these x values by their respective probabilities so it's going to be x times f of x which is the probability you can call this p of x if you like but i'll call f of x so it's this and you have to add them all up you have to add the infinite many of them up from zero to four and put a dx so uh that it's not that hard to do because f of x is x over eight so i'll just take this one eighth actually out times x so this becomes x squared so it just becomes one third x cubed and remember there's one eighth so it becomes 1 24th x cubed so let's get rid of all of this so 1 24 x cubed from 0 to 4 and 4 cubed is 64 so equals 64 over 24 which we could just reduce to eight over three so easy enough we just found our expected value of our continuous probability function so we can say e x equals eight over three so good enough good easy enough so now we're gonna put that aside and we're gonna do the variance the variance is a little harder but it's not that bad once we're gonna derive a formula for it which is gonna make our lives a lot easier so variance what is variance remember when we did the um discrete random variables it was uh it was basically x i minus e squared times uh f of x right it's the same idea here except we have the infinite calculus base thing going on so it's going to be the integral um the integral from 0 to 4 in this case or let's just keep it general we'll call a to b of x minus e squared times f of x dx okay so uh this might be a little uh not good to work with for a lot of problems because of the whole x minus e so we're going to use this to derive an easier form of this equation which we'll use to find the answer to our original problem so here is the equation if you want to look at it now what are we going to do what are we going to do with this so we're going to have to play with a little bit so let's factor this out first so it's going to be x squared minus 2 e x plus e squared times f of x so i'm going to just play with the inside we'll put the integral signs back on afterward when we need to um what do we do now so we're going to factor this all expanded so x squared f of x minus 2 e um e yeah 2ex f of x plus oh we're going low here let me uh let me write this above actually so let's get rid of this and let's go back up here so we're gonna go back up here we're gonna say uh x squared f of x minus two e e times x this is not e of x this is e times x plus uh times f of x plus e squared f of x okay good back on track so then we'll get rid of this and now this let's put aside because this is something we'll use and then remember this is all an integral sign so this is we have so far integral of x squared f of x dx minus integral of and this minus i'm going to take out so it's going to be 2e x f of x minus e squared f of x and put that in brackets or something and dx okay so now this looks a little nasty but it's going to look really nice afterwards so see there's an e in both so we're going to pull the e out so minus e so let's get we can get rid of one e on each of them and then what else can we do so we're going to break this integral up further so minus let's just take this down so this is going to look like 2 integral x f of x dx which is this i take the two out minus integral uh e f of x and we can take this e out since it's a constant dx okay so uh that's what we have so far and see this right here this integral right here is just e that's how i calculated e so we can replace the whole thing with just e and see this integral right here this has to be one because of the definition of a continuous probability function so this we can just replace with one so reality all we have here is two e minus e which just gives us one e and so this whole giant integral that looked really nasty is just e that is one of the beautiful things about math and that's e times e is e squared so in the most elegant form this uh equation is going to look like integral x squared f of x dx minus e squared and let's just quickly use this to solve our original equation so it's going to be it's going to give integral from zero to four of x squared times x over eight d x minus and our expected value was eight over three so that's square that's gonna be 64 over nine and let's factor out the one eighth from here and make this x cubed and then we get one fourth x to the fourth after we integrate this and put a one eighth there you get one over 32 and take that from zero to four uh four to the power four 256 i think over 32 um minus 64 over 9 and let us just use a calculator so 256 divided by what 32 minus 64 divided by 9. we get 0.888889 which let's put into fraction form is just 8 over 9. so 8 over 9 is our variance and to find the standard deviation if you want you could go ahead and square it if you wanted to so that that is the really cool thing about continuous and discrete random variables how you can use calculus to find them and stuff like that so hopefully you guys learned something today so until next time
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from ritvikmath · ritvikmath · 12 of 60
1
2
3
4
5
6
7
8
9
10
11
▶
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Math Team Update
ritvikmath
Single Variable Calculus Volume of a Sphere - Proof 1
ritvikmath
Single Variable Calculus Volume of a Sphere - Proof 2
ritvikmath
Multivariable Calculus Volume of a Sphere Proof - Triple Integrals
ritvikmath
Multivariable Calculus Volume of a Sphere Proof - Double Integrals
ritvikmath
The Euclidian Algorithm
ritvikmath
Proving the Chain Rule
ritvikmath
Proving the Fundamental Theorem of Calculus Part 1
ritvikmath
Proving the Fundamental Theorem of Calculus Part 2
ritvikmath
Math Puzzle - Poison Perplexity
ritvikmath
Math Puzzle - Poison Perplexity - Solution
ritvikmath
Expected Value and Variance of Continuous Random Variables (Calculus)
ritvikmath
Expected Value and Variance of Discrete Random Variables (No Calculus)
ritvikmath
Array Method
ritvikmath
Complex Power Series and their Derivatives
ritvikmath
Distributions - Intro
ritvikmath
The Poisson Distribution
ritvikmath
The Bernoulli Distribution
ritvikmath
The Binomial Distribution
ritvikmath
The Continuous Uniform Distribution
ritvikmath
The Geometric Distribution
ritvikmath
The Triangular Distribution
ritvikmath
The Exponential Distribution
ritvikmath
The Borel Distribution + Notes on Poisson Distribution
ritvikmath
The Gamma Distribution
ritvikmath
The Normal Distribution
ritvikmath
The Laplace Distribution
ritvikmath
The Chi - Squared Distribution
ritvikmath
Overfitting
ritvikmath
Vector Norms
ritvikmath
Truths Behind the Titanic : K-Nearest Neighbor
ritvikmath
The Mathematics of Breakups
ritvikmath
Sillyfish
ritvikmath
Finding Optimal Paths - Dynamic Programming
ritvikmath
HowToDataScience : Scraping Twitter Data
ritvikmath
Decision Trees
ritvikmath
Perceptron
ritvikmath
Naive Bayes
ritvikmath
K-Nearest Neighbor
ritvikmath
Evaluating Machine Learning Models
ritvikmath
Decision Tree Pruning
ritvikmath
K-Means Clustering
ritvikmath
Gaussian Mixture Model
ritvikmath
Data Science - Fuzzy Record Matching
ritvikmath
Time Series Talk : Autocorrelation and Partial Autocorrelation
ritvikmath
Time Series Talk : Autoregressive Model
ritvikmath
Time Series Talk : Moving Average Model
ritvikmath
Time Series Talk : ARMA Model
ritvikmath
Time Series Talk : ARCH Model
ritvikmath
Time Series Talk : White Noise
ritvikmath
Time Series Talk : Stationarity
ritvikmath
Time Series Talk : ARIMA Model
ritvikmath
Time Series Talk : Lag Operator
ritvikmath
Time Series Talk : What is Seasonality ?
ritvikmath
Time Series Talk : Seasonal ARIMA Model
ritvikmath
So ... What Actually is a Matrix ? : Data Science Basics
ritvikmath
Derivative of a Matrix : Data Science Basics
ritvikmath
Basics of PCA (Principal Component Analysis) : Data Science Concepts
ritvikmath
Eigenvalues & Eigenvectors : Data Science Basics
ritvikmath
The Covariance Matrix : Data Science Basics
ritvikmath
More on: ML Maths Basics
View skill →
🎓
Tutor Explanation
DeepCamp AI