Random Variables: A to Z

Harsh Mudgil
5 min readJun 29, 2021

Variables, are perhaps history’s most underappreciated tool of mathematics. When was the last time, you stopped to appreciate the beauty of the concept of a variable. The concept of a variable, rather has a bad name, amongst eighth graders, who complain all the time about mixing alphabets with numbers.

Did you know, there are actually two types of variables? Let’s say one is God of Thunder Thor and the other is God of Mischief Loki. Thor is an ideal kid, who is well-mannered in front of and behind the back of his parents. His identity always remains constant. On the other hand Loki, can take many identities. His identity is not constant, and he can assume any random identity from a set of possible identities.

Just like Thor, if there is a variable t which can take only one identity or only one value, then it is called a Deterministic Variable.

Just like Loki, if there is a variable L which can assume an identity or a value from a set of possible values, then it is called a Random Variable.

So, now how likely is Loki to take the identity of Captain America? The answer to this question is given by P(L = l), here:

  1. l could be any identity or a value from the set of possible identities that L or Loki could possibly assume. When l = Captain America, we are considering the case when Loki assumes the identity of Captain America. l could also be equal to Tony Stark, Black Widow or Hulk.
  2. For l = Captain America, P(L = l) represents the likelihood or the probability of Loki, taking the identity of Captain America.

So we can conclude this about a random variable, that a random variable is a variable which can take any value from a set of possible values, with a certain probability telling us about the likelihood of the random variable assuming that particular value.

Discrete Random Variable

If you can count the number of possible values of a random variable using your fingers with or without repetition, then the random variable is called a discrete random variable.

Loki, can assume infinite identities. But, if you wanted, you could count the number of his identities on your fingers. Similarly, at a given instant, he could either be Agent Colson or Bruce Banner. But, he can not assume an identity which is somewhere in the middle of a Hulk and Agent Colson.

If the number of possible values of a random variable are countably infinite such that no possible value could exist in-between 2 consecutive values, then the type of variable is called a discrete random variable.

Suppose you were to list down all possible identities a random variable Loki or L could take i.e. all possible values of l and their corresponding probabilities i.e. P(L = l) then such a list would be called Probability Mass Function or PMF

Mathematically PMF can be stated as: Σ P(L=l) = 1, for all values of l

Continuous Random Variable

When the number of possible values of a random variable is extremely large, the probability that a random variable will assume one particular value is almost close to zero.

As a result, in this case, defining probability for a single point is meaningless.

You remember the old milkman, who used to deliver milk on his cycle. He used to measure the milk with a vessel which supposedly used to be of one litre. Do you think, every time he measured milk, it used to come out exactly one litre? That’s not humanly possible. Every time the milkman measured a litre using his vessel, it would have been very close to the one litre mark. It would be wiser to define each measurement within a range close to one litre mark, than ascertaining it as a number. There could be infinite values within a range close to one litre mark, which could be the actual value of the measured milk.

Similarly, a continuous random variable and its probability is defined within a range rather than ascertaining them as a number.

Just as we define PMF for a discrete random variable, we define PDF for a continuous random variable.

PDF or probability density function, is a function which provides us the value of probability for a given range, over a given continuous random variable.

PDF of f(x), gives probability that X takes a value within a range from a to b

Mean and the Variance of a Random Variable

If you had to represent the entire distribution of a random variable, you better pick a point which broadly represents each and every point. Mean, a measure of central tendency of a random variable, is used for this very purpose. It is defined as E[X]:

Variance is defined as the measure of spread or dispersion of the distribution of a random variable. By this we intend to measure, on an average, how far apart are different points of a random distribution from its mean.

Linear Combinations and Conclusion

Probability and experiments all sound romantic. But at the end of the day, what random variables really allow us to do, essentially boils down to converting combinations of random phenomenons or experiments into linear equations. If a random variable is made up of a combination of other random variables, then it could be treated as a linear equation, in which performing the below operations is a possibility.

I hope you had fun. I would see you, in the next instalment of the AlmaBetter blog assignment series. Till then, Buh..bye!

Harsh.

--

--