Skip to main content

Standard Normal Distribution with examples using Python

Difference between Discrete and Continuous Random variables

Difference between Discrete and Continuous Random variables

What is a Random Variable?

Let's say you want to observe the number of goals scored in any football match in the English Premier League season. You record the number of goals scored in each match in a set S--> (3,1,4,0,6,8,...2). We just conducted a series of random experiments of observing goals in each match. Every random experiment had a numerical outcome which we call as a random variable. In our case, it was the number of goals in each match (3,1,4,...2). The reason we call this as random is because we do not know until the end of the match about the number of goals which would be scored.

What is a Discrete Random Variable?

In our example of observing number of goals scored , we saw the set S--> (3,1,4,0,6,8,...2). A match can end in a draw (0 goals), or the number of goals could be 1 or 2 or n goals. The n goals will be finite and sensible. In some sense, we can count the number of goals or we can say number of goals is a whole number from 0 to n. n cannot take values like 1000, 500 for this experiment. Hence we call this as a discrete random variable as it is countable. Other examples of a discrete random variable could be number of students passing an examination, number of chairs in a classroom.

What is a Continuous Random Variable?

There are other forms of random experiments as well. Let's say I want to observe non-stop flight duration from Bangalore to Delhi each day for 1 month. Assuming only 1 flight each day the set S (in minutes)--> (160 , 150 , 200,201, 205, 207...234) . We have infinite number of choices for the flight duration. If we track at a second level, we may have values like 160.75, 160.25, 201.34 and so on. So the continuous random variable can possibly take infinite values. A discrete random variable can take finite values. Other possible continuous variables could be avearge temperature in a city on a given day , average duration of phone calls done by people between 7pm to 9pm.

Comments

Popular posts from this blog

How to adopt Embeddings for Categorical features in Tabular Data using PyTorch's nn.Embedding( )-- Part 2

In the previous post , we set up the context to utilize embeddings for categorical features. In this post, we will figure out how to create these embeddings and combine them with other continuous features to build a neural network model. Dataset Download We will utilize the UCI machine learning repo which has a dataset on credit card default for customers in Taiwan. This dataset is also available in Kaggle . Metadata about this dataset is available on the respective websites. To follow this post, it is recommended to download the dataset from Kaggle. Most of the features are self explanatory. Embedding Creation A few definitions first. Levels in a categorical feature represent unique values available for that categorical feature. For e.g. MARRIAGE has levels 0,1,2,3. Each level of a categorical feature is represented by a vector of numbers. So, if you stack up all the levels together and all the vectors together, you can imagine levels to be a colum...

Standard Normal Distribution with examples using Python

Standard Normal Distribution with examples In our previous post, we talked about Normal Distribution and its properties . In this post, we extend those ideas and discuss about Standard Normal Distribution in detail. What is a Standard Normal Distribution? A Normal Distribution with mean 0 and standard deviation 1 is called a Standard Normal Distribution . Mathematicallty, it is given as below. Fig 1:Standard Normal Probability Distribution Function For comparison, have a look at the Normal Probability Distribution Function. If you substitute mean as 0 ,standard deviation as 1, you derive the standard normal probability distribution function Fig 2: Normal Probability Distribution Function Need for a standard normal probability distribution function We need to extract probability information about events that we are interested in. For this, first we need to convert any normal random variable...

Continuous Uniform Probability Distribution with Python

Continuous Uniform Probability Distribution In an earlier post , we had discussed about Random Variables and what is a continuous random variable. An extension of those ideas comes in the form of a distribution called a Continuous Uniform Probability Distribution . In a continuous probability distribution, we are not interested in exact events. As an example of this, we would not be so bothered to know the chances of a duration of flight to be exactly 180 minutes or 177 minutes. We would be more keen in knowing the chances of a flight duration being between 150 minutes to 185 minutes. Time intervals are more important to extract probability information in this case. The simplest form of continuous probability distribution function is a unform probability distribution function. It is also called a rectangular distribution function due to its inherent rectangular shape. Let's assume that the flight duration from Bangalore to Delhi roughly takes...