Expected value is one of the most fundamental concepts in probability theory and machine learning.

Have you ever wondered what it really means and where does it come from?

The formula doesn't tell the entire story right away.

πŸ’‘ Let's unravel what is behind the scenes! πŸ’‘
First, let's take a look at a simple example.

Suppose that we are playing a game. You toss a coin, and

β€’ if it comes up heads, you win $1,
β€’ but if it is tails, you lose $2.

Should you even play this game with me? πŸ€”

We are about to find out!
After 𝑛 rounds, your earnings can be calculated by the number of heads times 1 minus the number of tails times 2.

If we divide total earnings by 𝑛, we obtain the average earnings per round.

What happens if 𝑛 approaches infinity? πŸ€”
As you have probably guessed, the number of heads divided by the number of tosses will converge to the π‘π‘Ÿπ‘œπ‘π‘Žπ‘π‘–π‘™π‘–π‘‘π‘¦ of a single toss being heads.

In our case, this is 1/2.

(Similarly, tails/tosses also converges to 1/2.)
So, your average earnings per round are -1/2. This is the 𝑒π‘₯𝑝𝑒𝑐𝑑𝑒𝑑 π‘£π‘Žπ‘™π‘’π‘’.

By the way, you definitely shouldn't play this game. πŸ˜‰

πŸ’‘ How can we calculate the expected value for a general case? πŸ’‘
Suppose that similarly to the previous example, the outcome of your experiments can be quantified. (Like throwing a dice or making a bet at the poker table.)

The expected value is just the average outcome you have per experiment when you let it run infinitely. β™ΎπŸ€―
The formula above is simply the expected value in English.

If we formally denote the variable describing the outcome of the experiment with 𝑋 and its possible values with π‘₯α΅’, we get back the formula in the first tweet.

It looks much easier now, isn't it?
This concept came up recently when I gave this explanation to a friend.

Inspired by @haltakov and his awesome recent thread ( https://twitter.com/haltakov/status/1358852194565558276), I figured this can be interesting for a lot of you!

Next time, I am planning to explain entropy! What do you think?
You can follow @TivadarDanka.
Tip: mention @twtextapp on a Twitter thread with the keyword β€œunroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.