noc21- ma35 - lec09

IIT Kanpur July 201
20 followers
3 Video Views·Dec 4, 2023
[Music]
[Music]
hello friends welcome to the course
essentials of
data science with r software one where
we are trying to learn the topics of
probability theory and statistical
inference and now we have begin with the
topics of
probability theory so can you recall
that in the last lecture that was a very
story
killing type lecture where i had tried
my best to give you
some idea about the probability theory
and i tried my best to convince you
that probability theory is not a new
thing for you that you are going to
learn
you already know it the only thing is
is that i want to now define it in a
mathematical
terminology the advantage will be once
you
are able to show someone that this is
how you are trying to compute the
probability
not your friend but this entire world
will
agree with you that means
you will be able to develop a very good
probability model
and that is the basic objective of data
science
so now from this lecture i will try to
take a very small issue
very small ingredients
and i will try to move towards the
construction of a probability model
i will try to take very small topics
elementary topics and i will try my best
to give you
or to explain you in a very simple
language but
definitely when you are trying to learn
it
you have to keep in mind there is a very
strong
theory behind these concepts my
objective here is very different
i am trying to connect the statistics
with the
data science and data science is heavily
dependent on the computer
and for that we also need a software
so now at this stage i will be
not that much interested in giving you
the
theoretical construct but i will be more
interested in the application part of
the tools
and for that whatever are the basic
ingredients i will try to explain you
that is my objective in case if you want
to know the hardcore theory behind
these topics i will simply suggest you
pick up any book of statistics and try
to learn it
right so now in this lecture we are
going to
talk about the first basic ingredients
of probability theory
which is sample space and events
so let us begin our lecture right
so now if i ask you a very simple
question
you know the answer what is an
experiment how do you define an
experiment this is the first basic
terminology which is needed for the
probability theory so i can say that any
activity for which the
outcome is uncertain can be thought as
an experiment
you always try to toss a coin or roll a
dice
do you note that before
tossing the coin what will you get head
or tail certainly not
that you come to know only after the
experiment is completed
do you know that if you start from your
home at certain time at what time you
will reach to your college
exactly you always tell only the
approximate value
means if it takes about 20 minutes
then if you start from home at 10
o'clock in the morning
you may reach to your college at 10 18
10 19 10 20 10 21 10 22 and so on
so what is that that is also an
experiment
that before reaching over there you do
not know how much
exactly the time you are going to take
and the
uncertainty in such even concerns in the
sense that the outcome of the experiment
is not known unless and until the
experiment is completed and the outcome
is not
predictable with certainty in advance
that is why they are called as
experiment you are trying to conduct an
experiment
then you understand the meaning of it
you will never say that you are going to
conduct an experiment to
see whether the sun rises in the east or
in the west
that you know in case if you try to
combine
two chemical known compounds in a given
quantity
you know that what is going to be the
outcome unless and until you are trying
to create an experiment
because an experiment you will not be
knowing that what is going to be the
outcome
right whatever the experiments chemical
experiments we try to do in our class 10
and class
12 we know their outcome
and whenever you are trying to combine
two chemicals and if you are not getting
the same outcome
possibly you try to repeat the
experiment because you know the outcome
but that is not really an experiment
the experiment will be something like
people are trying to experiment for the
co with vaccine on different types of
patients where they do not know before
the conduct of the experiment that
whether the
vaccination is going to work or not
right so similarly i can take here some
more example
for example when you are trying to draw
a card from a deck to observe which
which card is drawn you don't know
unless and until the
card is in your hand or the card is
drawn similarly if you toss a coin
you do not know what is going to turn up
head or tail
that is an experiment but remember one
thing probability theory is beyond the
tossing of coin rolling a die and
drawing a card from a deck right
probability theory is now happening in
your day to day life now you should be
convinced about it well we are trying to
take very simple example to explain you
at least you know that how to toss a
coin or how to roll a dice
that is the reason we always take the
example of
tossing a coin or rolling a dice but you
should not laugh or you should not feel
that okay
why probability theory is always
happening with the tossing a coin
okay so now we try to introduce or try
to understand
two terminologies one is sample space
and another is event whenever you are
trying to conduct
an experiment the outcome of the
experiment is
not known to us in advance
but in most of the cases you will see
that
we assume that all possible outcomes of
the experiment are known
for example in case if you try to
cross a coin what will happen either
there will be a head
or there will be a tail similarly if you
try to roll out dice what will happen
either there will be one
two three four five or six
right even if you want to go from your
home to your college where you know that
approximately it takes 20 minutes under
the general condition
then what will happen you know that it
will take time
say 17 minutes 18 minutes 19 minutes 20
minutes 21 22 23 24 25 minutes
yeah unless until there is some major
issue
so we do not know at what time i am
going to reach to my college but i
know with a very high possibility that
ok in any case i will be reaching
between
15 minutes to 25 minutes
right similarly when you try to go to
your exams you do not know
before the conduct of exam that what
type of grade are you going to get
a b c d or f but definitely
you know for sure that what are the
possible outcomes
a student can get a grade a b c d or f
so the set of all possible outcome of an
experiment
is known as the sample space
of the experiment and it is indicated
by the symbol capital omega
capital omega is a greek letter just
like we have
capital a b c d so we have capital w and
the capital w
in the greek letter is capital omega and
now
when you try to take a subset from this
sample space
this is called as an event how
suppose if i say you are trying to toss
a coin
the possible outcomes are head and tail
but now can you say that there are two
possible
events one can get a head
or one can get a tail similarly if you
take about 15 minutes to 25 minutes to
reach your college from your home
can i say that i want to know that what
are the chances that you will reach
there between 18 minutes and 21 minutes
so what are these these are the
subsets of the
all possible values so
any subset of the sample space is known
as an
event and this is denoted by
say here capital e that is the symbol
what we are going to use in our course
so now if you try to think that
whenever you try to read such
definitions in the book
many times you get badly confused that
what are they trying to see
or what are they trying to show you
but if you try to understand them just
spend couple of minutes and try to see
what are they trying to explain you the
things becomes very simple
so an event is a set of possible
outcomes of the experiment
and if the outcome of the experiment is
contained in e
that is the subset then we say that e
has
occurred for example if a coin is tossed
and the sample space has two points
head and tail now in case if i
try to toss the coin and suppose it
comes head
so head you can see that this is one of
the point that was available inside the
sample space
and then we can say that an event has
occurred and what is that even the event
had
has occurred yeah that can also be
that the event scale has occurred
so any outcome that has to be
contained in e
right then we say that the event has
occurred for example if
there is a hospital where people are
trying to
record the gender of a newly born baby
newly born child so there are only two
possibility that whether the child is
male or the
female so in case if you try to collect
these two possible outcomes then
together they will try to constitute the
sample space capital omega
so here for example m is indicating that
the child is male and
f is indicating that the child is female
right so now when somebody is going to
the hospital
the person will say that the sample
space consists of only two points
male and female now whenever there is a
baby bond then whatsoever be the gender
of that baby that can be either male
or female so in case if the
baby is male then we say that e consists
of
m and then e is the event that the child
is a
male boy and similarly if e
consists of only f that is the
baby is female then we say that the
event
e is that the child is a
female or a girl
right similarly if i take another
example if there are three students who
have got
three positions in the game means if
there are three students and they are
trying to participate in a game
there are only three possibilities that
the student can get the first position
second position or third position
right now
the experiment is conducted and those
three students
try to occupy the positions one two and
three
then what will be the sample space
sample space
will consist of all orderings of the
number one two
and three why because there are three
students
and those three students can occupy the
places in different orderings for
example
the most simple one will be first is to
and get first position second student
get second position
third string get third position but do
you think is it the only possibility
no first string can get the third
position second instrument can get the
first position
and so on so in case if you try to see
there will be different combination
possible 1 2
3 3 2 1 2 1
3 and so on
and in case if you try to collect all
such ordering they will try to create
the sample space
now in case if you try to understand
what is an
event or how are you going to interpret
it suppose the outcome is here
2 3 1 this means student 1 has
got the position number 2 student two
has got the position number three and
student one has got the position number
one
so now in case if you are getting an
outcome
like three to one then this is an event
this means what that instrument 1
gets position number 3 is 2 and 2 gets
position number 2
and student 1 gets position number 1
this is the meaning of this 3 2 1.
so this is an event right similarly if i
try to take
one more example suppose an experiment
is conducted
and we want to know the
dose of a medicine
suppose if somebody wants to conduct
such an experiment
what the person has to do the person has
to
give a certain amount of dose to the
patients
and the quantity of that
medicine or the dose is increase
continuously
and it is continued until the patient's
patient reacts positively you have seen
that somebody has got a
body temperature first the doctor says
ok give give half tablet
then if there is no effect they try to
increase it to one tablet
and if there is no effect they try to
increase to 1.5 tablet and 2 tablet and
so on
right definitely they will try to do up
to only that level
up to which the medicine is not harming
the patient
so in this case what will happen one
possible sample space for this
event is to assume that let omega
consist of
all the positive numbers right because
those can be
can be any value between zero and
infinity
well infinity is something like a
symbolic
but it is going to be positive
right and what will be the outcome of
such an event
the outcome will be can be denoted by
some value here the small
x which is the value of the dosage
that is going to help us or that is
going to help the
patients that
if the patient start getting this dose
and reacts positively when the value of
those
doses reaches to x
and as long as the dose was
smaller than x there was no reaction
there was no improvement the medicine
was not working this is what we mean
so now you can see here that
understanding the concept of sample
space and event is not difficult
the only thing is this you have to think
and decide yourself
for a given experiment that you are
trying to conduct
that how are you going to define the
sample space and objective
one thing i would like to clarify here
very clearly
that the definition of a sample space
and events are related to the objective
of your study
it depends what you really want to do
for example in case if you are trying to
roll two dice then there can be
different objectives in which you might
be interested for example you want to
know
the sum of the numbers on the upper
faces of the dice
or you want to know the difference or
you want to know the sum of the
square whatever it is so it depends on
your objective
what you want to do but my advice is
that try to understand the experiment
try to understand the
the need of the experiment that why the
experiment has been conducted what you
really want
to know based on that you try to define
the objective and based on that you try
to take the definition
and try to decide what is your sample
space and events
right so now we have understood this
concept but we need to
indicate it by some mathematical terms
so that anybody can understand it
right so now whenever we are trying to
conduct
an experiment the outcome of a
random experiment is called as in as a
simple
event or an elementary event and it is
denoted by
small omega you can see here i have
introduced here a word random experiment
you see whenever you are trying to
conduct an experiment as we discussed
earlier we don't know what is the
outcome what is the possible outcome
that you are going to get well the total
possible outcomes are known to us
but out of them which of the outcome is
going to come that we do not know that
is
in that sense we call the experiment to
be a random experiment
so now whenever we are trying to conduct
an experiment there can be more than one
outcomes and suppose there are k
possible outcomes which are indicated by
say omega 1 omega 2 say omega k
so now in case if i try to collect the
set of all possible outcomes of omega 1
omega 2 omega k
then they are going to constitute the
sample space
omega so now you can see here whatever
you have explained the concept of
omega in these three examples
this medicine example this students
example
and this male and female child example
that omega is now well defined
right for example if you try to take
here this example of say
male and female this omega 1 can be
capital m and omega 2 can be capital f
and similarly if you try to take here
this example of medicine means any value
of the
dose of the medicine that is reacting
to help the patient in curing him or her
that is your omega value
right in this case the value of omega
can be in some interval form also
so now the subsets of omega are called
event and they are denoted by capital
letters in general capital a capital b
capital c
and so on but that is our convention
right
that's our understanding and at least in
this course we are going to follow the
this convention now i try to
make the things more clear and we try to
define it in a
mathematical symbol because once you try
to define the
things in a mathematical symbol the
things become very
easy to understand now suppose if you
want to compute the sum of squares of
the first hundred natural numbers
then i can write down here one two three
four hundred
then i try to square them then i try to
sum them and so on
all those things i can write down very
easily here x goes from one to
say hundred summation x square so you
can see here mathematically you can
express this thing very
compactly which anybody can understand
very easily
right so with this point of view i try
to express whatever we have discussed
whatever we have understood in a
mathematical symbol so now i try to
define here two things complementary
event and
sure events so let this
capital omega a this is the set of all
simple even that are contained in the
event a so that means
anything can can happen
from this set
whatever cannot happen that is also
another set
and that event
which cannot occur in this omega a
this is called as a complementary event
or a composite event
and that is indicated by a bar
sometime you write down here a
complement also whatever you want to
write different books follow different
symbols and notation that is not a big
deal but here we are going to denote it
by
a bar so this is
also an event and this is referred to as
non occurring of the
event a and it is called as composite
event or
complementary event so you can see here
that
capital omega this is the entire sample
space
sample space consists all possible
outcomes
so don't you think that omega is also an
even yes
omega is an event and since it contains
all possible outcome we can say that
omega will always occur
and it is called as a sure event or
certain event
suppose there is a coin there are two
possibilities head or tail
and if i say well what is the
probability of getting head and
tail or head or a tail can you tell me
this a joint even means i just want to
know
that if head comes or tail comes i will
be very happy
the probability is always one because
there are only two possibilities with
that either head will occur or tail will
occur so
when my event is comprising of both the
events the probability of this event
will always be equal to one for example
if i roll a die and then there are six
possible options one two three four five
six and if i say what is the probability
of getting
one two three four five or six that is
always going to be one
well definitely one of the point is
going to occur so such points are called
as
show event now when you have a
sure event then definitely there has to
be any there has to be
an impossible event also because
sure event is occurring always so
impossible
even will never occur so
in case if we consider the set here phi
as null set that means there are no
elements
and this is also is an event
so then this event can never occur and
it is called
as an impossible event
so if you try to see the
sure event is the set of all elementary
events and the impossible event is the
set with
no elementary events and sure and
impossible they are complement to each
other
right ok so now i try to take a
very simple example and i try to explain
you this concept
suppose i try to roll a die
and suppose the die is roll only once so
there are
six possible outcome for example you
know that if there is a die like
this one there are points like here one
four
one two three and so on so if this
dice is roll then what we try to do we
try to observe what is
appearing on the upper surface
right you must have played very ah
means different type of the board games
from your childhood
so now in this case if you want to
define the sample space
then there are six possibilities getting
one
two three four five and six and i have
denoted all this
six values by event omega one omega 2
omega 3 omega 4 omega 5 and omega 6
so omega 1 is the event that one appears
on the
upper surface omega 2 is the event that
2 appears
omega 3 is the even that 3 appears and
so on and this capital omega is going to
be the collection of
all possible events omega 1 omega 2 up
to
omega 6. now i can define the
event according to our objective suppose
if i define
the event a as an even number of dots on
the upper surface of the die
that there are three possibilities that
the event
occurs with this event because the
number
are going to be even then then either
2 can occur 4 can occur or 6 can occur
so they
that mean they are corresponding to
omega 2 omega 4
and omega 6 and what will be the
complementary even for this
event a if event a is asking that
it is trying to consider all even
numbers
then obviously the complementary will be
consideration of
all the odd numbers
right so the complementary event of a
will be denoted by
a bar and this will be if an odd number
shows up then we have a complimentary
event and there are three possibilities
what are those possibility whether you
observe 1 3 or
5 and these are the 3 events which are
indicated by omega 1 omega 3 and
omega 5 right so this is how you can see
that you can
define these things now in case if you
want to define here an elementary event
then this elementary event is an event
defined to observe only one particular
number
say for example omega one equal to one
then
it is an elementary even if you if you
try to take omega 3 equal to
3 then that is also an elementary event
and what is here the shore event which
is hundred percent guaranteed to occur
sure event is the event that a number
which is greater than or equal to one
occurs why
because any number between one and six
is greater than or equal to one
so whatsoever number come the event is
always going to
occur so that is a sure event
when we have a sure event then we also
need to understand what will be the
impossible event so in this case for
example
we can define an impossible even
like this is the event that the number
seven appears on the upper surface of
the die do you
think that number seven can occur there
are only
six numbers at least we have assumed
that we have a die which has only
six numbers one two three four five and
six so this
event can never happen and this is
called as an
impossible event now i try to
change my objective and suppose i try to
say that
i am going to roll two dice
and we try to throw both the dice
simultaneously like with this one so our
outcomes are going to be
like this one right suppose if
there are two points here and here there
are three points on the second eye
right so and if i try to write down the
number of points on the upper surface
suppose this is my dice number one and
this is my dash number two so i can
write down here the value is
say 2 comma 3. suppose this is
and even that whatever numbers we are
going to observe on the upper surface of
both the dice
that is my event so this is what i have
defined here
now how many possibilities are there if
you try to
create here a small table like is one
two
three four five six one two three four
five six you can see here one comma one
can come
one comma two can come one comma three
can come up to here
say six comma
one can come up to here 6 comma 6 can
come so there will be altogether
36 possible outcomes
right so there are 36 simple
events which are defined as the number
of dots on the first die
number of dots on the second die and
they are indicated by omega 1 omega 2 up
to omega 36
right so omega 1 1 means 1 and 1 occur
on the upper
surface of both the dice one two means
one occur on the dice one and two occurs
in that
dice two and so on so now if you try to
see the sample
space capital omega will consist of
these possible values and these ah
all the collection of all such
events or the sample point that is
creating our capital omega so now you
have obtained the
sample space also
now from this experiment i can
have different types of objective and i
can define different types of
events also for example if
an event a is defined as upper faces of
both the dice
contain the same number of dots then
what do you think what will be your
capital omega a that means the sample is
space
corresponding to this event a they will
have
here six point that both the dice have
either one
two three four five or six numbers on
their upper faces on the other hand
in case if my objective is something
else then i can define another event
here b
which is the sum of numbers on the upper
faces is 6. in that case
the sample space corresponding to this
event is defined as for example
now this omega b can have six possible
points
one five two four three three four 2 and
5 1 and if you try to see if you try to
sum any of this
these two numbers the their sum is
always 6
and then similarly if you wish you can
define so many events
and from this capital omega
right and in this case a sure event is
get either
an even number or an odd number
definitely you are going to get
one out of them so this event is
100 guaranteed or this is a sure even
that will always occur
and an impossible even would be like the
sum of the two dice is greater than 13
it is not possible because the maximum
value which a die can take
as the number of points on the upper
face is six so the maximum value will be
6
and 6 and the sum is going to be 12 13
can never occur
at least in this case so that is going
to be an
impossible events right so
now we come to an end to this lecture
you see this was a very simple lecture
just trying to introduce
with the basic notations of
sample space events etc but definitely
they are very important
because whenever you are trying to work
in the decision science whenever you
want to compute
the probability of something these are
the basic ingredients
unless and until you define your omega
omega a a b etcetera how can you compute
the probability
and this definition are in your control
the person who wants to know the
probability of certain even
that person knows but that person
possibly does not know statistics
or data science that person will come to
know
only to you you have to
listen and you have to translate what
the person is trying to say
for example if i take the example of
this
medicine you have to decide what will be
the range of the dose of medicine
minus infinity to infinity zero to
infinity
minus infinity to 0 some integer
or some real number whatsoever you want
you have to
decide and one thing is this whatever
you decide you have to
match with the real thing what is
happening in practice
if you try to say the doses are going to
be integer value
that means there are only some tablets
but if there are no tablets but there
are some liquid
and that liquid can be given in any
volume
then definitely that those can be 2.3
and 2.4 ml also
but you have to take a call
and for that you have to understand
what's really happening and i always say
that a good statistician will be that
fellow who is a very good social
scientist
you cannot say that i don't know how the
doses of medicines are given
so you try to understand this thing try
to take very simple example try to think
and try to construct your own
sample space and events and get
confident
so you try to do it and i will see you
in the next lecture till then
good bye
[Music]
[Music]
you
