![]() |
VOOZH | about |
A probability distribution determines the probability of all the outcomes a random variable takes. The distribution can either be continuous or discrete distribution depending upon the values that a random variable takes. There are several types of probability distribution like Normal distribution, Uniform distribution, exponential distribution, etc. In this article, we will see about Normal distribution and we will also see how we can use Python to plot the Normal distribution.
The normal distribution is a continuous probability distribution function also known as Gaussian distribution which is symmetric about its mean and has a bell-shaped curve. It is one of the most used probability distributions. Two parameters characterize it
The formula for Normal distribution is
Python programming language has several libraries which could be used to plot normal distribution and get the probability distributive function of data points.
We can use these modules to plot the normal distribution curve of data points. Also We
Calculating the Probability distribution of single data points using Python
Output:
1.9054722647301798Output:
Suppose there are 100 students in the class and in one of the mathematics tests the average marks scored by the students in the subject is 78 and the standard deviation is 25. The marks of the student follow Normal probability distribution. We can use this information to answer some questions about the student's marks.
Here we will use the norm() function from scipy.stats module to make the probability distribution for the population's mean equal to 78 and the standard deviation equal to 25.
scipy.stats.norm() is a normal continuous random variable. It is inherited from the generic methods as an instance of the rv_continuous class. It completes the methods with details specific to this particular distribution.
q : lower and upper tail probability
x : quantiles
loc : Mean . Default = 0
scale : [optional]scale parameter. Default = 1
size : [tuple of ints, optional] shape or random variates.Results : normal continuous random variable
Output:
Percentage of students who got less than 60 marks: 23.58 %It specifies that approx 23% percent of children have scored fewer marks than 60 in mathematics.
To get the percentage of people who have scored more than 70. We first find the probability of people who have scored less than 70 then we will subtract the probability from 1 to get the Number of people who have scored more than 70.
Output:
Percentage of students who got more than 70 marks: 62.55 %Output:
Percentage of students who got marks between 75 and 85 is 15.8 %