Module 14 — Expectation of a Random Variable

A.I HUB
2 min readAug 10, 2023

--

Image by Lucas Santos on Unsplash

In this step by step guide, we will walk you through the the core concept of expectations of random variables. We also take a hands-on test drive with python to understand the actual implementation of random variable in statistics. Let’s Dive In

Introduction

A statistics is a numerical value that basically summarizes our dataset or a part of the dataset. As we talk about to calculate mean/average value of some data points or a random variable is one of the most used statistics.

Step 1 — Understanding Mean Value

The expected mean value or the expectation of a random variable is the long run average value of repetition of the experiment which this random variable belongs to. The expectation is also known as the first moment.

Let’s take an common example to clarify the concept of average value through sampling.

The sample space for tossing one fair coin twice is:

S = {HH, HT, TH, TT}

Step 2 — Probability of Outcome

All four possible outcomes on equally likely. For a random variable X representing the number of trails in both tosses. It follows that:

P(X = 0) = P(HH) = 1/4

P(X = 1) = P(TH) + P(HT) = 1/2

P(X = 2) = P(TT) = 1/2

Step 3 — Occurrence of Head/Tails

The outcome HH represents that heads occurred in both tosses. Where as HT means heads occurred in the first toss and tails occured in the second toss. The probabilities are the relative frequencies in the long run. Thus, to find the expected value denoted as meu, we take the average of all possible outcomes.

meu = E(X) = summitionX.P(X = x)

meu = E(X) = 0 (1/4) + (1)(1/2) + (2)(1/4) = 1

The expected value of rolling a six sided dice can be computed.

meu = E(X) = 1(1/6) + (2)(1/6) + (3)(1/6) + (4)(1/6) + (5)(1/6) + (6)(1/6) = 3.5

Conclusion

Finally, we will covering the basics of expectations of random variable by using python, along with the theoretical glance we also take a hands-on experience as well. In this guide we will understanding on the first hand, why random variable are important in stats and why we should used this random variable whenever we faced a diplomatic conditions.

--

--

A.I HUB

A.I HUB is a learning platform, where you can learn from all sorts of courses for free we help individuals and youngster by providing quality content.