random variables Archives — Quick Math Intuitions Sharing quick intuitions for math ideas Tue, 31 Jan 2017 11:40:51 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.5 Metaphysics on geometric distribution in probability theory https://quickmathintuitions.org/metaphysics-on-geometric-distribution-probability-theory/?pk_campaign=&pk_source= https://quickmathintuitions.org/metaphysics-on-geometric-distribution-probability-theory/#respond Tue, 31 Jan 2017 11:38:33 +0000 http://quickmathintuitions.org/?p=180 I realized geometric distribution is not exactly about the time needed to get the first success in a given number of trials. This is a very odd feeling. It is…

The post Metaphysics on geometric distribution in probability theory appeared first on Quick Math Intuitions.

]]>
I realized geometric distribution is not exactly about the time needed to get the first success in a given number of trials. This is a very odd feeling. It is probably a feeling applied mathematicians get sometimes, when they feel they are doing the best they can, and yet the theory is not perfect.

This may be a naive post, I warn you, but I was really stunned when I realized this.

Geometric distribution is not about the first success

Let’s jump to the point. We know (or at least, I was taught) that geometric distribution is used to calculate the probability that the first success in k trials (all independent and of probability p) will happen precisely at the k-th trial.

Remember that a geometric distribution is a random variable X such that its distribution is

\Pr(X=k)=(1-p)^{k-1}\,p\,

How can we relate the above distribution with the fact that it matches the first success? Well, we need to have one success, which explains the p at the bottom. Moreover, we want to have just one success, so all other trials must be unsuccessful, which explains the (1-p)^{k-1}.

But hey, where would first ever be written? Unless you do probability in a non-commutative ring (in which case, I don’t know what you are doing), multiplication is commutative. So who can tell the order between the events in a Bernoulli process?

In fact, (1-p)^{k-1}p could just as well refer to having unsuccessful outcomes for the first k-1 trials and then a successful one at the k-th trial, as to having a success in the very first attempt and then all failures. As it is, as long as we have one (and only one) success among the k attempts, the geometric distribution holds!

Apparently then, geometric distribution is about the time of first success, but it is not just about that. It encompasses way more cases, all equally likely. Geometric distribution allows to calculate exactly one success will happen in k trials in a Bernoulli process.

The universe does not care about the order of events (in a Bernoulli process, at least). As long as we do k trials, regardless of when the success happens, the universe does not care. This stuns me!

The post Metaphysics on geometric distribution in probability theory appeared first on Quick Math Intuitions.

]]>
https://quickmathintuitions.org/metaphysics-on-geometric-distribution-probability-theory/feed/ 0
Random variables: what are they and why are they needed? https://quickmathintuitions.org/random-variables-why-are-they-needed/?pk_campaign=&pk_source= https://quickmathintuitions.org/random-variables-why-are-they-needed/#respond Thu, 24 Nov 2016 20:02:11 +0000 http://quickmathintuitions.org/?p=156 This article aims at providing some intuition for what random variables are and why random variables are useful and needed in probability theory. Intuition for random variables Informally speaking, random variables…

The post Random variables: what are they and why are they needed? appeared first on Quick Math Intuitions.

]]>
This article aims at providing some intuition for what random variables are and why random variables are useful and needed in probability theory.

Intuition for random variables

Informally speaking, random variables encode questions about the world in a numerical way.

How many heads can I get if I flip a coin 3 times?

How many people will vote the Democrats at the US presidential elections?

I want to make pizza. What is the possible overall cost of the ingredients, considering all combinations of different brands of them?

These are all examples of random variables. What a random variable does, in plain words, is to take a set of possible world configurations and group them to a number. What I mean when I say world configurations will be clearer soon, when talking about the sample space \Omega (which, appropriately, is also called universe).

I just wanted to provide a very brief informal description of random variables, but stick with me and we will dive deeper in the matter with an example!

A simple random variable example

Suppose to flip a (balanced) two-headed coin three times. If we write down all possible outcomes, we obtain the universe (or sample space) \Omega:

\Omega = \{ HHH, THH, HTH, HHT, TTH, THT, HTT, TTT \}

random-variable-1In which we have identified head with H and tail with T. The first element corresponds to three heads, the following three elements correspond to two heads, the following three more correspond to one head, and the last one to no heads.

Let’s take a second to notice that \Omega is made up of 1 + 3 + 3 + 1 = 8 items.

Now, what if I asked you how many heads you can get overall by flipping three times a coin? You would answer me by exhibiting the following set (who wouldn’t reply exhibiting a set, really!):

X = \{3, 2, 1, 0\}

Notice that X is made up of only 4 elements, whereas \Omega had 8: we have reduced the amount of data to handle. (Also, \Omega was made up of more complex data, because each of its 8 elements was made up of 3 letters.)

And lo! We have stumbled upon a random variable. We had a universe of possible configurations \Omega and, passing through a question, we have mapped them in a numerical way that’s relevant for our question. This is crucial, so I will say it once again: from \Omega, which contained a lot more information than we needed, we managed to extract the part of the data that was relevant to our study.

In a way, every time you study a phenomenon through some data, you are always using random variables to do it, because you only look at the data that’s relevant and ignore what’s not important for you at that moment. In our case, for example, we don’t care in what order the heads came, we just want two of them.

Of course, we can ask a variety of questions about the same phenomenon. In the case of the 3-coins-flipping, apart from “How many heads could we get?” we could also ask “How many tails could we get?”. It was a trivial phenomenon so there’s not much we can study about it, but try to think about a medical experimentation: there is a lot of data and several questions can be asked about it.

Why is a random variable useful?

At this point, a random variable just seems like a very useful concept, but one could argue that reducing the amount of data is not a good enough reason to introduce a new idea.

But random variables are defined in probability theory, so they must have something to do with probabilities! Imagine we were interested in the following question “What’s the likelihood of getting 2 heads (flipping a balanced coin 3 times)?”. What is beautiful about random variables is that they work in perfect tune with the probability measure we have on \Omega!

As long as we talk about discrete cases (meaning numbers are integer: we cannot get 1.5 heads), it may look like the concept of a random variable is superfluous, because we could always go look at \Omega and see how many cases satisfy our question and how many do not. However, this is impractical for huge amounts of data, not to mention the fact that more often than not the universe \Omega is not even explicitly known. But most importantly, random variables are essential when dealing with continuous quantities and, above all, when asking more complex questions (which may involve combinations of more than one variable, for example).

Why can’t we do away with random variables?

Mathematically speaking, a random variable is a function

X\colon \Omega \to \mathbb{R}

Having \mathbb{R} as output gives us a huge advantage: we can make use of all the calculus we know! We can calculate integrals, which allows us to compute the mean and variance of a phenomenon.[1]

In a way, the abstract concept of a random variable is the price we have to pay for going beyond the “How may heads can I get by flipping 3 times a coin?”.

That’s all for now, I hope this helps in understanding the use and importance of random variables!

Footnotes

1. See this great math.stackexchange answer as well.

The post Random variables: what are they and why are they needed? appeared first on Quick Math Intuitions.

]]>
https://quickmathintuitions.org/random-variables-why-are-they-needed/feed/ 0