And welcome back to another class of our course about data science, a complete introduction.
So we're going to discuss we are going to talk about the basics of statistics and we are going to talk
about some basic formulas.
So really basic concepts.
You'll see it's really, really easy to vote.
So basically, the three formulas that are going to be covered today would be the median, the mode
and finally the average or the mean.
And as you can see, those are pretty simple, but yet really important in statistics.
So basically, the first thing that we are going to talk about today would be that median and basically
the median is simply the middle number inside of a deficit.
So let's take an example right here.
We have one, two, three, four, eight, nine twenty two.
In this case, the median will be four, even if it's not the center number in this world, the central
number means the number between one and twenty two, which would be 11 in this dataset.
This is the middle number.
So this is the number that is in the medium well in what is that median here?
As you can see, it's the exact same thing.
It's a perfect representation of it.
So right here we have a dataset and the median will be right there because this is the number that is
in the center.
So basically, each time that we have a number that is in the center, no matter how big the dataset
is, this would be the median.
So let's say, for example, we have one, two, three, four and one thousand.
Well, in this small dataset, the median number would be three, even if the average between one and
five and one thousand would be five hundred.
But in this case, it's going to be well, the median would be three, because this is the number that
is in the center.
So this is for the median.
The second thing that we are going to talk about today would be the mode.
The mode basically is a bit different from the median.
Very simple to understand as well.
Basically, the mode is the number that will appear the most inside of a dataset.
It's possible that we have data sets with more than one mode and also it's possible that we have data
sets with no mode at all.
So let's say, for example, the dataset right here, which is one, two, three three three four eight
nine twenty two twenty two, which in this data set, the mood will be three because three appears three
times in this case.
And since it's a number that appears the most, this would be our most same thing for twenty two in
this case.
Twenty two is not the mode of this data set because it appears three times to be, it appears only two
times and the number three appears three times.
And if we didn't have that number three in this case, the mode will be twenty two.
If like for example, in this dataset we have five numbers and all the numbers appear only one time.
There is no mode in this case.
So we have in this that set new model.
And if for example, we have here three, three, three and we had twenty two, twenty two and twenty
two, twenty two the average three times.
In that case the model has been three and twenty two because they appear the same number of times.
So as you can see in this picture, this represents it really good.
So basically we have the number 10 right here.
Thirty here.
Fifty three.
Seventy nine.
So basically the number of seventy appears forty times.
And this is why this would be the mood of this dataset right here.
All the other numbers don't appear as much.
So if we had, for example, 90, that appears as well 40 times and then it would have been as well.
So we would have had two modes inside of this dataset.
Finally, the last thing that we are going to talk about today would be the mean.
And as I said, this is pretty simple to understand.
Basically, the meaning would be the average of a set of numbers that we have in this case.
The example is directly here.
So let's say we have five numbers.
So the height of some people, basically the mode in this dataset would be there is no more.
So since everything is the same, the median would be one meter seventy centimeters.
So basically in this case, one hundred seventy centimeters.
And finally the average or the mean, the weights, typically it's pretty simple.
You simply make an addition of all the numbers that we have right here and we'll divide it by the number
of numbers.
So in this case, we have five numbers or five entries, so we will divide it by five.
So the calculation is right here.
What we have done is pretty simple.
We made an addition of one hundred fifty one hundred sixty one hundred seventy, one hundred eighty
and one hundred eighty eight right here.
So I made a mistake.
We have a mode.
It's one hundred eighty because it appears two times that difference.
And finally the answer would be.
840 divided by five, because we have right here, we have our five numbers and divided by five, it's
one hundred sixty eight centimeters.
So if I make a quick summary, it's pretty simple with this example.
So first of all, we have the median, which is one hundred seventy centimeters, the mood, which would
be one hundred eighty centimeters because it appears two times.
So since it's the number that appears the most, it's our mode.
And finally our average, which would be one hundred sixty eight centimeters.
And how we made the calculation, it's pretty simple.
We simply made an addition of all the numbers that we have here and we divide it by the number of numbers,
which is five, as you can see, those were the three basic formulas that we talked about.
So in the next class, we are going to learn some well, some concepts and formulas that are a bit more
advanced.
So that's where the glance guys and see our next class.