Lecture 07

IIT Kanpur July 201
20 followers
Jul 26, 2024
[Music]
in this discussion you'll be introduced
to the concept of probability
distributions specifically discre
distributions and their probabilities
first we'll talk about random variables
and probity distributions if you recall
an experiment is an any process that
leads to one of seven possible outcomes
so the random variable is just a
mathematical way of describing these
outcomes and when we plot the
probability of all the random variables
on a graph then this graph is what we
call probability distribution so the
random variable and probability
distribution are two related Concepts
and we'll learn about both of them in
much more
detail the next concept that we'll see
is that of expected value and variance
this is very similar to what we
calculated in the form of mean and
variance for a population or a sample
the only difference being that you'll
learn how to calculate the same for a
probability
distribution expected value is generally
used to find an anticipated value for an
investment at some point in the future
and is popularly used in Industries like
insurance and card games we'll see some
interesting applications around the
expected value apart from that you'll
also learn about the important discrete
probability distributions that might
come across in your day-to-day
applications more specifically the
binomial distribution binomial
distribution could be used to mimic
experiments like public votes in an
election survey or analyzing new
products response via a limited launch
random variables part
one I'm quite sure that you have heard
this well-known saying about casinos
that The House Always Wins what it means
is that the casino gambling machines and
games are designed in such a way that in
the long run casinos always make money
one or two people may end up winning
large sums of money but the machines are
designed such that the rest of the
people collectively lose
more so how do the casinos ensure that
the house always wins it is quite simple
they use probabilities in fact casinos
use a very basic concept of probability
to ensure a win for themselves do we
wonder how to understand this let me
tell you about a simple gambling game we
can play we can take a bag and fill it
up with three balls two red and one blue
each parent had to take out a ball not
its color and then put it back
in this process was followed until each
parent has taken out a ball from the bag
four times a parsent who got a red ball
all four times would receive 150 rupees
from the house attractive offer isn't it
however the parsan who got any other
result would have to put or pay 10
Rupees so would you play or would you
like to play this game is this the kind
of game in which we the house should
always win in the long run or are we
going to incur some losses in the long
run in order to understand all this
we'll approach the problem in three
steps first we'll see what all kinds of
combinations can come up then we'll see
how likely each of these combinations
that is what their probability is then
we'll see how we can use these
probabilities to estimate the profit and
loss of a player he would get on playing
the game once let's go through the
various outcomes possible after apartent
has tried the BET as you would guess the
one outcome our players would want the
most is that all four balls end up being
red however that is not the only
possible outcome they could for example
get three red balls in a row only to
find that the last ball is sadly a blue
one wouldn't that be sad so can you find
out all the possible outcomes so let's
first list down all the possible
outcomes one by one we could get four
blue balls there's only one outcome in
which this happens we could get three
blue balls and one red ball this could
happen in four ways rle B
BRB double BRB and triple
BR we could also get two blue balls and
two red
balls this could happen in six ways also
we could get one blue ball and three red
balls in four ways and there's only one
way in which we could get four red balls
so in total There are 16 possible
outcomes random variables part two let
us go back to some of the original
questions that we were concerned with
starting with How likely is the house to
win or what is the profit or loss you
should expect while running such a
business however currently we cannot
answer these questions and in order to
answer them we need to analyze the
outcomes in terms of
probabilities for example if the
probability of getting four red balls in
a row comes out to be extremely low we
may say that the house is likely to win
on the other hand if the probability of
getting four red balls is comparable to
the other possible outcomes it may be
profitable for the players let us think
about how we can do that so there are
various ways in which we can convert
these outcomes to numbers or in other
words quantify them let's assign the
value of the number we get after
quantifying to a variable X for example
let's quantify the outcomes by using the
number of red balls so instead of saying
that the outcome is blue red red red we
can say that we got three red balls and
x equal to 3 similarly for the outcome
blue red blue red we can say x equal to
2 as you can see this number used for
quantifying outcomes is really important
in statistical language it is known as
random variable and is denoted by
uppercase X it is basically any variable
that converts an outcome to a number
another important question is are there
more ways in which random variable X
could be defined we can Define X as the
number of blue balls that we drew from
the back or the number of red balls
minus the number of blue balls that we
have drawn from the bag so the question
that now arises is which is the correct
random variable out of all these options
that you have which one should you
choose well the answer actually depends
on the information you are interested in
in our example we are interested in the
number of red balls recall that if the
player draws four red balls he or she
wins 150 rupees however if the player
draws even 3 two 1 or zero red balls he
or she loses 10 Rupees so let's define X
this way x equal to number of red balls
now if you want to find whether we will
actually make money or lose it we need
to know how likely the different values
of X are what is the probability of each
value we'll see that in the subsequent
discussions probability
distributions let us see the different
values of the random variable X as we
defined before it will take for all the
possible outcomes of our game remember
that X was defined as the number of red
balls that we have drawn from the back
so if the possible outcome that we look
at is the one with four blue balls
obviously X takes the value zero for all
four outcomes where we only Drew one red
ball out of the four x will take value
of one for the six possible outcomes
where there are two red balls and two
blue balls in the various combinations X
will take a value of two for these four
outcomes where we have three red balls
and one blue ball X will take the value
three and for the last outcome where we
have four red balls X takes the value of
four so basically by doing this we have
brought our 16 outcomes into five groups
where the random variable takes values
from 0 to 4 now if you want to find
out whether we'll make or lose money in
the long run need to find out the
likelihood of each of these values
occurring but how to do that let us say
that we conducted experiment with
certain 100 individuals who played this
gamble based on each person's response
we put a small note on a chart for
example person a got three red balls so
we put a note with his name on the chart
over value three similarly person B got
two red balls so we put a note with his
name over the value
two this way as more and more people
play
we will fill up the chart accordingly
until we have responses of all the 100
people on this chart so in this chart
over here on the x-axis we have random
variable X from value 0 to 4 on the y
axis we have the frequency the number of
times the random variable appeared in
our experiment so this chart is called a
histogram so the heights of these bars
in this blot correspond to the number of
times the frequency of that random
variable appeared in our
experiment for example two out of the
100 people drew no red balls 10 out of
the 100 people drew one red ball and so
on so recall that the probability of any
outcome is the number of favorable
outcomes divide by the total number of
outcomes so let's find the probability
that our random variable X takes the
value two the number of favorable
outcomes in this case will be the number
of people who drew two red balls and
that number is 32 the total number of
possible outcomes is 100 as that is the
total number of people who participated
in that game
so the probability of drawing two red
balls is 32 by 100 which is equal to
0.32 or 32% so we can extend this
probability calculation for all the
different values of X and put all of
this information in a single table as
shown here after calculating the
probabilities for X = to 0 1 2 3 and 4
we get the probability that X is equal
to 0.02 the probability that the random
variable X takes a value of 1 is
0.07 the probability that X takes value
of 2 is 0.32 probability that X takes
the value 3 is 0.43 and for xal to 4 the
probability is
0.16 now this table here is called the
probability distribution as it tells us
the probability of all the possible
values of X so now we will take these
probability values and just draw them in
a chart to a our understanding of the
probability values on the x-axis here we
have five random variable values and on
the y axis we have our probability
values the chart here where we plot our
probability value Val versus the random
variable values is called the
probability distribution chart so as you
can see the probability distribution
when displayed in the form of a bar
chart look exactly like a original
histogram just with a different scale
that is since probabilities can lie
between 0 and one only the values on the
y- axis are not restricted in the range
of 0 and one each value here represents
the probability of getting a certain
number of red balls so this is what our
probability distribution looks like in
tabular form and in bar chart form as
you can see clearly from the this
example a bar chart gives us a much
better visual idea of what the
probability will be hence this form is
more commonly used now we can use this
distribution which gives us How likely
each value of x is and find the answer
to our original question that is would
be in Long Run make money or lose
money so if we recall from our office
game setup we fixed our random variable
X as the number of red balls we got in
the experiment we then made a
probability distribution for X which
will help us to see how likely each of
these values of X is to
happen now as we said earlier we want to
use probability and find whether in the
long term the game or a bet will be
profitable to us the house or not
question is how will we do that let us
see suppose thousand people are playing
this game how much do you think an
average person would win or lose in this
game can you try and take a guess so for
these thousand people do you think
you'll be able to tell me how many
people are expected to draw one red ball
how many people are expected to draw two
red balls three red balls and four red
balls as you remember from before we
know that the probability that X is
equal to 1 is the value
0.07 so multiplying that by thousand
will give us the expected number of
players who will draw one red ball th000
* 0.07 gives us 70 so in other words
about 70 people will draw one red ball
out of those four balls similarly the
probability that X is equal to 2 will be
0.32 so multiplying by 1,000 gives you
320 so again it means that 320 players
on average would draw two red balls
similarly for xal to 0,000 time 0.02
which gives us 20 people who will draw
zero red balls 430 people will draw
three red balls and 160 will draw four
red balls in other words 160 people on
average will win this
game question is so how many red balls
are we expecting to see on average in
our game remember thousand people played
this game and out of those thousand 70
people had drawn one red ball similarly
320 people drew two red balls zero balls
were drawn for 20 people three balls by
430 people and four balls by 160 people
so I can say that the total number of
red balls we'll get after th000 attempts
at the game will be 0 into 20 1 into 70
2 into 320 3 into 430 + 4 into 160 the
sum of all these events gives us 2640
red balls so basically we saw 2640 times
a red ball in our, experiments so if we
take the division of these two
we can say that we are seeing 2.64 red
balls in one experiment on
average in other words we can expect a
person to draw 2.64 red balls in one
game and so in net shell the average
value that we would expect to get for a
random variable is called its expected
value let's continue our discussion of
expected value let's now formally Define
the expected value let's say that a
random variable X can take values X1 X2
X3 and so on till xn the expected value
of this random variable X would be given
by the expression expected value equal
to X1 * probability of X1 plus X2 *
probability of X2 plus X3 * probability
of x3 and so on till xn *
pxn and remember probability of x equal
to x i denotes the probability that the
random variable X takes the value x
i in our example the value that the
random variable X can take 0 1 2 3 and 4
so the expected value of this random
variable would be given by the
expression expected value equal to 0
into probability of 0+ 1 into
probability of getting XS 1 2 into
probability of getting XS 2 + 3 into
probability of getting X as 3 + 4 into
probability of getting X as 4 we have
already computed these probabilities
before and plugging those values we get
the expected value as 0 into 02 + 1 into
07 + 2 into 0.32 + 3 into 0.43 + 4 into
0.16 = to
2.64 so again the expected value for
random variable X that is the number of
red balls is
2.64 however I'm sure you are wondering
how can you get 2.64 balls in one
attempt the number of Falls would be two
or three why are we saying that on
average we expect to get 2.64 balls
actually it is not unusual to have an
expected value that may never actually
come up we say that the expected value
is 2.64 it doesn't mean that we expect
to get red balls in an attempt that that
many 2.64 balls what do this value
actually means is that if you were to
play a game infinite number of times
then the average number of red balls you
would get is 2.64 but does this value
really even help us with our question we
still can't tell whether we would make
money or lose in the long run so what
should we have done differently to
answer our primary question if you want
to find out whether the house would make
or lose money in the long run then we
would need a different random variable
probably a better random variable here
would be the amount one after playing
the game let's continue our discussion
of expected value so let's define our
random variable this way x equal to
money one after playing the game once
this definition of X works well for us
if we get a high expected value for it
that would imply that on average players
will win a lot of money in our game
which is obviously not a good thing for
us on the other hand a low expected
value here would mean that on average
the players don't p a lot of
money so this new random variable X can
take to values minus 10 and + 150 this
because player wins $150 for getting
four red balls and loses $10 for getting
any other outcome we know that the
probability when X takes the value 150
is the probability of getting four red
balls is equal to
0.16 on the other hand the probability
of losing the game when the random
variable would take the value minus 10
is
0.84 which is the probability of getting
any other possible combination of balls
namely getting 0 one two or three red
balls
so we can go ahead and compute
probabilities of getting 0 1 2 3 red
balls we could get the probability of
getting 0 1 2 3 red balls by adding
these individual probabilities 0.02 +
0.07 + 0.32 plus 0.43 which is equal to
0.84 in other words the probability that
a player will lose this game is
0.84 applying the same definition of
expected value as we saw before we can
compute the expected value for this
event as 115 to 0. 6us 10 into 0.84
which is equal to
$15.6 what this means is that on average
a player would expect to win
15.6 by playing the game so it turns out
that the game is a disaster for the
house if you want to make money you need
to ensure that the expected value for
the money won by a player is negative
this is to ensure that players lose
money and the house wins in the long
run so how can you do this you can
decrease the price money increase the
penalty or just decrease our players
chances of winning any of these choices
will decrease the players expected
earnings from the game we can go ahead
and fill in our rules and configuration
of the game so you can now understand
how casinos ensure that they remain
profitable the casino machines are all
designed in such a way that the expected
value of the money earned by the player
is always negative this means if we
design the game such that the expected
value of the money earned by a player is
for example minus10 orus $20 we can be
fairly confident that the house will be
profitable let's look at one real life
example of the expected value we know
that the expected value is the basis for
insurance companies and we can do a
simple example based on this
concept based on certain sources the
company estimates that the probability
that an accident will occur within the
next year is
0.071 on the basis of this information
What premium should the insurance
company charge to break even on a
$400,000 on a one-year Term Policy
so let us try to calculate the expected
value that the company will need to pay
to settle a policy in case of an event
of an accident the probability is
0.071 and the amount to be paid is $4
lakh however in case of no accident the
probability becomes 1 minus
0.71 which is equal to
0.929 and in this case the amount to be
paid is zero thus the expected value
will be x * probability of X when there
is no accident plus X time probability
of x when an accident occurs in case of
no accident x * probability of X becomes
0 * 0.929 which is 0o as shown in the
table here and in case of an accident X
time probability of X becomes
0.71 * $4 lakh which is approximately
$284 these computations are provided in
the table thus on average the company
needs to pay about $284 to settle a
policy thus the premium should be $284
plus whatever return the company needs
to cover such administrative overhead
and
profits variance we can calculate the
expected value if we are given a random
variable and its corresponding probity
distribution so this answers our
question about the central tendency of
the
distribution however you also learned
that apart from the central tendency we
also look at the spread or variability
of the data so let's go back to some of
our previous example where we created a
probability distribution of the random
variable X where X is the number of red
balls in the bag we want to find out the
variance of X to calculate the variance
we have a very simple formula for doing
so basically it is variance of xal to
xus Mu to^ 2 * probability of X summed
over all the values of X or
alternatively summation of x - mu^ 2
into probability of x equal to x i where
mu or sometimes called as xar or
expected value of mean of the random
variable recall that for xal to 0 the
probability was 0.02 for xal to 1 it was
0.0 7 for x = 2 it was 0.32 and for x =
3 it was 0.43 and for xal 4 it was
0.16 here mu denotes the expected value
that we had earlier calculated so it
will be the expected value of the number
of red balls which we calculated to be
2.64 so to calculate the variance of X
it will be 0 - 2.64 to ^ 2 into 0.02 + 1
- 2.64 ^ 2 into 0.07 + 2 - 2.64 ^ 2 into
0.32 + 0 - 2.64 ^ 2 * 0.43 + 4 - 2.64 ^
2 into 0.16 which sums up to 0.81
04 thus the variance of this
distribution is
0.814 and the standard deviation will be
the root of 0.81 04 which would be
0.92 calculating the variance could be
used to compare the spread of different
probability distributions
[Music]
[Music]
[Music]
